1
0
Fork 0

remove dependency on MMFilesLogfileManager

This commit is contained in:
jsteemann 2017-03-01 15:50:10 +01:00
parent 62f894c2b8
commit 42fccb69c6
4 changed files with 11 additions and 4 deletions

View File

@ -533,6 +533,10 @@ int MMFilesEngine::getCollectionsAndIndexes(TRI_vocbase_t* vocbase,
return TRI_ERROR_NO_ERROR;
}
void MMFilesEngine::waitForSync(TRI_voc_tick_t tick) {
MMFilesLogfileManager::instance()->slots()->waitForTick(tick);
}
TRI_vocbase_t* MMFilesEngine::openDatabase(arangodb::velocypack::Slice const& args, bool isUpgrade, int& status) {
VPackSlice idSlice = args.get("id");

View File

@ -117,6 +117,8 @@ class MMFilesEngine final : public StorageEngine {
std::string databasePath(TRI_vocbase_t const* vocbase) const override {
return databaseDirectory(vocbase->id());
}
void waitForSync(TRI_voc_tick_t tick) override;
virtual TRI_vocbase_t* openDatabase(arangodb::velocypack::Slice const& parameters, bool isUpgrade, int&) override;
Database* createDatabase(TRI_voc_tick_t id, arangodb::velocypack::Slice const& args, int& status) override {

View File

@ -125,6 +125,8 @@ class StorageEngine : public application_features::ApplicationFeature {
using Database = TRI_vocbase_t;
using CollectionView = LogicalCollection;
virtual void waitForSync(TRI_voc_tick_t tick) = 0;
//// operations on databasea

View File

@ -39,7 +39,6 @@
#include "Cluster/ServerState.h"
#include "Indexes/Index.h"
#include "Logger/Logger.h"
#include "MMFiles/MMFilesLogfileManager.h" //TODO -- remove -- waitForTick
#include "StorageEngine/EngineSelectorFeature.h"
#include "StorageEngine/StorageEngine.h"
#include "StorageEngine/TransactionCollection.h"
@ -1414,7 +1413,7 @@ OperationResult transaction::Methods::insertLocal(std::string const& collectionN
// wait for operation(s) to be synced to disk here
if (res == TRI_ERROR_NO_ERROR && options.waitForSync && maxTick > 0 && isSingleOperationTransaction()) {
MMFilesLogfileManager::instance()->slots()->waitForTick(maxTick);
EngineSelectorFeature::ENGINE->waitForSync(maxTick);
}
// Now see whether or not we have to do synchronous replication:
@ -1723,7 +1722,7 @@ OperationResult transaction::Methods::modifyLocal(
// wait for operation(s) to be synced to disk here
if (res == TRI_ERROR_NO_ERROR && options.waitForSync && maxTick > 0 && isSingleOperationTransaction()) {
MMFilesLogfileManager::instance()->slots()->waitForTick(maxTick);
EngineSelectorFeature::ENGINE->waitForSync(maxTick);
}
// Now see whether or not we have to do synchronous replication:
@ -1967,7 +1966,7 @@ OperationResult transaction::Methods::removeLocal(std::string const& collectionN
// wait for operation(s) to be synced to disk here
if (res == TRI_ERROR_NO_ERROR && options.waitForSync && maxTick > 0 && isSingleOperationTransaction()) {
MMFilesLogfileManager::instance()->slots()->waitForTick(maxTick);
EngineSelectorFeature::ENGINE->waitForSync(maxTick);
}
// Now see whether or not we have to do synchronous replication: