Merge pull request #4238 from sfc-gh-anoyes/anoyes/modernize-use-override
Apply modernize-use-override to several files
This commit is contained in:
commit
7e38cf21f5
|
@ -111,11 +111,13 @@ if(NOT WIN32)
|
|||
set_property(TARGET mako PROPERTY SKIP_BUILD_RPATH TRUE)
|
||||
target_link_libraries(mako PRIVATE fdb_c)
|
||||
|
||||
if(NOT OPEN_FOR_IDE)
|
||||
# Make sure that fdb_c.h is compatible with c90
|
||||
add_executable(fdb_c90_test test/fdb_c90_test.c)
|
||||
set_property(TARGET fdb_c90_test PROPERTY C_STANDARD 90)
|
||||
target_compile_options(fdb_c90_test PRIVATE -Wall -Wextra -Wpedantic -Werror)
|
||||
target_link_libraries(fdb_c90_test PRIVATE fdb_c)
|
||||
endif()
|
||||
|
||||
add_fdbclient_test(
|
||||
NAME fdb_c_setup_tests
|
||||
|
|
|
@ -383,6 +383,9 @@ function(add_fdbclient_test)
|
|||
set(oneValueArgs NAME)
|
||||
set(multiValueArgs COMMAND)
|
||||
cmake_parse_arguments(T "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
|
||||
if(OPEN_FOR_IDE)
|
||||
return()
|
||||
endif()
|
||||
if(NOT T_ENABLED AND T_DISABLED)
|
||||
return()
|
||||
endif()
|
||||
|
|
|
@ -11,9 +11,11 @@ endif()
|
|||
add_flow_target(EXECUTABLE NAME fdbcli SRCS ${FDBCLI_SRCS})
|
||||
target_link_libraries(fdbcli PRIVATE fdbclient)
|
||||
|
||||
if(NOT OPEN_FOR_IDE)
|
||||
if(GENERATE_DEBUG_PACKAGES)
|
||||
fdb_install(TARGETS fdbcli DESTINATION bin COMPONENT clients)
|
||||
else()
|
||||
add_custom_target(prepare_fdbcli_install ALL DEPENDS strip_only_fdbcli)
|
||||
fdb_install(PROGRAMS ${CMAKE_BINARY_DIR}/packages/bin/fdbcli DESTINATION bin COMPONENT clients)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -281,7 +281,7 @@ public:
|
|||
|
||||
std::string getFilename() const override { return m_object; }
|
||||
|
||||
virtual ~AsyncFileS3BlobStoreRead() {}
|
||||
~AsyncFileS3BlobStoreRead() override {}
|
||||
|
||||
Reference<S3BlobStoreEndpoint> m_bstore;
|
||||
std::string m_bucket;
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
void delref() override = 0;
|
||||
|
||||
BackupContainerFileSystem() {}
|
||||
virtual ~BackupContainerFileSystem() {}
|
||||
~BackupContainerFileSystem() override {}
|
||||
|
||||
// Create the container
|
||||
Future<Void> create() override = 0;
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
m_buffer.reserve(m_buffer.arena(), CLIENT_KNOBS->BACKUP_LOCAL_FILE_WRITE_BLOCK);
|
||||
}
|
||||
|
||||
Future<Void> append(const void* data, int len) {
|
||||
Future<Void> append(const void* data, int len) override {
|
||||
m_buffer.append(m_buffer.arena(), (const uint8_t*)data, len);
|
||||
|
||||
if (m_buffer.size() >= CLIENT_KNOBS->BACKUP_LOCAL_FILE_WRITE_BLOCK) {
|
||||
|
@ -70,9 +70,9 @@ public:
|
|||
return Void();
|
||||
}
|
||||
|
||||
int64_t size() const { return m_buffer.size() + m_writeOffset; }
|
||||
int64_t size() const override { return m_buffer.size() + m_writeOffset; }
|
||||
|
||||
Future<Void> finish() { return finish_impl(Reference<BackupFile>::addRef(this)); }
|
||||
Future<Void> finish() override { return finish_impl(Reference<BackupFile>::addRef(this)); }
|
||||
|
||||
void addref() override { return ReferenceCounted<BackupFile>::addref(); }
|
||||
void delref() override { return ReferenceCounted<BackupFile>::delref(); }
|
||||
|
|
|
@ -48,13 +48,13 @@ public:
|
|||
BackupFile(std::string fileName, Reference<IAsyncFile> file)
|
||||
: IBackupFile(fileName), m_file(file), m_offset(0) {}
|
||||
|
||||
Future<Void> append(const void* data, int len) {
|
||||
Future<Void> append(const void* data, int len) override {
|
||||
Future<Void> r = m_file->write(data, len, m_offset);
|
||||
m_offset += len;
|
||||
return r;
|
||||
}
|
||||
|
||||
Future<Void> finish() {
|
||||
Future<Void> finish() override {
|
||||
Reference<BackupFile> self = Reference<BackupFile>::addRef(this);
|
||||
return map(m_file->sync(), [=](Void _) {
|
||||
self->m_file.clear();
|
||||
|
|
|
@ -138,10 +138,10 @@ namespace dbBackup {
|
|||
static const Key keyAddBackupRangeTasks;
|
||||
static const Key keyBackupRangeBeginKey;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
|
||||
ACTOR static Future<Standalone<VectorRef<KeyRef>>> getBlockOfShards(Reference<ReadYourWritesTransaction> tr, Key beginKey, Key endKey, int limit) {
|
||||
tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
|
||||
|
@ -459,10 +459,10 @@ namespace dbBackup {
|
|||
return LiteralStringRef("OnSetAddTask");
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
|
||||
};
|
||||
StringRef FinishFullBackupTaskFunc::name = LiteralStringRef("dr_finish_full_backup");
|
||||
|
@ -472,10 +472,10 @@ namespace dbBackup {
|
|||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
|
||||
ACTOR static Future<Void> _execute(Database cx, Reference<TaskBucket> taskBucket, Reference<FutureBucket> futureBucket, Reference<Task> task) {
|
||||
state FlowLock lock(CLIENT_KNOBS->BACKUP_LOCK_BYTES);
|
||||
|
@ -533,10 +533,10 @@ namespace dbBackup {
|
|||
|
||||
static const Key keyNextBeginVersion;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
|
||||
// store mutation data from results until the end of stream or the timeout. If breaks on timeout returns the first uncopied version
|
||||
ACTOR static Future<Optional<Version>> dumpData(
|
||||
|
@ -866,10 +866,10 @@ namespace dbBackup {
|
|||
return LiteralStringRef("OnSetAddTask");
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef CopyLogsTaskFunc::name = LiteralStringRef("dr_copy_logs");
|
||||
REGISTER_TASKFUNC(CopyLogsTaskFunc);
|
||||
|
@ -879,7 +879,7 @@ namespace dbBackup {
|
|||
static constexpr uint32_t version = 1;
|
||||
static const Key keyInsertTask;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
ACTOR static Future<Void> _execute(Database cx, Reference<TaskBucket> taskBucket, Reference<FutureBucket> futureBucket, Reference<Task> task) {
|
||||
state Subspace sourceStates = Subspace(databaseBackupPrefixRange.begin).get(BackupAgentBase::keySourceStates).get(task->params[BackupAgentBase::keyConfigLogUid]);
|
||||
|
@ -968,8 +968,8 @@ namespace dbBackup {
|
|||
return Void();
|
||||
}
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef FinishedFullBackupTaskFunc::name = LiteralStringRef("dr_finished_full_backup");
|
||||
const Key FinishedFullBackupTaskFunc::keyInsertTask = LiteralStringRef("insertTask");
|
||||
|
@ -1048,10 +1048,10 @@ namespace dbBackup {
|
|||
return LiteralStringRef("OnSetAddTask");
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef CopyDiffLogsTaskFunc::name = LiteralStringRef("dr_copy_diff_logs");
|
||||
REGISTER_TASKFUNC(CopyDiffLogsTaskFunc);
|
||||
|
@ -1067,10 +1067,10 @@ namespace dbBackup {
|
|||
return Void();
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef SkipOldEraseLogRangeTaskFunc::name = LiteralStringRef("dr_skip_legacy_task");
|
||||
REGISTER_TASKFUNC(SkipOldEraseLogRangeTaskFunc);
|
||||
|
@ -1087,10 +1087,10 @@ namespace dbBackup {
|
|||
|
||||
static const Key keyNextBeginVersion;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
|
||||
ACTOR static Future<Void> dumpData(Database cx, Reference<Task> task, PromiseStream<RCGroup> results, FlowLock* lock, Reference<TaskBucket> tb) {
|
||||
state bool endOfStream = false;
|
||||
|
@ -1303,10 +1303,10 @@ namespace dbBackup {
|
|||
return LiteralStringRef("OnSetAddTask");
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef AbortOldBackupTaskFunc::name = LiteralStringRef("dr_abort_legacy_backup");
|
||||
REGISTER_TASKFUNC(AbortOldBackupTaskFunc);
|
||||
|
@ -1421,10 +1421,10 @@ namespace dbBackup {
|
|||
return Void();
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef CopyDiffLogsUpgradeTaskFunc::name = LiteralStringRef("db_copy_diff_logs");
|
||||
REGISTER_TASKFUNC(CopyDiffLogsUpgradeTaskFunc);
|
||||
|
@ -1512,10 +1512,10 @@ namespace dbBackup {
|
|||
return LiteralStringRef("OnSetAddTask");
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef BackupRestorableTaskFunc::name = LiteralStringRef("dr_backup_restorable");
|
||||
REGISTER_TASKFUNC(BackupRestorableTaskFunc);
|
||||
|
@ -1711,10 +1711,10 @@ namespace dbBackup {
|
|||
return LiteralStringRef("OnSetAddTask");
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef StartFullBackupTaskFunc::name = LiteralStringRef("dr_start_full_backup");
|
||||
REGISTER_TASKFUNC(StartFullBackupTaskFunc);
|
||||
|
|
|
@ -43,7 +43,8 @@ public:
|
|||
static Reference<StorageServerInfo> getInterface( DatabaseContext *cx, StorageServerInterface const& interf, LocalityData const& locality );
|
||||
void notifyContextDestroyed();
|
||||
|
||||
virtual ~StorageServerInfo();
|
||||
~StorageServerInfo() override;
|
||||
|
||||
private:
|
||||
DatabaseContext *cx;
|
||||
StorageServerInfo( DatabaseContext *cx, StorageServerInterface const& interf, LocalityData const& locality ) : cx(cx), ReferencedInterface<StorageServerInterface>(interf, locality) {}
|
||||
|
|
|
@ -802,8 +802,8 @@ namespace fileBackup {
|
|||
return StringRef();
|
||||
}
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Future<Void>(Void()); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Future<Void>(Void()); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef AbortFiveZeroBackupTask::name = LiteralStringRef("abort_legacy_backup");
|
||||
REGISTER_TASKFUNC(AbortFiveZeroBackupTask);
|
||||
|
@ -872,8 +872,8 @@ namespace fileBackup {
|
|||
return StringRef();
|
||||
}
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Future<Void>(Void()); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Future<Void>(Void()); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef AbortFiveOneBackupTask::name = LiteralStringRef("abort_legacy_backup_5.2");
|
||||
REGISTER_TASKFUNC(AbortFiveOneBackupTask);
|
||||
|
@ -995,10 +995,10 @@ namespace fileBackup {
|
|||
);
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
|
||||
// Finish (which flushes/syncs) the file, and then in a single transaction, make some range backup progress durable.
|
||||
// This means:
|
||||
|
@ -1289,10 +1289,10 @@ namespace fileBackup {
|
|||
}
|
||||
} Params;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
|
||||
ACTOR static Future<Key> addTask(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> taskBucket, Reference<Task> parentTask, int priority, TaskCompletionKey completionKey, Reference<TaskFuture> waitFor = Reference<TaskFuture>(), Version scheduledVersion = invalidVersion) {
|
||||
Key key = wait(addBackupTask(name,
|
||||
|
@ -1809,10 +1809,10 @@ namespace fileBackup {
|
|||
}
|
||||
} Params;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
|
||||
ACTOR static Future<Void> _execute(Database cx, Reference<TaskBucket> taskBucket, Reference<FutureBucket> futureBucket, Reference<Task> task) {
|
||||
state Reference<FlowLock> lock(new FlowLock(CLIENT_KNOBS->BACKUP_LOCK_BYTES));
|
||||
|
@ -1995,7 +1995,7 @@ namespace fileBackup {
|
|||
struct EraseLogRangeTaskFunc : BackupTaskFuncBase {
|
||||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
static struct {
|
||||
static TaskParam<Version> beginVersion() {
|
||||
|
@ -2041,8 +2041,8 @@ namespace fileBackup {
|
|||
return Void();
|
||||
}
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef EraseLogRangeTaskFunc::name = LiteralStringRef("file_backup_erase_logs_5.2");
|
||||
REGISTER_TASKFUNC(EraseLogRangeTaskFunc);
|
||||
|
@ -2166,10 +2166,10 @@ namespace fileBackup {
|
|||
return key;
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef BackupLogsDispatchTask::name = LiteralStringRef("file_backup_dispatch_logs_5.2");
|
||||
REGISTER_TASKFUNC(BackupLogsDispatchTask);
|
||||
|
@ -2178,7 +2178,7 @@ namespace fileBackup {
|
|||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
ACTOR static Future<Void> _finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> taskBucket, Reference<FutureBucket> futureBucket, Reference<Task> task) {
|
||||
wait(checkTaskVersion(tr->getDatabase(), task, FileBackupFinishedTask::name, FileBackupFinishedTask::version));
|
||||
|
@ -2208,8 +2208,8 @@ namespace fileBackup {
|
|||
return key;
|
||||
}
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef FileBackupFinishedTask::name = LiteralStringRef("file_backup_finished_5.2");
|
||||
REGISTER_TASKFUNC(FileBackupFinishedTask);
|
||||
|
@ -2366,10 +2366,10 @@ namespace fileBackup {
|
|||
return key;
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef BackupSnapshotManifest::name = LiteralStringRef("file_backup_write_snapshot_manifest_5.2");
|
||||
REGISTER_TASKFUNC(BackupSnapshotManifest);
|
||||
|
@ -2518,10 +2518,10 @@ namespace fileBackup {
|
|||
return key;
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef StartFullBackupTaskFunc::name = LiteralStringRef("file_backup_start_5.2");
|
||||
REGISTER_TASKFUNC(StartFullBackupTaskFunc);
|
||||
|
@ -2567,10 +2567,10 @@ namespace fileBackup {
|
|||
|
||||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
|
||||
};
|
||||
StringRef RestoreCompleteTaskFunc::name = LiteralStringRef("restore_complete");
|
||||
|
@ -2830,10 +2830,10 @@ namespace fileBackup {
|
|||
|
||||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef RestoreRangeTaskFunc::name = LiteralStringRef("restore_range_data");
|
||||
REGISTER_TASKFUNC(RestoreRangeTaskFunc);
|
||||
|
@ -2841,7 +2841,7 @@ namespace fileBackup {
|
|||
struct RestoreLogDataTaskFunc : RestoreFileTaskFuncBase {
|
||||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
static struct : InputParams {
|
||||
} Params;
|
||||
|
@ -2979,8 +2979,8 @@ namespace fileBackup {
|
|||
return LiteralStringRef("OnSetAddTask");
|
||||
}
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef RestoreLogDataTaskFunc::name = LiteralStringRef("restore_log_data");
|
||||
REGISTER_TASKFUNC(RestoreLogDataTaskFunc);
|
||||
|
@ -2988,7 +2988,7 @@ namespace fileBackup {
|
|||
struct RestoreDispatchTaskFunc : RestoreTaskFuncBase {
|
||||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
static struct {
|
||||
static TaskParam<Version> beginVersion() { return LiteralStringRef(__FUNCTION__); }
|
||||
|
@ -3291,8 +3291,8 @@ namespace fileBackup {
|
|||
return LiteralStringRef("OnSetAddTask");
|
||||
}
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef RestoreDispatchTaskFunc::name = LiteralStringRef("restore_dispatch");
|
||||
REGISTER_TASKFUNC(RestoreDispatchTaskFunc);
|
||||
|
@ -3577,10 +3577,10 @@ namespace fileBackup {
|
|||
return LiteralStringRef("OnSetAddTask");
|
||||
}
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
StringRef getName() const override { return name; };
|
||||
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _execute(cx, tb, fb, task); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) override { return _finish(tr, tb, fb, task); };
|
||||
};
|
||||
StringRef StartFullRestoreTaskFunc::name = LiteralStringRef("restore_start");
|
||||
REGISTER_TASKFUNC(StartFullRestoreTaskFunc);
|
||||
|
|
|
@ -132,7 +132,7 @@ public:
|
|||
api->futureSetCallback(f, &futureCallback, this);
|
||||
}
|
||||
|
||||
~DLThreadSingleAssignmentVar() {
|
||||
~DLThreadSingleAssignmentVar() override {
|
||||
lock.assertNotEntered();
|
||||
if(f) {
|
||||
ASSERT_ABORT(futureRefCount == 1);
|
||||
|
|
|
@ -132,7 +132,7 @@ struct FdbCApi : public ThreadSafeReferenceCounted<FdbCApi> {
|
|||
class DLTransaction : public ITransaction, ThreadSafeReferenceCounted<DLTransaction> {
|
||||
public:
|
||||
DLTransaction(Reference<FdbCApi> api, FdbCApi::FDBTransaction *tr) : api(api), tr(tr) {}
|
||||
~DLTransaction() { api->transactionDestroy(tr); }
|
||||
~DLTransaction() override { api->transactionDestroy(tr); }
|
||||
|
||||
void cancel() override;
|
||||
void setVersion(Version v) override;
|
||||
|
@ -183,7 +183,7 @@ class DLDatabase : public IDatabase, ThreadSafeReferenceCounted<DLDatabase> {
|
|||
public:
|
||||
DLDatabase(Reference<FdbCApi> api, FdbCApi::FDBDatabase *db) : api(api), db(db), ready(Void()) {}
|
||||
DLDatabase(Reference<FdbCApi> api, ThreadFuture<FdbCApi::FDBDatabase*> dbFuture);
|
||||
~DLDatabase() {
|
||||
~DLDatabase() override {
|
||||
if (db) {
|
||||
api->databaseDestroy(db);
|
||||
}
|
||||
|
@ -321,7 +321,7 @@ class MultiVersionApi;
|
|||
class MultiVersionDatabase final : public IDatabase, ThreadSafeReferenceCounted<MultiVersionDatabase> {
|
||||
public:
|
||||
MultiVersionDatabase(MultiVersionApi *api, std::string clusterFilePath, Reference<IDatabase> db, bool openConnectors=true);
|
||||
~MultiVersionDatabase();
|
||||
~MultiVersionDatabase() override;
|
||||
|
||||
Reference<ITransaction> createTransaction() override;
|
||||
void setOption(FDBDatabaseOptions::Option option, Optional<StringRef> value = Optional<StringRef>()) override;
|
||||
|
|
|
@ -93,7 +93,7 @@ public:
|
|||
|
||||
explicit SpecialKeyRangeRWImpl(KeyRangeRef kr) : SpecialKeyRangeReadImpl(kr) {}
|
||||
|
||||
virtual ~SpecialKeyRangeRWImpl() {}
|
||||
~SpecialKeyRangeRWImpl() override {}
|
||||
};
|
||||
|
||||
class SpecialKeyRangeAsyncImpl : public SpecialKeyRangeReadImpl {
|
||||
|
|
|
@ -29,9 +29,15 @@ Reference<TaskFuture> Task::getDoneFuture(Reference<FutureBucket> fb) {
|
|||
struct UnblockFutureTaskFunc : TaskFuncBase {
|
||||
static StringRef name;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
StringRef getName() const override { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return Void();
|
||||
};
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return _finish(tr, tb, fb, task);
|
||||
};
|
||||
|
||||
ACTOR static Future<Void> _finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> taskBucket, Reference<FutureBucket> futureBucket, Reference<Task> task) {
|
||||
state Reference<TaskFuture> future = futureBucket->unpack(task->params[Task::reservedTaskParamKeyFuture]);
|
||||
|
@ -55,9 +61,13 @@ REGISTER_TASKFUNC(UnblockFutureTaskFunc);
|
|||
struct AddTaskFunc : TaskFuncBase {
|
||||
static StringRef name;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) {
|
||||
StringRef getName() const override { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return Void();
|
||||
};
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
task->params[Task::reservedTaskParamKeyType] = task->params[Task::reservedTaskParamKeyAddTask];
|
||||
tb->addTask(tr, task);
|
||||
return Void();
|
||||
|
@ -71,9 +81,15 @@ struct IdleTaskFunc : TaskFuncBase {
|
|||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return tb->finish(tr, task); };
|
||||
StringRef getName() const override { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return Void();
|
||||
};
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return tb->finish(tr, task);
|
||||
};
|
||||
};
|
||||
StringRef IdleTaskFunc::name = LiteralStringRef("idle");
|
||||
REGISTER_TASKFUNC(IdleTaskFunc);
|
||||
|
|
|
@ -29,20 +29,20 @@
|
|||
|
||||
class ThreadSafeDatabase : public IDatabase, public ThreadSafeReferenceCounted<ThreadSafeDatabase> {
|
||||
public:
|
||||
~ThreadSafeDatabase();
|
||||
~ThreadSafeDatabase() override;
|
||||
static ThreadFuture<Reference<IDatabase>> createFromExistingDatabase(Database cx);
|
||||
|
||||
Reference<ITransaction> createTransaction();
|
||||
Reference<ITransaction> createTransaction() override;
|
||||
|
||||
void setOption( FDBDatabaseOptions::Option option, Optional<StringRef> value = Optional<StringRef>() );
|
||||
void setOption(FDBDatabaseOptions::Option option, Optional<StringRef> value = Optional<StringRef>()) override;
|
||||
|
||||
ThreadFuture<Void> onConnected(); // Returns after a majority of coordination servers are available and have reported a leader. The cluster file therefore is valid, but the database might be unavailable.
|
||||
|
||||
void addref() { ThreadSafeReferenceCounted<ThreadSafeDatabase>::addref(); }
|
||||
void delref() { ThreadSafeReferenceCounted<ThreadSafeDatabase>::delref(); }
|
||||
void addref() override { ThreadSafeReferenceCounted<ThreadSafeDatabase>::addref(); }
|
||||
void delref() override { ThreadSafeReferenceCounted<ThreadSafeDatabase>::delref(); }
|
||||
|
||||
ThreadFuture<int64_t> rebootWorker(const StringRef& address, bool check, int duration);
|
||||
ThreadFuture<Void> forceRecoveryWithDataLoss(const StringRef& dcid);
|
||||
ThreadFuture<int64_t> rebootWorker(const StringRef& address, bool check, int duration) override;
|
||||
ThreadFuture<Void> forceRecoveryWithDataLoss(const StringRef& dcid) override;
|
||||
|
||||
private:
|
||||
friend class ThreadSafeTransaction;
|
||||
|
@ -56,7 +56,7 @@ public: // Internal use only
|
|||
class ThreadSafeTransaction : public ITransaction, ThreadSafeReferenceCounted<ThreadSafeTransaction>, NonCopyable {
|
||||
public:
|
||||
explicit ThreadSafeTransaction(DatabaseContext* cx);
|
||||
~ThreadSafeTransaction();
|
||||
~ThreadSafeTransaction() override;
|
||||
|
||||
void cancel() override;
|
||||
void setVersion( Version v ) override;
|
||||
|
@ -118,18 +118,18 @@ private:
|
|||
|
||||
class ThreadSafeApi : public IClientApi, ThreadSafeReferenceCounted<ThreadSafeApi> {
|
||||
public:
|
||||
void selectApiVersion(int apiVersion);
|
||||
const char* getClientVersion();
|
||||
void selectApiVersion(int apiVersion) override;
|
||||
const char* getClientVersion() override;
|
||||
ThreadFuture<uint64_t> getServerProtocol(const char* clusterFilePath) override;
|
||||
|
||||
void setNetworkOption(FDBNetworkOptions::Option option, Optional<StringRef> value = Optional<StringRef>());
|
||||
void setupNetwork();
|
||||
void runNetwork();
|
||||
void stopNetwork();
|
||||
void setNetworkOption(FDBNetworkOptions::Option option, Optional<StringRef> value = Optional<StringRef>()) override;
|
||||
void setupNetwork() override;
|
||||
void runNetwork() override;
|
||||
void stopNetwork() override;
|
||||
|
||||
Reference<IDatabase> createDatabase(const char *clusterFilePath);
|
||||
Reference<IDatabase> createDatabase(const char* clusterFilePath) override;
|
||||
|
||||
void addNetworkThreadCompletionHook(void (*hook)(void*), void *hookParameter);
|
||||
void addNetworkThreadCompletionHook(void (*hook)(void*), void* hookParameter) override;
|
||||
|
||||
static IClientApi* api;
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
~AsyncFileCached();
|
||||
~AsyncFileCached() override;
|
||||
|
||||
private:
|
||||
static std::map< std::string, OpenFileInfo > openFiles;
|
||||
|
@ -570,7 +570,7 @@ struct AFCPage : public EvictablePage, public FastAllocated<AFCPage> {
|
|||
pageCache->allocate(this);
|
||||
}
|
||||
|
||||
virtual ~AFCPage() {
|
||||
~AFCPage() override {
|
||||
clearDirty();
|
||||
ASSERT_ABORT( flushableIndex == -1 );
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ public:
|
|||
return dispatch_impl(func);
|
||||
}
|
||||
|
||||
~AsyncFileEIO() { close_impl( fd ); }
|
||||
~AsyncFileEIO() override { close_impl(fd); }
|
||||
|
||||
private:
|
||||
struct ErrorInfo : ReferenceCounted<ErrorInfo>, FastAllocated<ErrorInfo> {
|
||||
|
|
|
@ -343,7 +343,7 @@ public:
|
|||
Future<int64_t> size() const override { return nextFileSize; }
|
||||
int64_t debugFD() const override { return fd; }
|
||||
std::string getFilename() const override { return filename; }
|
||||
~AsyncFileKAIO() {
|
||||
~AsyncFileKAIO() override {
|
||||
close(fd);
|
||||
|
||||
#if KAIO_LOGGING
|
||||
|
|
|
@ -239,7 +239,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
~AsyncFileNonDurable() {
|
||||
~AsyncFileNonDurable() override {
|
||||
//TraceEvent("AsyncFileNonDurable_Destroy", id).detail("Filename", filename);
|
||||
}
|
||||
|
||||
|
@ -288,7 +288,7 @@ public:
|
|||
|
||||
//Fsyncs the file. This allows all delayed modifications to the file to complete before
|
||||
//syncing the underlying file
|
||||
Future<Void> sync() {
|
||||
Future<Void> sync() override {
|
||||
//TraceEvent("AsyncFileNonDurable_Sync", id).detail("Filename", filename);
|
||||
Future<Void> syncFuture = sync(this, true);
|
||||
reponses.add( syncFuture );
|
||||
|
|
|
@ -177,7 +177,7 @@ public:
|
|||
|
||||
std::string getFilename() const override { return m_f->getFilename(); }
|
||||
|
||||
~AsyncFileReadAheadCache() {
|
||||
~AsyncFileReadAheadCache() override {
|
||||
for(auto &it : m_blocks) {
|
||||
it.second.cancel();
|
||||
}
|
||||
|
|
|
@ -27,26 +27,26 @@
|
|||
|
||||
class AsyncFileWriteChecker : public IAsyncFile, public ReferenceCounted<AsyncFileWriteChecker> {
|
||||
public:
|
||||
void addref() { ReferenceCounted<AsyncFileWriteChecker>::addref(); }
|
||||
void delref() { ReferenceCounted<AsyncFileWriteChecker>::delref(); }
|
||||
void addref() override { ReferenceCounted<AsyncFileWriteChecker>::addref(); }
|
||||
void delref() override { ReferenceCounted<AsyncFileWriteChecker>::delref(); }
|
||||
|
||||
// For read() and write(), the data buffer must remain valid until the future is ready
|
||||
Future<int> read( void* data, int length, int64_t offset ) {
|
||||
Future<int> read(void* data, int length, int64_t offset) override {
|
||||
return map(m_f->read(data, length, offset), [=](int r) {
|
||||
updateChecksumHistory(false, offset, r, (uint8_t*)data);
|
||||
return r;
|
||||
});
|
||||
}
|
||||
Future<Void> readZeroCopy( void** data, int* length, int64_t offset ) {
|
||||
Future<Void> readZeroCopy(void** data, int* length, int64_t offset) override {
|
||||
return map(m_f->readZeroCopy(data, length, offset), [=](Void r) { updateChecksumHistory(false, offset, *length, (uint8_t *)data); return r; });
|
||||
}
|
||||
|
||||
Future<Void> write( void const* data, int length, int64_t offset ) {
|
||||
Future<Void> write(void const* data, int length, int64_t offset) override {
|
||||
updateChecksumHistory(true, offset, length, (uint8_t *)data);
|
||||
return m_f->write(data, length, offset);
|
||||
}
|
||||
|
||||
Future<Void> truncate( int64_t size ) {
|
||||
Future<Void> truncate(int64_t size) override {
|
||||
return map(m_f->truncate(size), [=](Void r) {
|
||||
// Truncate the page checksum history if it is in use
|
||||
if( (size / checksumHistoryPageSize) < checksumHistory.size() ) {
|
||||
|
@ -58,11 +58,13 @@ public:
|
|||
});
|
||||
}
|
||||
|
||||
Future<Void> sync() { return m_f->sync(); }
|
||||
Future<Void> flush() { return m_f->flush(); }
|
||||
Future<Void> sync() override { return m_f->sync(); }
|
||||
Future<Void> flush() override { return m_f->flush(); }
|
||||
Future<int64_t> size() const override { return m_f->size(); }
|
||||
std::string getFilename() const override { return m_f->getFilename(); }
|
||||
void releaseZeroCopy( void* data, int length, int64_t offset ) { return m_f->releaseZeroCopy(data, length, offset); }
|
||||
void releaseZeroCopy(void* data, int length, int64_t offset) override {
|
||||
return m_f->releaseZeroCopy(data, length, offset);
|
||||
}
|
||||
int64_t debugFD() const override { return m_f->debugFD(); }
|
||||
|
||||
AsyncFileWriteChecker(Reference<IAsyncFile> f) : m_f(f) {
|
||||
|
@ -75,7 +77,7 @@ public:
|
|||
checksumHistoryBudget.get() -= checksumHistory.capacity();
|
||||
}
|
||||
|
||||
virtual ~AsyncFileWriteChecker() { checksumHistoryBudget.get() += checksumHistory.capacity(); }
|
||||
~AsyncFileWriteChecker() override { checksumHistoryBudget.get() += checksumHistory.capacity(); }
|
||||
|
||||
private:
|
||||
Reference<IAsyncFile> m_f;
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
m_budget_max = m_limit * m_seconds;
|
||||
m_last_update = timer();
|
||||
}
|
||||
~SpeedLimit() = default;
|
||||
~SpeedLimit() override = default;
|
||||
|
||||
void addref() override { ReferenceCounted<SpeedLimit>::addref(); }
|
||||
void delref() override { ReferenceCounted<SpeedLimit>::delref(); }
|
||||
|
@ -78,7 +78,7 @@ private:
|
|||
class Unlimited final : public IRateControl, ReferenceCounted<Unlimited> {
|
||||
public:
|
||||
Unlimited() {}
|
||||
~Unlimited() = default;
|
||||
~Unlimited() override = default;
|
||||
void addref() override { ReferenceCounted<Unlimited>::addref(); }
|
||||
void delref() override { ReferenceCounted<Unlimited>::delref(); }
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
|
||||
Net2FileSystem(double ioTimeout = 0.0, const std::string& fileSystemPath = "");
|
||||
|
||||
virtual ~Net2FileSystem() {}
|
||||
~Net2FileSystem() override {}
|
||||
|
||||
static void newFileSystem(double ioTimeout = 0.0, const std::string& fileSystemPath = "");
|
||||
|
||||
|
|
|
@ -505,7 +505,7 @@ protected:
|
|||
struct LocalityGroup : public LocalitySet {
|
||||
LocalityGroup():LocalitySet(*this), _valuemap(new StringToIntMap()) {}
|
||||
LocalityGroup(LocalityGroup const& source):LocalitySet(source), _recordArray(source._recordArray), _valuemap(source._valuemap) {}
|
||||
virtual ~LocalityGroup() { }
|
||||
~LocalityGroup() override {}
|
||||
|
||||
LocalityEntry const& add(LocalityData const& data) {
|
||||
// _recordArray.size() is the new entry index for the new data
|
||||
|
@ -514,7 +514,7 @@ struct LocalityGroup : public LocalitySet {
|
|||
return LocalitySet::add(record, *this);
|
||||
}
|
||||
|
||||
virtual void clear() {
|
||||
void clear() override {
|
||||
LocalitySet::clear();
|
||||
_valuemap->clear();
|
||||
_recordArray.clear();
|
||||
|
@ -534,15 +534,15 @@ struct LocalityGroup : public LocalitySet {
|
|||
return *this;
|
||||
}
|
||||
|
||||
virtual Reference<LocalityRecord> const& getRecord(int recordIndex) const {
|
||||
Reference<LocalityRecord> const& getRecord(int recordIndex) const override {
|
||||
ASSERT((recordIndex >= 0) && (recordIndex < _recordArray.size()));
|
||||
return _recordArray[recordIndex];
|
||||
}
|
||||
|
||||
// Get the locality info for debug purpose
|
||||
virtual std::vector<Reference<LocalityRecord>> const& getRecordArray() const { return _recordArray; }
|
||||
std::vector<Reference<LocalityRecord>> const& getRecordArray() const override { return _recordArray; }
|
||||
|
||||
virtual int getMemoryUsed() const {
|
||||
int getMemoryUsed() const override {
|
||||
int memorySize = sizeof(_recordArray) + _keymap->getMemoryUsed();
|
||||
for (auto& record : _recordArray) {
|
||||
memorySize += record->getMemoryUsed();
|
||||
|
@ -563,18 +563,14 @@ struct LocalityGroup : public LocalitySet {
|
|||
return attribHashMap;
|
||||
}
|
||||
|
||||
virtual Reference<StringToIntMap> const& getGroupValueMap() const
|
||||
{ return _valuemap; }
|
||||
Reference<StringToIntMap> const& getGroupValueMap() const override { return _valuemap; }
|
||||
|
||||
virtual Reference<StringToIntMap> const& getGroupKeyMap() const
|
||||
{ return _keymap; }
|
||||
Reference<StringToIntMap> const& getGroupKeyMap() const override { return _keymap; }
|
||||
|
||||
protected:
|
||||
virtual Reference<StringToIntMap> & getGroupValueMap()
|
||||
{ return _valuemap; }
|
||||
Reference<StringToIntMap>& getGroupValueMap() override { return _valuemap; }
|
||||
|
||||
virtual Reference<StringToIntMap> & getGroupKeyMap()
|
||||
{ return _keymap; }
|
||||
Reference<StringToIntMap>& getGroupKeyMap() override { return _keymap; }
|
||||
|
||||
protected:
|
||||
std::vector<Reference<LocalityRecord>> _recordArray;
|
||||
|
@ -585,7 +581,7 @@ template <class V>
|
|||
struct LocalityMap : public LocalityGroup {
|
||||
LocalityMap():LocalityGroup() {}
|
||||
LocalityMap(LocalityMap const& source):LocalityGroup(source), _objectArray(source._objectArray) {}
|
||||
virtual ~LocalityMap() {}
|
||||
~LocalityMap() override {}
|
||||
|
||||
bool selectReplicas(
|
||||
Reference<IReplicationPolicy> const& policy,
|
||||
|
@ -649,12 +645,12 @@ struct LocalityMap : public LocalityGroup {
|
|||
return getObject(record->_entryIndex);
|
||||
}
|
||||
|
||||
virtual void clear() {
|
||||
void clear() override {
|
||||
LocalityGroup::clear();
|
||||
_objectArray.clear();
|
||||
}
|
||||
|
||||
virtual int getMemoryUsed() const {
|
||||
int getMemoryUsed() const override {
|
||||
return LocalitySet::getMemoryUsed() + sizeof(_objectArray) + (sizeof(V*) * _objectArray.size());
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ struct PolicyAcross final : IReplicationPolicy, public ReferenceCounted<PolicyAc
|
|||
PolicyAcross(int count, std::string const& attribKey, Reference<IReplicationPolicy> const policy);
|
||||
explicit PolicyAcross();
|
||||
explicit PolicyAcross(const PolicyAcross& other) : PolicyAcross(other._count, other._attribKey, other._policy) {}
|
||||
~PolicyAcross();
|
||||
~PolicyAcross() override;
|
||||
std::string name() const override { return "Across"; }
|
||||
std::string embeddedPolicyName() const { return _policy->name(); }
|
||||
int getCount() const { return _count; }
|
||||
|
|
|
@ -86,15 +86,15 @@ public:
|
|||
void operator += (Value delta);
|
||||
void operator ++ () { *this += 1; }
|
||||
void clear();
|
||||
void resetInterval();
|
||||
void resetInterval() override;
|
||||
|
||||
std::string const& getName() const { return name; }
|
||||
std::string const& getName() const override { return name; }
|
||||
|
||||
Value getIntervalDelta() const { return interval_delta; }
|
||||
Value getValue() const { return interval_start_value + interval_delta; }
|
||||
Value getValue() const override { return interval_start_value + interval_delta; }
|
||||
|
||||
// dValue / dt
|
||||
double getRate() const;
|
||||
double getRate() const override;
|
||||
|
||||
// Measures the clumpiness or dispersion of the counter.
|
||||
// Computed as a normalized variance of the time between each incrementation of the value.
|
||||
|
@ -106,10 +106,10 @@ public:
|
|||
// A uniformly periodic counter will have roughness of 0
|
||||
// A uniformly periodic counter that increases in clumps of N will have roughness of N-1
|
||||
// A counter with exponentially distributed incrementations will have roughness of 1
|
||||
double getRoughness() const;
|
||||
double getRoughness() const override;
|
||||
|
||||
bool hasRate() const { return true; }
|
||||
bool hasRoughness() const { return true; }
|
||||
bool hasRate() const override { return true; }
|
||||
bool hasRoughness() const override { return true; }
|
||||
|
||||
private:
|
||||
std::string name;
|
||||
|
|
|
@ -492,9 +492,7 @@ public:
|
|||
|
||||
std::string getFilename() const override { return actualFilename; }
|
||||
|
||||
~SimpleFile() {
|
||||
_close( h );
|
||||
}
|
||||
~SimpleFile() override { _close(h); }
|
||||
|
||||
private:
|
||||
int h;
|
||||
|
@ -1794,7 +1792,7 @@ public:
|
|||
ASSERT(process->boundUDPSockets.find(localAddress) == process->boundUDPSockets.end());
|
||||
process->boundUDPSockets.emplace(localAddress, this);
|
||||
}
|
||||
~UDPSimSocket() {
|
||||
~UDPSimSocket() override {
|
||||
if (!closed.getFuture().isReady()) {
|
||||
close();
|
||||
closed.send(Void());
|
||||
|
|
|
@ -182,7 +182,7 @@ public:
|
|||
virtual bool isAvailable() const = 0;
|
||||
virtual bool datacenterDead(Optional<Standalone<StringRef>> dcId) const = 0;
|
||||
virtual void displayWorkers() const;
|
||||
virtual ProtocolVersion protocolVersion() = 0;
|
||||
ProtocolVersion protocolVersion() override = 0;
|
||||
void addRole(NetworkAddress const& address, std::string const& role) {
|
||||
roleAddresses[address][role] ++;
|
||||
TraceEvent("RoleAdd").detail("Address", address).detail("Role", role).detail("NumRoles", roleAddresses[address].size()).detail("Value", roleAddresses[address][role]);
|
||||
|
@ -291,7 +291,7 @@ public:
|
|||
virtual ProcessInfo* getProcessByAddress( NetworkAddress const& address ) = 0;
|
||||
virtual MachineInfo* getMachineByNetworkAddress(NetworkAddress const& address) = 0;
|
||||
virtual MachineInfo* getMachineById(Optional<Standalone<StringRef>> const& machineId) = 0;
|
||||
virtual void run() {}
|
||||
void run() override {}
|
||||
virtual void destroyProcess( ProcessInfo *p ) = 0;
|
||||
virtual void destroyMachine(Optional<Standalone<StringRef>> const& machineId ) = 0;
|
||||
|
||||
|
@ -392,7 +392,7 @@ public:
|
|||
|
||||
Sim2FileSystem() {}
|
||||
|
||||
virtual ~Sim2FileSystem() {}
|
||||
~Sim2FileSystem() override {}
|
||||
|
||||
static void newFileSystem();
|
||||
};
|
||||
|
|
|
@ -48,7 +48,7 @@ set(FDBSERVER_SRCS
|
|||
LogSystemPeekCursor.actor.cpp
|
||||
MasterInterface.h
|
||||
MetricLogger.actor.cpp
|
||||
MetricLogger.h
|
||||
MetricLogger.actor.h
|
||||
CommitProxyServer.actor.cpp
|
||||
masterserver.actor.cpp
|
||||
MutationTracking.h
|
||||
|
@ -281,9 +281,11 @@ if (GPERFTOOLS_FOUND)
|
|||
target_link_libraries(fdbserver PRIVATE gperftools)
|
||||
endif()
|
||||
|
||||
if(NOT OPEN_FOR_IDE)
|
||||
if(GENERATE_DEBUG_PACKAGES)
|
||||
fdb_install(TARGETS fdbserver DESTINATION sbin COMPONENT server)
|
||||
else()
|
||||
add_custom_target(prepare_fdbserver_install ALL DEPENDS strip_only_fdbserver)
|
||||
fdb_install(PROGRAMS ${CMAKE_BINARY_DIR}/packages/bin/fdbserver DESTINATION sbin COMPONENT server)
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
@ -4816,6 +4816,11 @@ ACTOR Future<Void> dataDistribution(Reference<DataDistributorData> self,
|
|||
state bool trackerCancelled;
|
||||
loop {
|
||||
trackerCancelled = false;
|
||||
|
||||
// Stored outside of data distribution tracker to avoid slow tasks
|
||||
// when tracker is cancelled
|
||||
state KeyRangeMap<ShardTrackedData> shards;
|
||||
|
||||
try {
|
||||
loop {
|
||||
TraceEvent("DDInitTakingMoveKeysLock", self->ddId);
|
||||
|
@ -4962,10 +4967,6 @@ ACTOR Future<Void> dataDistribution(Reference<DataDistributorData> self,
|
|||
zeroHealthyTeams.push_back(makeReference<AsyncVar<bool>>(true));
|
||||
int storageTeamSize = configuration.storageTeamSize;
|
||||
|
||||
// Stored outside of data distribution tracker to avoid slow tasks
|
||||
// when tracker is cancelled
|
||||
state KeyRangeMap<ShardTrackedData> shards;
|
||||
|
||||
vector<Future<Void>> actors;
|
||||
if (configuration.usableRegions > 1) {
|
||||
tcis.push_back(TeamCollectionInterface());
|
||||
|
|
|
@ -181,7 +181,7 @@ public:
|
|||
return result;
|
||||
}
|
||||
|
||||
bool hasHealthyAvailableSpace(double minRatio) const {
|
||||
bool hasHealthyAvailableSpace(double minRatio) const override {
|
||||
return all([minRatio](IDataDistributionTeam const& team) { return team.hasHealthyAvailableSpace(minRatio); });
|
||||
}
|
||||
|
||||
|
|
|
@ -1396,14 +1396,20 @@ public:
|
|||
DiskQueue_PopUncommitted( std::string basename, std::string fileExtension, UID dbgid, DiskQueueVersion diskQueueVersion, int64_t fileSizeWarningLimit ) : queue(new DiskQueue(basename, fileExtension, dbgid, diskQueueVersion, fileSizeWarningLimit)), pushed(0), popped(0), committed(0) { };
|
||||
|
||||
//IClosable
|
||||
Future<Void> getError() { return queue->getError(); }
|
||||
Future<Void> onClosed() { return queue->onClosed(); }
|
||||
void dispose() { queue->dispose(); delete this; }
|
||||
void close() { queue->close(); delete this; }
|
||||
Future<Void> getError() override { return queue->getError(); }
|
||||
Future<Void> onClosed() override { return queue->onClosed(); }
|
||||
void dispose() override {
|
||||
queue->dispose();
|
||||
delete this;
|
||||
}
|
||||
void close() override {
|
||||
queue->close();
|
||||
delete this;
|
||||
}
|
||||
|
||||
//IDiskQueue
|
||||
Future<bool> initializeRecovery(location recoverAt) { return queue->initializeRecovery(recoverAt); }
|
||||
Future<Standalone<StringRef>> readNext( int bytes ) { return readNext(this, bytes); }
|
||||
Future<bool> initializeRecovery(location recoverAt) override { return queue->initializeRecovery(recoverAt); }
|
||||
Future<Standalone<StringRef>> readNext(int bytes) override { return readNext(this, bytes); }
|
||||
|
||||
location getNextReadLocation() const override { return queue->getNextReadLocation(); }
|
||||
|
||||
|
|
|
@ -35,9 +35,9 @@ struct KeyValueStoreCompressTestData final : IKeyValueStore {
|
|||
|
||||
KeyValueStoreCompressTestData(IKeyValueStore* store) : store(store) {}
|
||||
|
||||
virtual Future<Void> getError() override { return store->getError(); }
|
||||
virtual Future<Void> onClosed() override { return store->onClosed(); }
|
||||
virtual void dispose() override {
|
||||
Future<Void> getError() override { return store->getError(); }
|
||||
Future<Void> onClosed() override { return store->onClosed(); }
|
||||
void dispose() override {
|
||||
|
||||
store->dispose();
|
||||
delete this;
|
||||
|
@ -54,7 +54,7 @@ struct KeyValueStoreCompressTestData final : IKeyValueStore {
|
|||
store->set( KeyValueRef( keyValue.key, pack(keyValue.value) ), arena );
|
||||
}
|
||||
void clear(KeyRangeRef range, const Arena* arena = nullptr) override { store->clear(range, arena); }
|
||||
Future<Void> commit(bool sequential = false) { return store->commit(sequential); }
|
||||
Future<Void> commit(bool sequential = false) override { return store->commit(sequential); }
|
||||
|
||||
Future<Optional<Value>> readValue(KeyRef key, Optional<UID> debugID = Optional<UID>()) override {
|
||||
return doReadValue(store, key, debugID);
|
||||
|
|
|
@ -63,7 +63,7 @@ public:
|
|||
// IKeyValueStore
|
||||
KeyValueStoreType getType() const override { return type; }
|
||||
|
||||
virtual std::tuple<size_t, size_t, size_t> getSize() const override { return data.size(); }
|
||||
std::tuple<size_t, size_t, size_t> getSize() const override { return data.size(); }
|
||||
|
||||
int64_t getAvailableSize() const {
|
||||
int64_t residentSize = data.sumTo(data.end()) + queue.totalSize() + // doesn't account for overhead in queue
|
||||
|
|
|
@ -1485,8 +1485,8 @@ public:
|
|||
Future<Void> getError() override { return delayed(readThreads->getError() || writeThread->getError()); }
|
||||
Future<Void> onClosed() override { return stopped.getFuture(); }
|
||||
|
||||
virtual KeyValueStoreType getType() const override { return type; }
|
||||
virtual StorageBytes getStorageBytes() const override;
|
||||
KeyValueStoreType getType() const override { return type; }
|
||||
StorageBytes getStorageBytes() const override;
|
||||
|
||||
void set(KeyValueRef keyValue, const Arena* arena = nullptr) override;
|
||||
void clear(KeyRangeRef range, const Arena* arena = nullptr) override;
|
||||
|
@ -1498,7 +1498,7 @@ public:
|
|||
int byteLimit = 1 << 30) override;
|
||||
|
||||
KeyValueStoreSQLite(std::string const& filename, UID logID, KeyValueStoreType type, bool checkChecksums, bool checkIntegrity);
|
||||
~KeyValueStoreSQLite();
|
||||
~KeyValueStoreSQLite() override;
|
||||
|
||||
struct SpringCleaningWorkPerformed {
|
||||
int lazyDeletePages = 0;
|
||||
|
@ -1535,9 +1535,7 @@ private:
|
|||
: conn( filename, is_btree_v2, is_btree_v2 ), counter(counter), dbgid(dbgid), ppReadCursor(ppReadCursor)
|
||||
{
|
||||
}
|
||||
~Reader() {
|
||||
ppReadCursor->clear();
|
||||
}
|
||||
~Reader() override { ppReadCursor->clear(); }
|
||||
|
||||
void init() override { conn.open(false); }
|
||||
|
||||
|
@ -1633,7 +1631,7 @@ private:
|
|||
checkIntegrityOnOpen(checkIntegrityOnOpen)
|
||||
{
|
||||
}
|
||||
~Writer() {
|
||||
~Writer() override {
|
||||
TraceEvent("KVWriterDestroying", dbgid);
|
||||
delete cursor;
|
||||
TraceEvent("KVWriterDestroyed", dbgid);
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "fdbclient/DatabaseContext.h"
|
||||
#include "fdbclient/ReadYourWrites.h"
|
||||
#include "fdbclient/KeyBackedTypes.h"
|
||||
#include "fdbserver/MetricLogger.h"
|
||||
#include "fdbserver/MetricLogger.actor.h"
|
||||
#include "flow/actorcompiler.h" // This must be the last #include.
|
||||
|
||||
struct MetricsRule {
|
||||
|
@ -173,7 +173,7 @@ ACTOR Future<Void> metricRuleUpdater(Database cx, MetricsConfig *config, TDMetri
|
|||
class MetricDB : public IMetricDB {
|
||||
public:
|
||||
MetricDB(ReadYourWritesTransaction *tr = nullptr) : tr(tr) {}
|
||||
~MetricDB() {}
|
||||
~MetricDB() override {}
|
||||
|
||||
// levelKey is the prefix for the entire level, no timestamp at the end
|
||||
ACTOR static Future<Optional<Standalone<StringRef>>> getLastBlock_impl(ReadYourWritesTransaction *tr, Standalone<StringRef> levelKey) {
|
||||
|
@ -183,7 +183,7 @@ public:
|
|||
return Optional<Standalone<StringRef>>();
|
||||
}
|
||||
|
||||
Future<Optional<Standalone<StringRef>>> getLastBlock(Standalone<StringRef> key) {
|
||||
Future<Optional<Standalone<StringRef>>> getLastBlock(Standalone<StringRef> key) override {
|
||||
return getLastBlock_impl(tr, key);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* MetricLogger.h
|
||||
* MetricLogger.actor.h
|
||||
*
|
||||
* This source file is part of the FoundationDB open source project
|
||||
*
|
||||
|
@ -20,6 +20,15 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "fdbclient/NativeAPI.actor.h"
|
||||
// When actually compiled (NO_INTELLISENSE), include the generated version of this file. In intellisense use the source version.
|
||||
#if defined(NO_INTELLISENSE) && !defined(FDBSERVER_METRICLOGGER_ACTOR_G_H)
|
||||
#define FDBSERVER_METRICLOGGER_ACTOR_G_H
|
||||
#include "fdbserver/MetricLogger.actor.g.h"
|
||||
#elif !defined(FDBSERVER_METRICLOGGER_ACTOR_H)
|
||||
#define FDBSERVER_METRICLOGGER_ACTOR_H
|
||||
#include "flow/actorcompiler.h" // This must be the last #include
|
||||
|
||||
Future<Void> runMetrics( Future<Database> const& fcx, Key const& metricsPrefix );
|
||||
ACTOR Future<Void> runMetrics(Future<Database> fcx, Key metricsPrefix);
|
||||
|
||||
#include "flow/unactorcompiler.h"
|
||||
#endif
|
|
@ -158,10 +158,10 @@ namespace oldTLog_4_6 {
|
|||
Future<Void> commit() { return queue->commit(); }
|
||||
|
||||
// Implements IClosable
|
||||
virtual Future<Void> getError() { return queue->getError(); }
|
||||
virtual Future<Void> onClosed() { return queue->onClosed(); }
|
||||
virtual void dispose() { queue->dispose(); delete this; }
|
||||
virtual void close() { queue->close(); delete this; }
|
||||
Future<Void> getError() override { return queue->getError(); }
|
||||
Future<Void> onClosed() override { return queue->onClosed(); }
|
||||
void dispose() override { queue->dispose(); delete this; }
|
||||
void close() override { queue->close(); delete this; }
|
||||
|
||||
private:
|
||||
IDiskQueue* queue;
|
||||
|
|
|
@ -128,10 +128,16 @@ public:
|
|||
Future<Void> commit() { return queue->commit(); }
|
||||
|
||||
// Implements IClosable
|
||||
virtual Future<Void> getError() { return queue->getError(); }
|
||||
virtual Future<Void> onClosed() { return queue->onClosed(); }
|
||||
virtual void dispose() { queue->dispose(); delete this; }
|
||||
virtual void close() { queue->close(); delete this; }
|
||||
Future<Void> getError() override { return queue->getError(); }
|
||||
Future<Void> onClosed() override { return queue->onClosed(); }
|
||||
void dispose() override {
|
||||
queue->dispose();
|
||||
delete this;
|
||||
}
|
||||
void close() override {
|
||||
queue->close();
|
||||
delete this;
|
||||
}
|
||||
|
||||
private:
|
||||
IDiskQueue* queue;
|
||||
|
|
|
@ -134,10 +134,16 @@ public:
|
|||
Future<Void> commit() { return queue->commit(); }
|
||||
|
||||
// Implements IClosable
|
||||
virtual Future<Void> getError() { return queue->getError(); }
|
||||
virtual Future<Void> onClosed() { return queue->onClosed(); }
|
||||
virtual void dispose() { queue->dispose(); delete this; }
|
||||
virtual void close() { queue->close(); delete this; }
|
||||
Future<Void> getError() override { return queue->getError(); }
|
||||
Future<Void> onClosed() override { return queue->onClosed(); }
|
||||
void dispose() override {
|
||||
queue->dispose();
|
||||
delete this;
|
||||
}
|
||||
void close() override {
|
||||
queue->close();
|
||||
delete this;
|
||||
}
|
||||
|
||||
private:
|
||||
IDiskQueue* queue;
|
||||
|
|
|
@ -362,6 +362,7 @@ ACTOR static Future<Void> precomputeMutationsResult(Reference<ApplierBatchData>
|
|||
state std::vector<Future<Void>> fClearRanges;
|
||||
Standalone<VectorRef<KeyRangeRef>> clearRanges;
|
||||
double curTxnSize = 0;
|
||||
{
|
||||
double delayTime = 0;
|
||||
for (auto& rangeMutation : batchData->stagingKeyRanges) {
|
||||
KeyRangeRef range(rangeMutation.mutation.param1, rangeMutation.mutation.param2);
|
||||
|
@ -381,6 +382,7 @@ ACTOR static Future<Void> precomputeMutationsResult(Reference<ApplierBatchData>
|
|||
fClearRanges.push_back(
|
||||
applyClearRangeMutations(clearRanges, delayTime, cx, applierID, batchIndex, &batchData->counters));
|
||||
}
|
||||
}
|
||||
|
||||
// Apply range mutations (i.e., clearRange) to stagingKeyRanges
|
||||
TraceEvent("FastRestoreApplerPhasePrecomputeMutationsResult", applierID)
|
||||
|
@ -423,6 +425,7 @@ ACTOR static Future<Void> precomputeMutationsResult(Reference<ApplierBatchData>
|
|||
std::map<Key, StagingKey>::iterator stagingKeyIter = batchData->stagingKeys.begin();
|
||||
int numKeysInBatch = 0;
|
||||
int numGetTxns = 0;
|
||||
{
|
||||
double delayTime = 0; // Start transactions at different time to avoid overwhelming FDB.
|
||||
for (; stagingKeyIter != batchData->stagingKeys.end(); stagingKeyIter++) {
|
||||
if (!stagingKeyIter->second.hasBaseValue()) {
|
||||
|
@ -443,6 +446,7 @@ ACTOR static Future<Void> precomputeMutationsResult(Reference<ApplierBatchData>
|
|||
fGetAndComputeKeys.push_back(getAndComputeStagingKeys(incompleteStagingKeys, delayTime, cx, applierID,
|
||||
batchIndex, &batchData->counters));
|
||||
}
|
||||
}
|
||||
|
||||
TraceEvent("FastRestoreApplerPhasePrecomputeMutationsResult", applierID)
|
||||
.detail("BatchIndex", batchIndex)
|
||||
|
|
|
@ -230,11 +230,11 @@ public:
|
|||
vbState = newState;
|
||||
}
|
||||
|
||||
virtual ~ApplierVersionBatchState() = default;
|
||||
~ApplierVersionBatchState() override = default;
|
||||
|
||||
virtual void operator=(int newState) { vbState = newState; }
|
||||
void operator=(int newState) override { vbState = newState; }
|
||||
|
||||
virtual int get() { return vbState; }
|
||||
int get() override { return vbState; }
|
||||
};
|
||||
|
||||
struct ApplierBatchData : public ReferenceCounted<ApplierBatchData> {
|
||||
|
@ -377,7 +377,7 @@ struct RestoreApplierData : RestoreRoleData, public ReferenceCounted<RestoreAppl
|
|||
role = RestoreRole::Applier;
|
||||
}
|
||||
|
||||
~RestoreApplierData() = default;
|
||||
~RestoreApplierData() override = default;
|
||||
|
||||
// getVersionBatchState may be called periodically to dump version batch state,
|
||||
// even when no version batch has been started.
|
||||
|
@ -395,17 +395,17 @@ struct RestoreApplierData : RestoreRoleData, public ReferenceCounted<RestoreAppl
|
|||
item->second->vbState = vbState;
|
||||
}
|
||||
|
||||
void initVersionBatch(int batchIndex) {
|
||||
void initVersionBatch(int batchIndex) override {
|
||||
TraceEvent("FastRestoreApplierInitVersionBatch", id()).detail("BatchIndex", batchIndex);
|
||||
batch[batchIndex] = Reference<ApplierBatchData>(new ApplierBatchData(nodeID, batchIndex));
|
||||
}
|
||||
|
||||
void resetPerRestoreRequest() {
|
||||
void resetPerRestoreRequest() override {
|
||||
batch.clear();
|
||||
finishedBatch = NotifiedVersion(0);
|
||||
}
|
||||
|
||||
std::string describeNode() {
|
||||
std::string describeNode() override {
|
||||
std::stringstream ss;
|
||||
ss << "NodeID:" << nodeID.toString() << " nodeIndex:" << nodeIndex;
|
||||
return ss.str();
|
||||
|
|
|
@ -162,17 +162,17 @@ struct RestoreControllerData : RestoreRoleData, public ReferenceCounted<RestoreC
|
|||
runningVersionBatches.set(0);
|
||||
}
|
||||
|
||||
~RestoreControllerData() = default;
|
||||
~RestoreControllerData() override = default;
|
||||
|
||||
int getVersionBatchState(int batchIndex) final { return RoleVersionBatchState::INVALID; }
|
||||
void setVersionBatchState(int batchIndex, int vbState) final {}
|
||||
|
||||
void initVersionBatch(int batchIndex) {
|
||||
void initVersionBatch(int batchIndex) override {
|
||||
TraceEvent("FastRestoreControllerInitVersionBatch", id()).detail("VersionBatchIndex", batchIndex);
|
||||
}
|
||||
|
||||
// Reset controller data at the beginning of each restore request
|
||||
void resetPerRestoreRequest() {
|
||||
void resetPerRestoreRequest() override {
|
||||
TraceEvent("FastRestoreControllerReset").detail("OldVersionBatches", versionBatches.size());
|
||||
versionBatches.clear();
|
||||
batch.clear();
|
||||
|
@ -182,7 +182,7 @@ struct RestoreControllerData : RestoreRoleData, public ReferenceCounted<RestoreC
|
|||
ASSERT(runningVersionBatches.get() == 0);
|
||||
}
|
||||
|
||||
std::string describeNode() {
|
||||
std::string describeNode() override {
|
||||
std::stringstream ss;
|
||||
ss << "Controller";
|
||||
return ss.str();
|
||||
|
|
|
@ -619,8 +619,8 @@ ACTOR Future<Void> handleLoadFileRequest(RestoreLoadFileRequest req, Reference<R
|
|||
sampleBatchSize = 0;
|
||||
}
|
||||
|
||||
try {
|
||||
state int samplesMessages = fSendSamples.size();
|
||||
try {
|
||||
wait(waitForAll(fSendSamples));
|
||||
} catch (Error& e) { // In case ci.samples throws broken_promise due to unstable network
|
||||
if (e.code() == error_code_broken_promise || e.code() == error_code_operation_cancelled) {
|
||||
|
|
|
@ -54,11 +54,11 @@ public:
|
|||
vbState = newState;
|
||||
}
|
||||
|
||||
virtual ~LoaderVersionBatchState() = default;
|
||||
~LoaderVersionBatchState() override = default;
|
||||
|
||||
virtual void operator=(int newState) { vbState = newState; }
|
||||
void operator=(int newState) override { vbState = newState; }
|
||||
|
||||
virtual int get() { return vbState; }
|
||||
int get() override { return vbState; }
|
||||
};
|
||||
|
||||
struct LoaderBatchData : public ReferenceCounted<LoaderBatchData> {
|
||||
|
@ -191,9 +191,9 @@ struct RestoreLoaderData : RestoreRoleData, public ReferenceCounted<RestoreLoade
|
|||
hasPendingRequests = makeReference<AsyncVar<bool>>(false);
|
||||
}
|
||||
|
||||
~RestoreLoaderData() = default;
|
||||
~RestoreLoaderData() override = default;
|
||||
|
||||
std::string describeNode() {
|
||||
std::string describeNode() override {
|
||||
std::stringstream ss;
|
||||
ss << "[Role: Loader] [NodeID:" << nodeID.toString().c_str() << "] [NodeIndex:" << std::to_string(nodeIndex)
|
||||
<< "]";
|
||||
|
@ -214,13 +214,13 @@ struct RestoreLoaderData : RestoreRoleData, public ReferenceCounted<RestoreLoade
|
|||
item->second->vbState = vbState;
|
||||
}
|
||||
|
||||
void initVersionBatch(int batchIndex) {
|
||||
void initVersionBatch(int batchIndex) override {
|
||||
TraceEvent("FastRestoreLoaderInitVersionBatch", nodeID).detail("BatchIndex", batchIndex);
|
||||
batch[batchIndex] = makeReference<LoaderBatchData>(nodeID, batchIndex);
|
||||
status[batchIndex] = makeReference<LoaderBatchStatus>();
|
||||
}
|
||||
|
||||
void resetPerRestoreRequest() {
|
||||
void resetPerRestoreRequest() override {
|
||||
batch.clear();
|
||||
status.clear();
|
||||
finishedBatch = NotifiedVersion(0);
|
||||
|
|
|
@ -721,24 +721,24 @@ public:
|
|||
VALGRIND_MAKE_MEM_DEFINED(buffer + logicalSize, bufferSize - logicalSize);
|
||||
};
|
||||
|
||||
virtual ~FastAllocatedPage() { freeFast(bufferSize, buffer); }
|
||||
~FastAllocatedPage() override { freeFast(bufferSize, buffer); }
|
||||
|
||||
virtual Reference<IPage> clone() const {
|
||||
Reference<IPage> clone() const override {
|
||||
FastAllocatedPage* p = new FastAllocatedPage(logicalSize, bufferSize);
|
||||
memcpy(p->buffer, buffer, logicalSize);
|
||||
return Reference<IPage>(p);
|
||||
}
|
||||
|
||||
// Usable size, without checksum
|
||||
int size() const { return logicalSize - sizeof(Checksum); }
|
||||
int size() const override { return logicalSize - sizeof(Checksum); }
|
||||
|
||||
uint8_t const* begin() const { return buffer; }
|
||||
uint8_t const* begin() const override { return buffer; }
|
||||
|
||||
uint8_t* mutate() { return buffer; }
|
||||
uint8_t* mutate() override { return buffer; }
|
||||
|
||||
void addref() const { ReferenceCounted<FastAllocatedPage>::addref(); }
|
||||
void addref() const override { ReferenceCounted<FastAllocatedPage>::addref(); }
|
||||
|
||||
void delref() const { ReferenceCounted<FastAllocatedPage>::delref(); }
|
||||
void delref() const override { ReferenceCounted<FastAllocatedPage>::delref(); }
|
||||
|
||||
typedef uint32_t Checksum;
|
||||
|
||||
|
@ -2178,7 +2178,7 @@ class DWALPagerSnapshot : public IPagerSnapshot, public ReferenceCounted<DWALPag
|
|||
public:
|
||||
DWALPagerSnapshot(DWALPager* pager, Key meta, Version version, Future<Void> expiredFuture)
|
||||
: pager(pager), metaKey(meta), version(version), expired(expiredFuture) {}
|
||||
virtual ~DWALPagerSnapshot() {}
|
||||
~DWALPagerSnapshot() override {}
|
||||
|
||||
Future<Reference<const IPage>> getPhysicalPage(LogicalPageID pageID, bool cacheable, bool noHit) override {
|
||||
if (expired.isError()) {
|
||||
|
@ -3079,9 +3079,9 @@ public:
|
|||
|
||||
// All async opts on the btree are based on pager reads, writes, and commits, so
|
||||
// we can mostly forward these next few functions to the pager
|
||||
Future<Void> getError() { return m_pager->getError(); }
|
||||
Future<Void> getError() override { return m_pager->getError(); }
|
||||
|
||||
Future<Void> onClosed() { return m_pager->onClosed(); }
|
||||
Future<Void> onClosed() override { return m_pager->onClosed(); }
|
||||
|
||||
void close_impl(bool dispose) {
|
||||
auto* pager = m_pager;
|
||||
|
@ -3092,9 +3092,9 @@ public:
|
|||
pager->close();
|
||||
}
|
||||
|
||||
void dispose() { return close_impl(true); }
|
||||
void dispose() override { return close_impl(true); }
|
||||
|
||||
void close() { return close_impl(false); }
|
||||
void close() override { return close_impl(false); }
|
||||
|
||||
KeyValueStoreType getType() const override { NOT_IMPLEMENTED; }
|
||||
bool supportsMutation(int op) const override { NOT_IMPLEMENTED; }
|
||||
|
@ -3297,7 +3297,7 @@ public:
|
|||
m_latestCommit.cancel();
|
||||
}
|
||||
|
||||
Reference<IStoreCursor> readAtVersion(Version v) {
|
||||
Reference<IStoreCursor> readAtVersion(Version v) override {
|
||||
// Only committed versions can be read.
|
||||
ASSERT(v <= m_lastCommittedVersion);
|
||||
Reference<IPagerSnapshot> snapshot = m_pager->getReadSnapshot(v);
|
||||
|
@ -3310,7 +3310,7 @@ public:
|
|||
}
|
||||
|
||||
// Must be nondecreasing
|
||||
void setWriteVersion(Version v) {
|
||||
void setWriteVersion(Version v) override {
|
||||
ASSERT(v > m_lastCommittedVersion);
|
||||
// If there was no current mutation buffer, create one in the buffer map and update m_pBuffer
|
||||
if (m_pBuffer == nullptr) {
|
||||
|
@ -3873,7 +3873,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
virtual ~SuperPage() { delete[] m_data; }
|
||||
~SuperPage() override { delete[] m_data; }
|
||||
|
||||
Reference<IPage> clone() const override {
|
||||
return Reference<IPage>(new SuperPage({ Reference<const IPage>::addRef(this) }));
|
||||
|
@ -5492,8 +5492,8 @@ public:
|
|||
Cursor(Reference<IPagerSnapshot> pageSource, BTreePageIDRef root, Version internalRecordVersion)
|
||||
: m_version(internalRecordVersion), m_cur1(pageSource, root), m_cur2(m_cur1) {}
|
||||
|
||||
void addref() { ReferenceCounted<Cursor>::addref(); }
|
||||
void delref() { ReferenceCounted<Cursor>::delref(); }
|
||||
void addref() override { ReferenceCounted<Cursor>::addref(); }
|
||||
void delref() override { ReferenceCounted<Cursor>::delref(); }
|
||||
|
||||
private:
|
||||
Version m_version;
|
||||
|
@ -5706,7 +5706,7 @@ public:
|
|||
m_init = catchError(init_impl(this));
|
||||
}
|
||||
|
||||
Future<Void> init() { return m_init; }
|
||||
Future<Void> init() override { return m_init; }
|
||||
|
||||
ACTOR Future<Void> init_impl(KeyValueStoreRedwoodUnversioned* self) {
|
||||
TraceEvent(SevInfo, "RedwoodInit").detail("FilePrefix", self->m_filePrefix);
|
||||
|
@ -5753,9 +5753,9 @@ public:
|
|||
|
||||
StorageBytes getStorageBytes() const override { return m_tree->getStorageBytes(); }
|
||||
|
||||
Future<Void> getError() { return delayed(m_error.getFuture()); };
|
||||
Future<Void> getError() override { return delayed(m_error.getFuture()); };
|
||||
|
||||
void clear(KeyRangeRef range, const Arena* arena = 0) {
|
||||
void clear(KeyRangeRef range, const Arena* arena = 0) override {
|
||||
debug_printf("CLEAR %s\n", printable(range).c_str());
|
||||
m_tree->clear(range);
|
||||
}
|
||||
|
@ -5869,7 +5869,7 @@ public:
|
|||
return Optional<Value>();
|
||||
}
|
||||
|
||||
Future<Optional<Value>> readValue(KeyRef key, Optional<UID> debugID = Optional<UID>()) {
|
||||
Future<Optional<Value>> readValue(KeyRef key, Optional<UID> debugID = Optional<UID>()) override {
|
||||
return catchError(readValue_impl(this, key, debugID));
|
||||
}
|
||||
|
||||
|
@ -5893,11 +5893,12 @@ public:
|
|||
return Optional<Value>();
|
||||
}
|
||||
|
||||
Future<Optional<Value>> readValuePrefix(KeyRef key, int maxLength, Optional<UID> debugID = Optional<UID>()) {
|
||||
Future<Optional<Value>> readValuePrefix(KeyRef key, int maxLength,
|
||||
Optional<UID> debugID = Optional<UID>()) override {
|
||||
return catchError(readValuePrefix_impl(this, key, maxLength, debugID));
|
||||
}
|
||||
|
||||
virtual ~KeyValueStoreRedwoodUnversioned(){};
|
||||
~KeyValueStoreRedwoodUnversioned() override{};
|
||||
|
||||
private:
|
||||
std::string m_filePrefix;
|
||||
|
|
|
@ -254,7 +254,7 @@ struct CompoundWorkload : TestWorkload {
|
|||
CompoundWorkload( WorkloadContext& wcx ) : TestWorkload( wcx ) {}
|
||||
CompoundWorkload* add( TestWorkload* w ) { workloads.push_back(w); return this; }
|
||||
|
||||
~CompoundWorkload() {
|
||||
~CompoundWorkload() override {
|
||||
for (int w = 0; w < workloads.size(); w++) delete workloads[w];
|
||||
}
|
||||
std::string description() const override {
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "flow/TDMetric.actor.h"
|
||||
#include "fdbrpc/simulator.h"
|
||||
#include "fdbclient/NativeAPI.actor.h"
|
||||
#include "fdbserver/MetricLogger.h"
|
||||
#include "fdbserver/MetricLogger.actor.h"
|
||||
#include "fdbserver/BackupInterface.h"
|
||||
#include "fdbserver/WorkerInterface.actor.h"
|
||||
#include "fdbserver/IKeyValueStore.h"
|
||||
|
|
|
@ -120,7 +120,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
virtual ~ApiCorrectnessWorkload(){ }
|
||||
~ApiCorrectnessWorkload() override {}
|
||||
|
||||
std::string description() const override { return "ApiCorrectness"; }
|
||||
|
||||
|
@ -141,9 +141,7 @@ public:
|
|||
return Void();
|
||||
}
|
||||
|
||||
Future<Void> performSetup(Database const& cx) {
|
||||
return performSetup(cx, this);
|
||||
}
|
||||
Future<Void> performSetup(Database const& cx) override { return performSetup(cx, this); }
|
||||
|
||||
ACTOR Future<Void> performTest(Database cx, Standalone<VectorRef<KeyValueRef>> data, ApiCorrectnessWorkload *self) {
|
||||
//Run the scripted test for a maximum of 10 minutes
|
||||
|
@ -172,7 +170,7 @@ public:
|
|||
return Void();
|
||||
}
|
||||
|
||||
Future<Void> performTest(Database const& cx, Standalone<VectorRef<KeyValueRef>> const& data) {
|
||||
Future<Void> performTest(Database const& cx, Standalone<VectorRef<KeyValueRef>> const& data) override {
|
||||
return performTest(cx, data, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -94,50 +94,39 @@ struct FlowTransactionWrapper : public TransactionWrapper {
|
|||
transaction = T(extraDB);
|
||||
}
|
||||
}
|
||||
virtual ~FlowTransactionWrapper() { }
|
||||
~FlowTransactionWrapper() override {}
|
||||
|
||||
//Sets a key-value pair in the database
|
||||
void set(KeyRef &key, ValueRef &value) {
|
||||
transaction.set(key, value);
|
||||
}
|
||||
void set(KeyRef& key, ValueRef& value) override { transaction.set(key, value); }
|
||||
|
||||
//Commits modifications to the database
|
||||
Future<Void> commit() {
|
||||
return transaction.commit();
|
||||
}
|
||||
Future<Void> commit() override { return transaction.commit(); }
|
||||
|
||||
//Gets a value associated with a given key from the database
|
||||
Future<Optional<Value>> get(KeyRef &key) {
|
||||
return transaction.get(key);
|
||||
}
|
||||
Future<Optional<Value>> get(KeyRef& key) override { return transaction.get(key); }
|
||||
|
||||
//Gets a range of key-value pairs from the database specified by a key range
|
||||
Future<Standalone<RangeResultRef>> getRange(KeyRangeRef &keys, int limit, bool reverse) {
|
||||
Future<Standalone<RangeResultRef>> getRange(KeyRangeRef& keys, int limit, bool reverse) override {
|
||||
return transaction.getRange(keys, limit, false, reverse);
|
||||
}
|
||||
|
||||
//Gets a range of key-value pairs from the database specified by a pair of key selectors
|
||||
Future<Standalone<RangeResultRef>> getRange(KeySelectorRef &begin, KeySelectorRef &end, int limit, bool reverse) {
|
||||
Future<Standalone<RangeResultRef>> getRange(KeySelectorRef& begin, KeySelectorRef& end, int limit,
|
||||
bool reverse) override {
|
||||
return transaction.getRange(begin, end, limit, false, reverse);
|
||||
}
|
||||
|
||||
//Gets the key from the database specified by a given key selector
|
||||
Future<Key> getKey(KeySelectorRef &key) {
|
||||
return transaction.getKey(key);
|
||||
}
|
||||
Future<Key> getKey(KeySelectorRef& key) override { return transaction.getKey(key); }
|
||||
|
||||
//Clears a key from the database
|
||||
void clear(KeyRef &key) {
|
||||
transaction.clear(key);
|
||||
}
|
||||
void clear(KeyRef& key) override { transaction.clear(key); }
|
||||
|
||||
//Clears a range of keys from the database
|
||||
void clear(KeyRangeRef &range) {
|
||||
transaction.clear(range);
|
||||
}
|
||||
void clear(KeyRangeRef& range) override { transaction.clear(range); }
|
||||
|
||||
//Processes transaction error conditions
|
||||
Future<Void> onError(Error const& e) {
|
||||
Future<Void> onError(Error const& e) override {
|
||||
Future<Void> returnVal = transaction.onError(e);
|
||||
if( useExtraDB ) {
|
||||
lastTransaction = std::move(transaction);
|
||||
|
@ -147,23 +136,15 @@ struct FlowTransactionWrapper : public TransactionWrapper {
|
|||
}
|
||||
|
||||
//Gets the read version of a transaction
|
||||
Future<Version> getReadVersion() {
|
||||
return transaction.getReadVersion();
|
||||
}
|
||||
Future<Version> getReadVersion() override { return transaction.getReadVersion(); }
|
||||
|
||||
//Gets the committed version of a transaction
|
||||
Version getCommittedVersion() {
|
||||
return transaction.getCommittedVersion();
|
||||
}
|
||||
Version getCommittedVersion() override { return transaction.getCommittedVersion(); }
|
||||
|
||||
//Prints debugging messages for a transaction
|
||||
void debugTransaction(UID debugId) {
|
||||
transaction.debugTransaction(debugId);
|
||||
}
|
||||
void debugTransaction(UID debugId) override { transaction.debugTransaction(debugId); }
|
||||
|
||||
void addReadConflictRange( KeyRangeRef const& keys ) {
|
||||
transaction.addReadConflictRange(keys);
|
||||
}
|
||||
void addReadConflictRange(KeyRangeRef const& keys) override { transaction.addReadConflictRange(keys); }
|
||||
};
|
||||
|
||||
//A wrapper class for ThreadSafeTransactions. Converts ThreadFutures into Futures for interchangeability with flow transactions
|
||||
|
@ -172,66 +153,47 @@ struct ThreadTransactionWrapper : public TransactionWrapper {
|
|||
Reference<ITransaction> transaction;
|
||||
|
||||
ThreadTransactionWrapper(Reference<IDatabase> db, Reference<IDatabase> extraDB, bool useExtraDB) : transaction(db->createTransaction()) { }
|
||||
virtual ~ThreadTransactionWrapper() { }
|
||||
~ThreadTransactionWrapper() override {}
|
||||
|
||||
//Sets a key-value pair in the database
|
||||
void set(KeyRef &key, ValueRef &value) {
|
||||
transaction->set(key, value);
|
||||
}
|
||||
void set(KeyRef& key, ValueRef& value) override { transaction->set(key, value); }
|
||||
|
||||
//Commits modifications to the database
|
||||
Future<Void> commit() {
|
||||
return unsafeThreadFutureToFuture(transaction->commit());
|
||||
}
|
||||
Future<Void> commit() override { return unsafeThreadFutureToFuture(transaction->commit()); }
|
||||
|
||||
//Gets a value associated with a given key from the database
|
||||
Future<Optional<Value>> get(KeyRef &key) {
|
||||
return unsafeThreadFutureToFuture(transaction->get(key));
|
||||
}
|
||||
Future<Optional<Value>> get(KeyRef& key) override { return unsafeThreadFutureToFuture(transaction->get(key)); }
|
||||
|
||||
//Gets a range of key-value pairs from the database specified by a key range
|
||||
Future<Standalone<RangeResultRef>> getRange(KeyRangeRef &keys, int limit, bool reverse) {
|
||||
Future<Standalone<RangeResultRef>> getRange(KeyRangeRef& keys, int limit, bool reverse) override {
|
||||
return unsafeThreadFutureToFuture(transaction->getRange(keys, limit, false, reverse));
|
||||
}
|
||||
|
||||
//Gets a range of key-value pairs from the database specified by a pair of key selectors
|
||||
Future<Standalone<RangeResultRef>> getRange(KeySelectorRef &begin, KeySelectorRef &end, int limit, bool reverse) {
|
||||
Future<Standalone<RangeResultRef>> getRange(KeySelectorRef& begin, KeySelectorRef& end, int limit,
|
||||
bool reverse) override {
|
||||
return unsafeThreadFutureToFuture(transaction->getRange(begin, end, limit, false, reverse));
|
||||
}
|
||||
|
||||
//Gets the key from the database specified by a given key selector
|
||||
Future<Key> getKey(KeySelectorRef &key) {
|
||||
return unsafeThreadFutureToFuture(transaction->getKey(key));
|
||||
}
|
||||
Future<Key> getKey(KeySelectorRef& key) override { return unsafeThreadFutureToFuture(transaction->getKey(key)); }
|
||||
|
||||
//Clears a key from the database
|
||||
void clear(KeyRef &key) {
|
||||
transaction->clear(key);
|
||||
}
|
||||
void clear(KeyRef& key) override { transaction->clear(key); }
|
||||
|
||||
//Clears a range of keys from the database
|
||||
void clear(KeyRangeRef &range) {
|
||||
transaction->clear(range);
|
||||
}
|
||||
void clear(KeyRangeRef& range) override { transaction->clear(range); }
|
||||
|
||||
//Processes transaction error conditions
|
||||
Future<Void> onError(Error const& e) {
|
||||
return unsafeThreadFutureToFuture(transaction->onError(e));
|
||||
}
|
||||
Future<Void> onError(Error const& e) override { return unsafeThreadFutureToFuture(transaction->onError(e)); }
|
||||
|
||||
//Gets the read version of a transaction
|
||||
Future<Version> getReadVersion() {
|
||||
return unsafeThreadFutureToFuture(transaction->getReadVersion());
|
||||
}
|
||||
Future<Version> getReadVersion() override { return unsafeThreadFutureToFuture(transaction->getReadVersion()); }
|
||||
|
||||
//Gets the committed version of a transaction
|
||||
Version getCommittedVersion() {
|
||||
return transaction->getCommittedVersion();
|
||||
}
|
||||
Version getCommittedVersion() override { return transaction->getCommittedVersion(); }
|
||||
|
||||
void addReadConflictRange( KeyRangeRef const& keys ) {
|
||||
transaction->addReadConflictRange(keys);
|
||||
}
|
||||
void addReadConflictRange(KeyRangeRef const& keys) override { transaction->addReadConflictRange(keys); }
|
||||
};
|
||||
|
||||
//A factory interface for creating different kinds of TransactionWrappers
|
||||
|
@ -252,10 +214,10 @@ struct TransactionFactory : public TransactionFactoryInterface {
|
|||
bool useExtraDB;
|
||||
|
||||
TransactionFactory(DB dbHandle, DB extraDbHandle, bool useExtraDB) : dbHandle(dbHandle), extraDbHandle(extraDbHandle), useExtraDB(useExtraDB) { }
|
||||
virtual ~TransactionFactory() { }
|
||||
~TransactionFactory() override {}
|
||||
|
||||
//Creates a new transaction
|
||||
Reference<TransactionWrapper> createTransaction() {
|
||||
Reference<TransactionWrapper> createTransaction() override {
|
||||
return Reference<TransactionWrapper>(new T(dbHandle, extraDbHandle, useExtraDB));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -78,12 +78,12 @@ struct AsyncFileWorkload : TestWorkload
|
|||
std::string path;
|
||||
|
||||
AsyncFileWorkload(WorkloadContext const&);
|
||||
virtual ~AsyncFileWorkload() { }
|
||||
~AsyncFileWorkload() override {}
|
||||
|
||||
//Allocates a buffer of a given size. If necessary, the buffer will be aligned to 4K
|
||||
Reference<AsyncFileBuffer> allocateBuffer(size_t size);
|
||||
|
||||
virtual Future<bool> check(Database const& cx);
|
||||
Future<bool> check(Database const& cx) override;
|
||||
|
||||
//Opens a file for AsyncFile operations. If the path is empty, then creates a file and fills it with random data
|
||||
ACTOR Future<Void> openFile(AsyncFileWorkload *self, int64_t flags, int64_t mode, uint64_t size, bool fillFile = false)
|
||||
|
|
|
@ -96,7 +96,7 @@ struct AsyncFileCorrectnessWorkload : public AsyncFileWorkload
|
|||
}
|
||||
}
|
||||
|
||||
virtual ~AsyncFileCorrectnessWorkload(){ }
|
||||
~AsyncFileCorrectnessWorkload() override {}
|
||||
|
||||
std::string description() const override { return "AsyncFileCorrectness"; }
|
||||
|
||||
|
|
|
@ -180,7 +180,7 @@ struct AsyncFileReadWorkload : public AsyncFileWorkload
|
|||
fixedRate = getOption(options, LiteralStringRef("fixedRate"), 0.0);
|
||||
}
|
||||
|
||||
virtual ~AsyncFileReadWorkload(){ }
|
||||
~AsyncFileReadWorkload() override {}
|
||||
|
||||
std::string description() const override { return "AsyncFileRead"; }
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ public:
|
|||
|
||||
Future<bool> check(Database const& cx) override { return !testFailed; }
|
||||
|
||||
virtual void getMetrics(vector<PerfMetric>& m) override {}
|
||||
void getMetrics(vector<PerfMetric>& m) override {}
|
||||
|
||||
// Test Atomic ops on non existing keys that results in a set
|
||||
ACTOR Future<Void> testAtomicOpSetOnNonExistingKey(Database cx, AtomicOpsApiCorrectnessWorkload* self, uint32_t opType, Key key) {
|
||||
|
|
|
@ -74,7 +74,7 @@ struct BackupToDBUpgradeWorkload : TestWorkload {
|
|||
TraceEvent("DRU_Start");
|
||||
}
|
||||
|
||||
virtual std::string description() const override { return "BackupToDBUpgrade"; }
|
||||
std::string description() const override { return "BackupToDBUpgrade"; }
|
||||
|
||||
Future<Void> setup(Database const& cx) override {
|
||||
if (clientId != 0)
|
||||
|
|
|
@ -100,18 +100,18 @@ namespace ClientLogEventsParser {
|
|||
ParserBase::~ParserBase() {}
|
||||
|
||||
struct Parser_V1 : ParserBase {
|
||||
virtual ~Parser_V1() override {}
|
||||
~Parser_V1() override {}
|
||||
};
|
||||
struct Parser_V2 : ParserBase {
|
||||
Parser_V2() { parseGetVersion = parseEventGetVersion_V2; }
|
||||
virtual ~Parser_V2() override {}
|
||||
~Parser_V2() override {}
|
||||
};
|
||||
struct Parser_V3 : ParserBase {
|
||||
Parser_V3() {
|
||||
parseGetVersion = parseEventGetVersion_V3;
|
||||
parseCommit = parseEventCommit_V2;
|
||||
}
|
||||
virtual ~Parser_V3() override {}
|
||||
~Parser_V3() override {}
|
||||
};
|
||||
|
||||
struct ParserFactory {
|
||||
|
|
|
@ -94,7 +94,7 @@ struct DiskDurabilityWorkload : public AsyncFileWorkload
|
|||
syncInterval = (double)(getOption(options, LiteralStringRef("syncIntervalMs"), 2000)) / 1000;
|
||||
}
|
||||
|
||||
virtual ~DiskDurabilityWorkload(){ }
|
||||
~DiskDurabilityWorkload() override {}
|
||||
|
||||
std::string description() const override { return "DiskDurability"; }
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ struct ExternalWorkload : TestWorkload, FDBWorkloadContext {
|
|||
workloadImpl->init(this);
|
||||
}
|
||||
|
||||
~ExternalWorkload() {
|
||||
~ExternalWorkload() override {
|
||||
workloadImpl = nullptr;
|
||||
if (library) {
|
||||
closeLibrary(library);
|
||||
|
@ -262,13 +262,13 @@ struct ExternalWorkload : TestWorkload, FDBWorkloadContext {
|
|||
long getOption(const std::string& name, long defaultValue) override {
|
||||
return ::getOption(options, Value(name), int64_t(defaultValue));
|
||||
}
|
||||
unsigned long getOption(const std::string& name, unsigned long defaultValue) {
|
||||
unsigned long getOption(const std::string& name, unsigned long defaultValue) override {
|
||||
return ::getOption(options, Value(name), uint64_t(defaultValue));
|
||||
}
|
||||
double getOption(const std::string& name, double defaultValue) {
|
||||
double getOption(const std::string& name, double defaultValue) override {
|
||||
return ::getOption(options, Value(name), defaultValue);
|
||||
}
|
||||
std::string getOption(const std::string& name, std::string defaultValue) {
|
||||
std::string getOption(const std::string& name, std::string defaultValue) override {
|
||||
return ::getOption(options, Value(name), Value(defaultValue)).toString();
|
||||
}
|
||||
|
||||
|
|
|
@ -312,17 +312,17 @@ struct FileSystemWorkload : TestWorkload {
|
|||
}
|
||||
|
||||
class RecentModificationQuery : public FileSystemOp {
|
||||
virtual Future<Optional<Version>> run( FileSystemWorkload *self, Transaction* tr ) {
|
||||
Future<Optional<Version>> run(FileSystemWorkload* self, Transaction* tr) override {
|
||||
return self->modificationQuery( self, tr );
|
||||
}
|
||||
virtual const char* name() { return "RecentUserModifications"; }
|
||||
const char* name() override { return "RecentUserModifications"; }
|
||||
};
|
||||
|
||||
class ServerDeletionCountQuery : public FileSystemOp {
|
||||
virtual Future<Optional<Version>> run( FileSystemWorkload *self, Transaction* tr ) {
|
||||
Future<Optional<Version>> run(FileSystemWorkload* self, Transaction* tr) override {
|
||||
return self->deletionQuery( self, tr );
|
||||
}
|
||||
virtual const char* name() { return "ServerDeletions"; }
|
||||
const char* name() override { return "ServerDeletions"; }
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -557,12 +557,12 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
BaseTestCallback(unsigned int id, FuzzApiCorrectnessWorkload *wl, const char *func)
|
||||
: BaseTest<Subclass, Void>(id, wl, func) {}
|
||||
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) {
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) override {
|
||||
callback(tr);
|
||||
return tr.castTo<ThreadSafeTransaction>()->checkDeferredError();
|
||||
}
|
||||
|
||||
Void errorCheck(Reference<ITransaction> tr, value_type result) {
|
||||
Void errorCheck(Reference<ITransaction> tr, value_type result) override {
|
||||
callbackErrorCheck(tr);
|
||||
return Void();
|
||||
}
|
||||
|
@ -589,18 +589,18 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
|
||||
}
|
||||
|
||||
ThreadFuture<Version> createFuture(Reference<ITransaction> tr) {
|
||||
ThreadFuture<Version> createFuture(Reference<ITransaction> tr) override {
|
||||
tr->setVersion(v);
|
||||
pre_steps.push_back(tr.castTo<ThreadSafeTransaction>()->checkDeferredError());
|
||||
return tr->getReadVersion();
|
||||
}
|
||||
|
||||
Void errorCheck(Reference<ITransaction> tr, value_type result) {
|
||||
Void errorCheck(Reference<ITransaction> tr, value_type result) override {
|
||||
ASSERT(v == result);
|
||||
return Void();
|
||||
}
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Version", v);
|
||||
}
|
||||
|
@ -625,11 +625,11 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) {
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) override {
|
||||
return tr->get(key, deterministicRandom()->coinflip());
|
||||
}
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key", printable(key));
|
||||
}
|
||||
|
@ -648,11 +648,11 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) {
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) override {
|
||||
return tr->getKey(keysel, deterministicRandom()->coinflip());
|
||||
}
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("KeySel", keysel.toString());
|
||||
}
|
||||
|
@ -695,11 +695,11 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) {
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) override {
|
||||
return tr->getRange(keysel1, keysel2, limit, deterministicRandom()->coinflip(), deterministicRandom()->coinflip());
|
||||
}
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("KeySel1", keysel1.toString()).detail("KeySel2", keysel2.toString()).detail("Limit", limit);
|
||||
}
|
||||
|
@ -735,11 +735,11 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) {
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) override {
|
||||
return tr->getRange(keysel1, keysel2, limits, deterministicRandom()->coinflip(), deterministicRandom()->coinflip());
|
||||
}
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("KeySel1", keysel1.toString()).detail("KeySel2", keysel2.toString());
|
||||
std::stringstream ss;
|
||||
|
@ -785,12 +785,12 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) {
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) override {
|
||||
return tr->getRange(KeyRangeRef(key1, key2),
|
||||
limit, deterministicRandom()->coinflip(), deterministicRandom()->coinflip());
|
||||
}
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key1", printable(key1)).detail("Key2", printable(key2)).detail("Limit", limit);
|
||||
}
|
||||
|
@ -826,11 +826,11 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) {
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) override {
|
||||
return tr->getRange(KeyRangeRef(key1, key2), limits, deterministicRandom()->coinflip(), deterministicRandom()->coinflip());
|
||||
}
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key1", printable(key1)).detail("Key2", printable(key2));
|
||||
std::stringstream ss;
|
||||
|
@ -850,11 +850,11 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) {
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) override {
|
||||
return tr->getAddressesForKey(key);
|
||||
}
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key", printable(key));
|
||||
}
|
||||
|
@ -875,11 +875,9 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
void callback(Reference<ITransaction> tr) {
|
||||
tr->addReadConflictRange(KeyRangeRef(key1, key2));
|
||||
}
|
||||
void callback(Reference<ITransaction> tr) override { tr->addReadConflictRange(KeyRangeRef(key1, key2)); }
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key1", printable(key1)).detail("Key2", printable(key2));
|
||||
}
|
||||
|
@ -943,11 +941,9 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
void callback(Reference<ITransaction> tr) {
|
||||
tr->atomicOp(key, value, (FDBMutationTypes::Option) op);
|
||||
}
|
||||
void callback(Reference<ITransaction> tr) override { tr->atomicOp(key, value, (FDBMutationTypes::Option)op); }
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key", printable(key)).detail("Value", printable(value)).detail("Op", op).detail("Pos", pos);
|
||||
}
|
||||
|
@ -983,11 +979,9 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
workload->specialKeysWritesEnabled)) };
|
||||
}
|
||||
|
||||
void callback(Reference<ITransaction> tr) {
|
||||
tr->set(key, value);
|
||||
}
|
||||
void callback(Reference<ITransaction> tr) override { tr->set(key, value); }
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key", printable(key)).detail("Value", printable(value));
|
||||
}
|
||||
|
@ -1023,11 +1017,9 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
void callback(Reference<ITransaction> tr) {
|
||||
tr->clear(key1, key2);
|
||||
}
|
||||
void callback(Reference<ITransaction> tr) override { tr->clear(key1, key2); }
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key1", printable(key1)).detail("Key2", printable(key2));
|
||||
}
|
||||
|
@ -1063,11 +1055,9 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
void callback(Reference<ITransaction> tr) {
|
||||
tr->clear(KeyRangeRef(key1, key2));
|
||||
}
|
||||
void callback(Reference<ITransaction> tr) override { tr->clear(KeyRangeRef(key1, key2)); }
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key1", printable(key1)).detail("Key2", printable(key2));
|
||||
}
|
||||
|
@ -1093,11 +1083,9 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
workload->specialKeysWritesEnabled)) };
|
||||
}
|
||||
|
||||
void callback(Reference<ITransaction> tr) {
|
||||
tr->clear(key);
|
||||
}
|
||||
void callback(Reference<ITransaction> tr) override { tr->clear(key); }
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key", printable(key));
|
||||
}
|
||||
|
@ -1119,11 +1107,9 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) {
|
||||
return tr->watch(key);
|
||||
}
|
||||
ThreadFuture<value_type> createFuture(Reference<ITransaction> tr) override { return tr->watch(key); }
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key", printable(key));
|
||||
}
|
||||
|
@ -1144,11 +1130,9 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
void callback(Reference<ITransaction> tr) {
|
||||
tr->addWriteConflictRange(KeyRangeRef(key1, key2));
|
||||
}
|
||||
void callback(Reference<ITransaction> tr) override { tr->addWriteConflictRange(KeyRangeRef(key1, key2)); }
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Key1", printable(key1)).detail("Key2", printable(key2));
|
||||
}
|
||||
|
@ -1222,11 +1206,11 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
};
|
||||
}
|
||||
|
||||
void callback(Reference<ITransaction> tr) {
|
||||
void callback(Reference<ITransaction> tr) override {
|
||||
tr->setOption((FDBTransactionOptions::Option) op, val.castTo<StringRef>());
|
||||
}
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("Op", op).detail("Val", printable(val));
|
||||
}
|
||||
|
@ -1247,7 +1231,7 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
}
|
||||
}
|
||||
|
||||
void callback(Reference<ITransaction> tr) {
|
||||
void callback(Reference<ITransaction> tr) override {
|
||||
tr->onError(Error::fromUnvalidatedCode(errorcode));
|
||||
// This is necessary here, as onError will have reset this
|
||||
// value, we will be looking at the wrong thing.
|
||||
|
@ -1255,7 +1239,7 @@ struct FuzzApiCorrectnessWorkload : TestWorkload {
|
|||
tr->setOption( FDBTransactionOptions::ACCESS_SYSTEM_KEYS );
|
||||
}
|
||||
|
||||
void augmentTrace(TraceEvent &e) const {
|
||||
void augmentTrace(TraceEvent& e) const override {
|
||||
base_type::augmentTrace(e);
|
||||
e.detail("ErrorCode", errorcode);
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ struct LocalRatekeeperWorkload : TestWorkload {
|
|||
blockWritesFor = getOption(options, LiteralStringRef("blockWritesFor"),
|
||||
double(SERVER_KNOBS->STORAGE_DURABILITY_LAG_HARD_MAX)/double(1e6));
|
||||
}
|
||||
std::string description() const { return "LocalRatekeeperWorkload"; }
|
||||
std::string description() const override { return "LocalRatekeeperWorkload"; }
|
||||
|
||||
ACTOR static Future<Void> testStorage(LocalRatekeeperWorkload* self, Database cx, StorageServerInterface ssi) {
|
||||
state Transaction tr(cx);
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
*/
|
||||
|
||||
#include "flow/Arena.h"
|
||||
#include "flow/actorcompiler.h"
|
||||
#include "fdbserver/workloads/workloads.actor.h"
|
||||
#include "fdbserver/QuietDatabase.h"
|
||||
#include "fdbserver/workloads/TPCCWorkload.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
#include "fdbserver/workloads/workloads.actor.h"
|
||||
#include "flow/actorcompiler.h" // This must be the last include
|
||||
|
||||
struct ProtocolVersionWorkload : TestWorkload {
|
||||
ProtocolVersionWorkload(WorkloadContext const& wcx) : TestWorkload(wcx) {}
|
||||
|
|
|
@ -38,7 +38,7 @@ struct RYWDisableWorkload : TestWorkload {
|
|||
keyBytes = std::max( getOption( options, LiteralStringRef("keyBytes"), 16 ), 16 );
|
||||
}
|
||||
|
||||
std::string description() const { return "RYWDisable"; }
|
||||
std::string description() const override { return "RYWDisable"; }
|
||||
|
||||
Future<Void> setup(Database const& cx) override { return Void(); }
|
||||
|
||||
|
|
|
@ -229,8 +229,8 @@ struct ReadWriteWorkload : KVWorkload {
|
|||
choose {
|
||||
when( wait( db->onChange() ) ) {}
|
||||
|
||||
when (ErrorOr<std::vector<WorkerDetails>> workerList = wait( db->get().clusterInterface.getWorkers.tryGetReply( GetWorkersRequest() ) );)
|
||||
{
|
||||
when(ErrorOr<std::vector<WorkerDetails>> workerList =
|
||||
wait(db->get().clusterInterface.getWorkers.tryGetReply(GetWorkersRequest()))) {
|
||||
if( workerList.present() ) {
|
||||
std::vector<Future<ErrorOr<Void>>> dumpRequests;
|
||||
for( int i = 0; i < workerList.get().size(); i++)
|
||||
|
@ -248,7 +248,7 @@ struct ReadWriteWorkload : KVWorkload {
|
|||
}
|
||||
}
|
||||
|
||||
virtual Future<bool> check( Database const& cx ) {
|
||||
Future<bool> check(Database const& cx) override {
|
||||
clients.clear();
|
||||
|
||||
if(!cancelWorkersAtDuration && now() < metricsStart + metricsDuration)
|
||||
|
|
|
@ -84,9 +84,7 @@ struct RyowCorrectnessWorkload : ApiWorkload {
|
|||
return Void();
|
||||
}
|
||||
|
||||
Future<Void> performSetup(Database const& cx) {
|
||||
return performSetup(cx, this);
|
||||
}
|
||||
Future<Void> performSetup(Database const& cx) override { return performSetup(cx, this); }
|
||||
|
||||
//Generates a random sequence of operations to perform in a single transaction
|
||||
std::vector<Operation> generateOperationSequence(Standalone<VectorRef<KeyValueRef>> const& data) {
|
||||
|
@ -347,7 +345,7 @@ struct RyowCorrectnessWorkload : ApiWorkload {
|
|||
}
|
||||
}
|
||||
|
||||
Future<Void> performTest(Database const& cx, Standalone<VectorRef<KeyValueRef>> const& data) {
|
||||
Future<Void> performTest(Database const& cx, Standalone<VectorRef<KeyValueRef>> const& data) override {
|
||||
return ::success(timeout(performTest(cx, data, this), duration));
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "flow/actorcompiler.h"
|
||||
#include "fdbserver/workloads/workloads.actor.h"
|
||||
#include "fdbserver/workloads/TPCCWorkload.h"
|
||||
|
||||
|
|
|
@ -35,9 +35,15 @@ struct SayHelloTaskFunc : TaskFuncBase {
|
|||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
StringRef getName() const override { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return Void();
|
||||
};
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return _finish(tr, tb, fb, task);
|
||||
};
|
||||
|
||||
ACTOR static Future<Void> _finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> taskBucket, Reference<FutureBucket> futureBucket, Reference<Task> task) {
|
||||
// check task version
|
||||
|
@ -102,9 +108,15 @@ struct SayHelloToEveryoneTaskFunc : TaskFuncBase {
|
|||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
StringRef getName() const override { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return Void();
|
||||
};
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return _finish(tr, tb, fb, task);
|
||||
};
|
||||
|
||||
ACTOR static Future<Void> _finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> taskBucket, Reference<FutureBucket> futureBucket, Reference<Task> task) {
|
||||
Reference<TaskFuture> done = futureBucket->unpack(task->params[Task::reservedTaskParamKeyDone]);
|
||||
|
@ -144,9 +156,15 @@ struct SaidHelloTaskFunc : TaskFuncBase {
|
|||
static StringRef name;
|
||||
static constexpr uint32_t version = 1;
|
||||
|
||||
StringRef getName() const { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return Void(); };
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb, Reference<Task> task) { return _finish(tr, tb, fb, task); };
|
||||
StringRef getName() const override { return name; };
|
||||
Future<Void> execute(Database cx, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return Void();
|
||||
};
|
||||
Future<Void> finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> tb, Reference<FutureBucket> fb,
|
||||
Reference<Task> task) override {
|
||||
return _finish(tr, tb, fb, task);
|
||||
};
|
||||
|
||||
ACTOR static Future<Void> _finish(Reference<ReadYourWritesTransaction> tr, Reference<TaskBucket> taskBucket, Reference<FutureBucket> futureBucket, Reference<Task> task) {
|
||||
wait(taskBucket->finish(tr, task));
|
||||
|
|
|
@ -69,7 +69,7 @@ struct RWTransactor : ITransactor {
|
|||
|
||||
Value randomValue() { return StringRef( (const uint8_t*)valueString.c_str(), deterministicRandom()->randomInt(minValueBytes, maxValueBytes+1) ); };
|
||||
|
||||
virtual Future<Void> doTransaction(Database const& db, Stats* stats) {
|
||||
Future<Void> doTransaction(Database const& db, Stats* stats) override {
|
||||
return rwTransaction(db, Reference<RWTransactor>::addRef(this), stats );
|
||||
}
|
||||
|
||||
|
@ -131,7 +131,7 @@ struct ABTransactor : ITransactor {
|
|||
{
|
||||
}
|
||||
|
||||
virtual Future<Void> doTransaction(Database const& db, Stats* stats) {
|
||||
Future<Void> doTransaction(Database const& db, Stats* stats) override {
|
||||
return deterministicRandom()->random01() >= alpha ? a->doTransaction(db,stats) : b->doTransaction(db,stats);
|
||||
}
|
||||
};
|
||||
|
@ -149,7 +149,7 @@ struct SweepTransactor : ITransactor {
|
|||
{
|
||||
}
|
||||
|
||||
virtual Future<Void> doTransaction(Database const& db, Stats* stats) {
|
||||
Future<Void> doTransaction(Database const& db, Stats* stats) override {
|
||||
if (startTime==-1) startTime = now()+startDelay;
|
||||
|
||||
double alpha;
|
||||
|
@ -181,8 +181,11 @@ struct MeasureSinglePeriod : IMeasurer {
|
|||
|
||||
MeasureSinglePeriod( double delay, double duration ) : delay(delay), duration(duration), totalLatency(2000), grvLatency(2000), rowReadLatency(2000), commitLatency(2000) {}
|
||||
|
||||
virtual Future<Void> start() { startT = now(); return Void(); }
|
||||
virtual void addTransaction(ITransactor::Stats* st, double now) {
|
||||
Future<Void> start() override {
|
||||
startT = now();
|
||||
return Void();
|
||||
}
|
||||
void addTransaction(ITransactor::Stats* st, double now) override {
|
||||
if (!(now >= startT+delay && now < startT+delay+duration)) return;
|
||||
|
||||
totalLatency.addSample( st->totalLatency );
|
||||
|
@ -195,7 +198,7 @@ struct MeasureSinglePeriod : IMeasurer {
|
|||
|
||||
stats += *st;
|
||||
}
|
||||
virtual void getMetrics( vector<PerfMetric>& m ) {
|
||||
void getMetrics(vector<PerfMetric>& m) override {
|
||||
double measureDuration = duration;
|
||||
m.push_back( PerfMetric( "Transactions/sec", stats.transactions / measureDuration, false ) );
|
||||
m.push_back( PerfMetric( "Retries/sec", stats.retries / measureDuration, false ) );
|
||||
|
@ -225,14 +228,12 @@ struct MeasurePeriodically : IMeasurer {
|
|||
|
||||
MeasurePeriodically( double period, std::set<std::string> includeMetrics ) : period(period), includeMetrics(includeMetrics), msp(0,period), msp0(0,period) {}
|
||||
|
||||
virtual Future<Void> start() {
|
||||
Future<Void> start() override {
|
||||
msp.start();
|
||||
return periodicActor(this);
|
||||
}
|
||||
virtual void addTransaction(ITransactor::Stats* st, double now) {
|
||||
msp.addTransaction(st, now);
|
||||
}
|
||||
virtual void getMetrics( vector<PerfMetric>& m ) {
|
||||
void addTransaction(ITransactor::Stats* st, double now) override { msp.addTransaction(st, now); }
|
||||
void getMetrics(vector<PerfMetric>& m) override {
|
||||
m.insert(m.end(), accumulatedMetrics.begin(), accumulatedMetrics.end());
|
||||
}
|
||||
void nextPeriod(double t) {
|
||||
|
@ -263,17 +264,17 @@ struct MeasurePeriodically : IMeasurer {
|
|||
|
||||
struct MeasureMulti : IMeasurer {
|
||||
vector<Reference<IMeasurer>> ms;
|
||||
virtual Future<Void> start() {
|
||||
Future<Void> start() override {
|
||||
vector<Future<Void>> s;
|
||||
for(auto m=ms.begin(); m!=ms.end(); ++m)
|
||||
s.push_back( (*m)->start() );
|
||||
return waitForAll(s);
|
||||
}
|
||||
virtual void addTransaction(ITransactor::Stats* stats, double now) {
|
||||
void addTransaction(ITransactor::Stats* stats, double now) override {
|
||||
for(auto m=ms.begin(); m!=ms.end(); ++m)
|
||||
(*m)->addTransaction(stats, now);
|
||||
}
|
||||
virtual void getMetrics( vector<PerfMetric>& metrics ) {
|
||||
void getMetrics(vector<PerfMetric>& metrics) override {
|
||||
for(auto m=ms.begin(); m!=ms.end(); ++m)
|
||||
(*m)->getMetrics(metrics);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ struct UDPWorkload : TestWorkload {
|
|||
}
|
||||
}
|
||||
|
||||
virtual std::string description() const { return name; }
|
||||
std::string description() const override { return name; }
|
||||
ACTOR static Future<Void> _setup(UDPWorkload* self, Database cx) {
|
||||
state NetworkAddress localAddress(g_network->getLocalAddress().ip,
|
||||
deterministicRandom()->randomInt(self->minPort, self->maxPort + 1), true,
|
||||
|
@ -86,7 +86,7 @@ struct UDPWorkload : TestWorkload {
|
|||
}
|
||||
}
|
||||
}
|
||||
virtual Future<Void> setup(Database const& cx) { return _setup(this, cx); }
|
||||
Future<Void> setup(Database const& cx) override { return _setup(this, cx); }
|
||||
|
||||
class Message {
|
||||
int _type = 0;
|
||||
|
@ -236,9 +236,9 @@ struct UDPWorkload : TestWorkload {
|
|||
UNSTOPPABLE_ASSERT(false);
|
||||
return Void();
|
||||
}
|
||||
virtual Future<Void> start(Database const& cx) { return delay(runFor) || _start(this, cx); }
|
||||
virtual Future<bool> check(Database const& cx) { return true; }
|
||||
virtual void getMetrics(vector<PerfMetric>& m) {
|
||||
Future<Void> start(Database const& cx) override { return delay(runFor) || _start(this, cx); }
|
||||
Future<bool> check(Database const& cx) override { return true; }
|
||||
void getMetrics(vector<PerfMetric>& m) override {
|
||||
unsigned totalReceived = 0, totalSent = 0, totalAcked = 0, totalSuccess = 0;
|
||||
for (const auto& p : sent) {
|
||||
totalSent += p.second;
|
||||
|
|
|
@ -129,9 +129,7 @@ struct WorkloadFactory : IWorkloadFactory {
|
|||
WorkloadFactory(const char* name) {
|
||||
factories()[name] = this;
|
||||
}
|
||||
virtual TestWorkload* create( WorkloadContext const& wcx ) {
|
||||
return new WorkloadType(wcx);
|
||||
}
|
||||
TestWorkload* create(WorkloadContext const& wcx) override { return new WorkloadType(wcx); }
|
||||
};
|
||||
|
||||
#define REGISTER_WORKLOAD(classname) WorkloadFactory<classname> classname##WorkloadFactory( #classname )
|
||||
|
|
|
@ -66,11 +66,11 @@ private:
|
|||
|
||||
public:
|
||||
EventFD(ASIOReactor* reactor) : sd(reactor->ios, open()) {}
|
||||
~EventFD() {
|
||||
~EventFD() override {
|
||||
sd.close(); // Also closes the fd, I assume...
|
||||
}
|
||||
virtual int getFD() { return fd; }
|
||||
virtual Future<int64_t> read() {
|
||||
int getFD() override { return fd; }
|
||||
Future<int64_t> read() override {
|
||||
Promise<int64_t> p;
|
||||
sd.async_read_some( boost::asio::mutable_buffers_1( &fdVal, sizeof(fdVal) ),
|
||||
boost::bind( &EventFD::handle_read, p, &fdVal, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred ) );
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
struct IssuesListImpl;
|
||||
struct IssuesList final : ITraceLogIssuesReporter, ThreadSafeReferenceCounted<IssuesList> {
|
||||
IssuesList();
|
||||
~IssuesList();
|
||||
~IssuesList() override;
|
||||
void addIssue(std::string issue) override;
|
||||
|
||||
void retrieveIssues(std::set<std::string>& out) const override;
|
||||
|
@ -66,8 +66,8 @@ public:
|
|||
FileTraceLogWriter(std::string directory, std::string processName, std::string basename, std::string extension,
|
||||
uint64_t maxLogsSize, std::function<void()> onError, Reference<ITraceLogIssuesReporter> issues);
|
||||
|
||||
void addref();
|
||||
void delref();
|
||||
void addref() override;
|
||||
void delref() override;
|
||||
|
||||
void lastError(int err);
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class ThreadPool final : public IThreadPool, public ReferenceCounted<ThreadPool>
|
|||
};
|
||||
public:
|
||||
ThreadPool(int stackSize) : dontstop(ios), mode(Run), stackSize(stackSize) {}
|
||||
~ThreadPool() {}
|
||||
~ThreadPool() override {}
|
||||
Future<Void> stop(Error const& e = success()) override {
|
||||
if (mode == Shutdown) return Void();
|
||||
ReferenceCounted<ThreadPool>::addref();
|
||||
|
|
|
@ -69,14 +69,12 @@ public:
|
|||
template <class Object, class ActionType>
|
||||
class TypedAction : public ThreadAction {
|
||||
public:
|
||||
virtual void operator()(IThreadPoolReceiver* p) {
|
||||
void operator()(IThreadPoolReceiver* p) override {
|
||||
Object* o = (Object*)p;
|
||||
o->action(*(ActionType*)this);
|
||||
delete (ActionType*)this;
|
||||
}
|
||||
virtual void cancel() {
|
||||
delete (ActionType*)this;
|
||||
}
|
||||
void cancel() override { delete (ActionType*)this; }
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
@ -111,7 +109,7 @@ Reference<IThreadPool> createGenericThreadPool(int stackSize = 0);
|
|||
|
||||
class DummyThreadPool final : public IThreadPool, ReferenceCounted<DummyThreadPool> {
|
||||
public:
|
||||
~DummyThreadPool() {}
|
||||
~DummyThreadPool() override {}
|
||||
DummyThreadPool() : thread(nullptr) {}
|
||||
Future<Void> getError() const override { return errors.getFuture(); }
|
||||
void addThread(IThreadPoolReceiver* userData) override {
|
||||
|
|
|
@ -135,9 +135,9 @@ class Net2 final : public INetwork, public INetworkConnections {
|
|||
|
||||
public:
|
||||
Net2(const TLSConfig& tlsConfig, bool useThreadPool, bool useMetrics);
|
||||
void initTLS(ETLSInitState targetState);
|
||||
void run();
|
||||
void initMetrics();
|
||||
void initTLS(ETLSInitState targetState) override;
|
||||
void run() override;
|
||||
void initMetrics() override;
|
||||
|
||||
// INetworkConnections interface
|
||||
Future<Reference<IConnection>> connect( NetworkAddress toAddr, std::string host ) override;
|
||||
|
@ -1149,7 +1149,7 @@ struct PromiseTask : public Task, public FastAllocated<PromiseTask> {
|
|||
PromiseTask() {}
|
||||
explicit PromiseTask(Promise<Void>&& promise) noexcept : promise(std::move(promise)) {}
|
||||
|
||||
virtual void operator()() {
|
||||
void operator()() override {
|
||||
promise.send(Void());
|
||||
delete this;
|
||||
}
|
||||
|
|
|
@ -765,7 +765,7 @@ struct BaseEventMetric : BaseMetric {
|
|||
Void getValue() const {
|
||||
return Void();
|
||||
}
|
||||
virtual ~BaseEventMetric() {}
|
||||
~BaseEventMetric() override {}
|
||||
|
||||
// Every metric should have a set method for its underlying type in order for MetricUtil::getOrCreateInstance
|
||||
// to initialize it. In the case of event metrics there is no underlying type so the underlying type
|
||||
|
@ -1041,7 +1041,7 @@ private:
|
|||
|
||||
public:
|
||||
DynamicEventMetric(MetricNameRef const &name, Void = Void());
|
||||
~DynamicEventMetric() = default;
|
||||
~DynamicEventMetric() override = default;
|
||||
|
||||
void addref() override { ReferenceCounted<DynamicEventMetric>::addref(); }
|
||||
void delref() override { ReferenceCounted<DynamicEventMetric>::delref(); }
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
|
||||
#include "flow/actorcompiler.h" // has to be last include
|
||||
|
||||
#ifdef NO_INTELLISENSE
|
||||
namespace {
|
||||
#endif
|
||||
|
||||
// Initial size of buffer used to store serialized traces. Buffer will be
|
||||
// resized when necessary.
|
||||
|
@ -37,7 +39,7 @@ constexpr int kTraceBufferSize = 1024;
|
|||
constexpr float kQueueSizeLogInterval = 5.0;
|
||||
|
||||
struct NoopTracer : ITracer {
|
||||
TracerType type() const { return TracerType::DISABLED; }
|
||||
TracerType type() const override { return TracerType::DISABLED; }
|
||||
void trace(Span const& span) override {}
|
||||
};
|
||||
|
||||
|
@ -367,9 +369,7 @@ struct FastUDPTracer : public UDPTracer {
|
|||
};
|
||||
}
|
||||
|
||||
~FastUDPTracer() {
|
||||
free(request_.buffer);
|
||||
}
|
||||
~FastUDPTracer() override { free(request_.buffer); }
|
||||
|
||||
TracerType type() const override { return TracerType::NETWORK_LOSSY; }
|
||||
|
||||
|
@ -431,7 +431,9 @@ private:
|
|||
|
||||
ITracer* g_tracer = new NoopTracer();
|
||||
|
||||
#ifdef NO_INTELLISENSE
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
void openTracer(TracerType type) {
|
||||
if (g_tracer->type() == type) {
|
||||
|
|
|
@ -29,15 +29,15 @@
|
|||
#include "flow/Trace.h"
|
||||
|
||||
struct XmlTraceLogFormatter : public ITraceLogFormatter, ReferenceCounted<XmlTraceLogFormatter> {
|
||||
void addref();
|
||||
void delref();
|
||||
void addref() override;
|
||||
void delref() override;
|
||||
|
||||
const char* getExtension();
|
||||
const char* getHeader();
|
||||
const char* getFooter();
|
||||
const char* getExtension() override;
|
||||
const char* getHeader() override;
|
||||
const char* getFooter() override;
|
||||
|
||||
void escape(std::stringstream &ss, std::string source);
|
||||
std::string formatEvent(const TraceEventFields &fields);
|
||||
std::string formatEvent(const TraceEventFields& fields) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
22
flow/flow.h
22
flow/flow.h
|
@ -641,9 +641,9 @@ struct NotifiedQueue : private SingleCallback<T>, FastAllocated<NotifiedQueue<T>
|
|||
ASSERT(SingleCallback<T>::next == this);
|
||||
cb->insert(this);
|
||||
}
|
||||
virtual void unwait() override { delFutureRef(); }
|
||||
virtual void fire(T const&) override { ASSERT(false); }
|
||||
virtual void fire(T&&) override { ASSERT(false); }
|
||||
void unwait() override { delFutureRef(); }
|
||||
void fire(T const&) override { ASSERT(false); }
|
||||
void fire(T&&) override { ASSERT(false); }
|
||||
};
|
||||
|
||||
|
||||
|
@ -1004,21 +1004,15 @@ struct Actor<void> {
|
|||
|
||||
template <class ActorType, int CallbackNumber, class ValueType>
|
||||
struct ActorCallback : Callback<ValueType> {
|
||||
virtual void fire(ValueType const& value) override { static_cast<ActorType*>(this)->a_callback_fire(this, value); }
|
||||
virtual void error(Error e) override { static_cast<ActorType*>(this)->a_callback_error(this, e); }
|
||||
void fire(ValueType const& value) override { static_cast<ActorType*>(this)->a_callback_fire(this, value); }
|
||||
void error(Error e) override { static_cast<ActorType*>(this)->a_callback_error(this, e); }
|
||||
};
|
||||
|
||||
template <class ActorType, int CallbackNumber, class ValueType>
|
||||
struct ActorSingleCallback : SingleCallback<ValueType> {
|
||||
virtual void fire(ValueType const& value) override {
|
||||
static_cast<ActorType*>(this)->a_callback_fire(this, value);
|
||||
}
|
||||
virtual void fire(ValueType && value) override {
|
||||
static_cast<ActorType*>(this)->a_callback_fire(this, std::move(value));
|
||||
}
|
||||
virtual void error(Error e) override {
|
||||
static_cast<ActorType*>(this)->a_callback_error(this, e);
|
||||
}
|
||||
void fire(ValueType const& value) override { static_cast<ActorType*>(this)->a_callback_fire(this, value); }
|
||||
void fire(ValueType&& value) override { static_cast<ActorType*>(this)->a_callback_fire(this, std::move(value)); }
|
||||
void error(Error e) override { static_cast<ActorType*>(this)->a_callback_error(this, e); }
|
||||
};
|
||||
inline double now() { return g_network->now(); }
|
||||
inline Future<Void> delay(double seconds, TaskPriority taskID = TaskPriority::DefaultDelay) { return g_network->delay(seconds, taskID); }
|
||||
|
|
|
@ -899,12 +899,12 @@ struct Quorum : SAV<Void> {
|
|||
return sizeof(Quorum<T>) + sizeof(QuorumCallback<T>)*count;
|
||||
}
|
||||
|
||||
virtual void destroy() {
|
||||
void destroy() override {
|
||||
int size = sizeFor(this->count);
|
||||
this->~Quorum();
|
||||
freeFast(size, this);
|
||||
}
|
||||
virtual void cancel() {
|
||||
void cancel() override {
|
||||
int cancelled_callbacks = 0;
|
||||
for (int i = 0; i < count; i++)
|
||||
if (callbacks()[i].next) {
|
||||
|
@ -939,12 +939,12 @@ struct Quorum : SAV<Void> {
|
|||
template <class T>
|
||||
class QuorumCallback : public Callback<T> {
|
||||
public:
|
||||
virtual void fire(const T& value) {
|
||||
void fire(const T& value) override {
|
||||
Callback<T>::remove();
|
||||
Callback<T>::next = 0;
|
||||
head->oneSuccess();
|
||||
}
|
||||
virtual void error(Error error) {
|
||||
void error(Error error) override {
|
||||
Callback<T>::remove();
|
||||
Callback<T>::next = 0;
|
||||
head->oneError(error);
|
||||
|
@ -1482,16 +1482,13 @@ struct YieldedFutureActor : SAV<Void>, ActorCallback<YieldedFutureActor, 1, Void
|
|||
f.addYieldedCallbackAndClear(static_cast< ActorCallback< YieldedFutureActor, 1, Void >* >(this));
|
||||
}
|
||||
|
||||
void cancel()
|
||||
{
|
||||
void cancel() override {
|
||||
if (!SAV<Void>::canBeSet()) return; // Cancel could be invoked *by* a callback within finish(). Otherwise it's guaranteed that we are waiting either on the original future or on a delay().
|
||||
ActorCallback<YieldedFutureActor, 1, Void>::remove();
|
||||
SAV<Void>::sendErrorAndDelPromiseRef(actor_cancelled());
|
||||
}
|
||||
|
||||
virtual void destroy() {
|
||||
delete this;
|
||||
}
|
||||
void destroy() override { delete this; }
|
||||
|
||||
void a_callback_fire(ActorCallback<YieldedFutureActor, 1, Void>*, Void) {
|
||||
if (int16_t(in_error_state.code()) == UNSET_ERROR_CODE) {
|
||||
|
@ -1549,7 +1546,7 @@ inline Future<Void> yieldedFuture(Future<Void> f) {
|
|||
template <class K, class V>
|
||||
class YieldedAsyncMap : public AsyncMap<K, V> {
|
||||
public:
|
||||
Future<Void> onChange(K const& k) { // throws broken_promise if this is destroyed
|
||||
Future<Void> onChange(K const& k) override { // throws broken_promise if this is destroyed
|
||||
auto &item = AsyncMap<K, V>::items[k];
|
||||
if (item.value == AsyncMap<K, V>::defaultValue)
|
||||
return destroyOnCancelYield(this, k, item.change.getFuture());
|
||||
|
|
|
@ -832,7 +832,7 @@ struct ISerializeSource {
|
|||
template <class T, class V>
|
||||
struct MakeSerializeSource : ISerializeSource {
|
||||
using value_type = V;
|
||||
virtual void serializePacketWriter(PacketWriter& w) const {
|
||||
void serializePacketWriter(PacketWriter& w) const override {
|
||||
ObjectWriter writer([&](size_t size) { return w.writeBytes(size); }, AssumeVersion(w.protocolVersion()));
|
||||
writer.serialize(get()); // Writes directly into buffer supplied by |w|
|
||||
}
|
||||
|
@ -844,10 +844,8 @@ struct SerializeSource : MakeSerializeSource<SerializeSource<T>, T> {
|
|||
using value_type = T;
|
||||
T const& value;
|
||||
SerializeSource(T const& value) : value(value) {}
|
||||
virtual void serializeObjectWriter(ObjectWriter& w) const {
|
||||
w.serialize(value);
|
||||
}
|
||||
virtual T const& get() const { return value; }
|
||||
void serializeObjectWriter(ObjectWriter& w) const override { w.serialize(value); }
|
||||
T const& get() const override { return value; }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue