mirror of https://gitee.com/bigwinds/arangodb
remove dependency on MMFilesLogfileManager
This commit is contained in:
parent
62f894c2b8
commit
42fccb69c6
|
@ -534,6 +534,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");
|
||||
TRI_voc_tick_t id = static_cast<TRI_voc_tick_t>(basics::StringUtils::uint64(idSlice.copyString()));
|
||||
|
|
|
@ -118,6 +118,8 @@ class MMFilesEngine final : public StorageEngine {
|
|||
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 {
|
||||
status = TRI_ERROR_NO_ERROR;
|
||||
|
|
|
@ -126,6 +126,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
|
||||
|
||||
/// @brief opens a database
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue