8000 Feature/internal issue #672 by Dronplane · Pull Request #11370 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Feature/internal issue #672 #11370

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 39 commits into from
Apr 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
d41bf1b
Tests now passes
Dronplane Mar 25, 2020
6ab67ce
More tests
Dronplane Mar 25, 2020
cd77866
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Mar 25, 2020
c0ee917
Added compression settings
Dronplane Mar 25, 2020
d988302
Fixed storage compression settings
Dronplane Mar 25, 2020
9c7e874
reworked compression setting
Dronplane Mar 26, 2020
e431072
added mock compressor
Dronplane Mar 26, 2020
2cb1112
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Mar 26, 2020
b4daac1
fixed linking
Dronplane Mar 27, 2020
63f0fac
added primarySortCompression
Dronplane Mar 29, 2020
61975a8
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Mar 29, 2020
a92ce3b
Added tests
Dronplane Mar 30, 2020
5757c47
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Mar 30, 2020
ffa1248
fix tests for mac
Dronplane Mar 30, 2020
79561da
added primarySortCompression test
Dronplane Mar 30, 2020
e0b220f
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Mar 31, 2020
62ea27b
added primarySortCompression and storedValues compression to js tests.
Dronplane Apr 1, 2020
e6a390b
more tests
Dronplane Apr 1, 2020
3b60ac0
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Apr 1, 2020
80583ba
jslint fixes
Dronplane Apr 1, 2020
8a36791
code cleanup. Jaccard function fix for empty arrays
Dronplane Apr 1, 2020
b27ab6e
Update CHANGELOG
Dronplane Apr 1, 2020
e3f7746
Code cleanup. More tests
Dronplane Apr 1, 2020
8e12b0d
test fixes
Dronplane Apr 1, 2020
8c473c0
fixed bug
Dronplane Apr 1, 2020
373a884
test
Dronplane Apr 1, 2020
91d2f42
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Apr 1, 2020
93dd5f8
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Apr 2, 2020
5c9c0f5
adressed review comments
Dronplane Apr 2, 2020
f14afc2
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Apr 2, 2020
6429477
Fix after merge
Dronplane Apr 2, 2020
8edfb98
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Apr 2, 2020
975d709
Merge branch 'devel' into feature/internal-issue-#672
Dronplane Apr 2, 2020
693cd26
fix build
Dronplane Apr 2, 2020
a8a3dd5
cleanup
Dronplane Apr 2, 2020
523072b
cleanup
Dronplane Apr 2, 2020
da4c6f8
fixed backslash
Dronplane Apr 3, 2020
eafd1cf
fix
Dronplane Apr 3, 2020
022ee7a
fix typo
Dronplane Apr 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'devel' into feature/internal-issue-#672
  • Loading branch information
Dronplane committed Apr 2, 2020
commit f14afc20a8d018e451b630989de6b54f6ef2bd1d
2 changes: 0 additions & 2 deletions arangod/IResearch/IResearchLink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
#include "IResearch/IResearchView.h"
#include "IResearch/IResearchViewCoordinator.h"
#include "IResearch/VelocyPackHelper.h"
#include "IResearch/IResearchKludge.h"
#include "MMFiles/MMFilesCollection.h"
#include "RestServer/DatabaseFeature.h"
#include "RestServer/DatabasePathFeature.h"
#include "RestServer/FlushFeature.h"
Expand Down
13 changes: 1 addition & 12 deletions tests/Mocks/StorageEngineMock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ std::shared_ptr<arangodb::Index> PhysicalCollectionMock::createIndex(
server.getFeature<arangodb::iresearch::IResearchFeature>().factory<arangodb::ClusterEngine>();
index = factory.instantiate(_logicalCollection, info, id, false);
} else {
index = IResearchDBServerLinkMock::make(id, _logicalCollection, info);
index = IResearchLinkMock::buildLinkMock(id, _logicalCollection, info);
}
} catch (std::exception const& ex) {
// ignore the details of all errors here
Expand Down Expand Up @@ -1803,17 +1803,6 @@ int StorageEngineMock::writeCreateDatabaseMarker(TRI_voc_tick_t id, VPackSlice c
return TRI_ERROR_NO_ERROR;
}

std::shared_ptr<arangodb::iresearch::IResearchLinkMock> StorageEngineMock::buildLinkMock(
arangodb::IndexId id, arangodb::LogicalCollection& collection, VPackSlice const& info) {
auto index = std::shared_ptr<arangodb::iresearch::IResearchLinkMock>(
new arangodb::iresearch::IResearchLinkMock(id, collection));
auto res = static_cast<arangodb::iresearch::IResearchLinkMock*>(index.get())->init(info);

if (!res.ok()) {
THROW_ARANGO_EXCEPTION(res);
}
return index;
}

TransactionCollectionMock::TransactionCollectionMock(arangodb::TransactionState* state,
TRI_voc_cid_t cid,
Expand Down
109 changes: 1 addition & 108 deletions tests/Mocks/StorageEngineMock.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@
#include "StorageEngine/TransactionCollection.h"
#include "StorageEngine/TransactionState.h"
#include "Transaction/ContextData.h"
#include "IResearch/IResearchLink.h"
#include "IResearch/IResearchLinkMock.h"
#include "VocBase/Identifiers/IndexId.h"
#include "VocBase/Identifiers/LocalDocumentId.h"
#include "IResearch/IResearchLinkHelper.h"

namespace arangodb {

Expand All @@ -46,9 +45,6 @@ class WalAccess;
namespace aql {
class OptimizerRulesFeature;
}
namespace iresearch {
class IResearchLinkMock;
}

} // namespace arangodb

Expand Down Expand Up @@ -180,105 +176,6 @@ class TransactionStateMock : public arangodb::TransactionState {
virtual bool hasFailedOperations() const override;
};


class IResearchDBServerLinkMock : public arangodb::Index, public arangodb::iresearch::IResearchLink {
public:
IResearchDBServerLinkMock(arangodb::IndexId iid, arangodb::LogicalCollection& collection) :
IResearchLink(iid, collection), Index(iid, collection, arangodb::iresearch::IResearchLinkHelper::emptyIndexSlice()) {
_unique = false; // cannot be unique since multiple fields are indexed
_sparse = true; // always sparse
}

static std::shared_ptr<arangodb::Index> make(arangodb::IndexId iid,
arangodb::LogicalCollection& collection,
arangodb::velocypack::Slice const& definition) {
auto link = std::make_shared<IResearchDBServerLinkMock>(iid, collection);
link->init(definition, [](irs::directory& dir) {
if (InitCallback != nullptr) {
InitCallback(dir);
}
});
return link;
}

[[nodiscard]] static auto setCallbakForScope(std::function<void(irs::directory&)> callback) {
InitCallback = callback;
return irs::make_finally([]() {InitCallback = nullptr; });
}

IndexType type() const override { return IResearchLink::type(); }

char const* typeName() const override {
return IResearchLink::typeName();
}

void unload() override {
auto res = IResearchLink::unload();

if (!res.ok()) {
THROW_ARANGO_EXCEPTION(res);
}
}

void afterTruncate(TRI_voc_tick_t /*tick*/) override {
IResearchLink::afterTruncate();
};

void batchInsert(
arangodb::transaction::Methods& trx,
std::vector<std::pair<arangodb::LocalDocumentId, arangodb::velocypack::Slice>> const& documents,
std::shared_ptr<arangodb::basics::LocalTaskQueue> queue) override {
IResearchLink::batchInsert(trx, documents, queue);
}

bool canBeDropped() const override {
return IResearchLink::canBeDropped();
}

arangodb::Result drop() override { return IResearchLink::drop(); }

bool hasSelectivityEstimate() const override {
return IResearchLink::hasSelectivityEstimate();
}

arangodb::Result insert(arangodb::transaction::Methods& trx,
arangodb::LocalDocumentId const& documentId,
arangodb::velocypack::Slice const& doc,
arangodb::Index::OperationMode mode) {
return IResearchLink::insert(trx, documentId, doc, mode);
}

bool isPersistent() const override { return true; }

bool isSorted() const override { return IResearchLink::isSorted(); }

bool isHidden() const override { return IResearchLink::isHidden(); }

bool needsReversal() const override { return true; }

void load() override { IResearchLink::load(); }

bool matchesDefinition(arangodb::velocypack::Slice const& slice) const override {
return IResearchLink::matchesDefinition(slice);
}

size_t memory() const override {
// FIXME return in memory size
return stats().indexSize;
}

using Index::toVelocyPack; // for std::shared_ptr<Builder> Index::toVelocyPack(bool, Index::Serialize)
void toVelocyPack(arangodb::velocypack::Builder& builder,
std::underlying_type<arangodb::Index::Serialize>::type) const override;

void toVelocyPackFigures(arangodb::velocypack::Builder& builder) const override {
IResearchLink::toVelocyPackStats(builder);
}

private:
static std::function<void(irs::directory&)> InitCallback;
};

class StorageEngineMock : public arangodb::StorageEngine {
public:
static std::function<void()> before;
Expand Down Expand Up @@ -382,10 +279,6 @@ class StorageEngineMock : public arangodb::StorageEngine {
virtual arangodb::WalAccess const* walAccess() const override;
virtual int writeCreateDatabaseMarker(TRI_voc_tick_t id, VPackSlice const& slice) override;

// public helper function for testing
static std::shared_ptr<arangodb::iresearch::IResearchLinkMock> buildLinkMock(
arangodb::IndexId id, arangodb::LogicalCollection& collection, arangodb::velocypack::Slice const& info);

private:
TRI_voc_tick_t _releasedTick;
};
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0