|
|
@ -24,7 +24,7 @@ class CompactorCommand : public LDBCommand { |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
bool null_from_; |
|
|
|
bool null_from_; |
|
|
@ -43,7 +43,7 @@ class DBFileDumperCommand : public LDBCommand { |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
bool decode_blob_index_; |
|
|
|
bool decode_blob_index_; |
|
|
@ -61,7 +61,7 @@ class DBLiveFilesMetadataDumperCommand : public LDBCommand { |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
bool sort_by_filename_; |
|
|
|
bool sort_by_filename_; |
|
|
@ -79,7 +79,7 @@ class DBDumperCommand : public LDBCommand { |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -127,7 +127,7 @@ class InternalDumpCommand : public LDBCommand { |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
bool has_from_; |
|
|
|
bool has_from_; |
|
|
@ -160,9 +160,10 @@ class DBLoaderCommand : public LDBCommand { |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
virtual void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual void OverrideBaseOptions() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void OverrideBaseOptions() override; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
bool disable_wal_; |
|
|
|
bool disable_wal_; |
|
|
@ -183,9 +184,10 @@ class ManifestDumpCommand : public LDBCommand { |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
virtual void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return true; } |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool NoDBOpen() override { return true; } |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
bool verbose_; |
|
|
|
bool verbose_; |
|
|
@ -263,9 +265,10 @@ class ListColumnFamiliesCommand : public LDBCommand { |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
virtual void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return true; } |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool NoDBOpen() override { return true; } |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
class CreateColumnFamilyCommand : public LDBCommand { |
|
|
|
class CreateColumnFamilyCommand : public LDBCommand { |
|
|
@ -277,9 +280,10 @@ class CreateColumnFamilyCommand : public LDBCommand { |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
virtual void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return false; } |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool NoDBOpen() override { return false; } |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
std::string new_cf_name_; |
|
|
|
std::string new_cf_name_; |
|
|
@ -294,9 +298,10 @@ class DropColumnFamilyCommand : public LDBCommand { |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
virtual void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return false; } |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool NoDBOpen() override { return false; } |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
std::string cf_name_to_drop_; |
|
|
|
std::string cf_name_to_drop_; |
|
|
@ -310,11 +315,11 @@ class ReduceDBLevelsCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void OverrideBaseCFOptions(ColumnFamilyOptions* cf_opts) override; |
|
|
|
void OverrideBaseCFOptions(ColumnFamilyOptions* cf_opts) override; |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return true; } |
|
|
|
bool NoDBOpen() override { return true; } |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& msg); |
|
|
|
static void Help(std::string& msg); |
|
|
|
|
|
|
|
|
|
|
@ -342,9 +347,9 @@ class ChangeCompactionStyleCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void OverrideBaseCFOptions(ColumnFamilyOptions* cf_opts) override; |
|
|
|
void OverrideBaseCFOptions(ColumnFamilyOptions* cf_opts) override; |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& msg); |
|
|
|
static void Help(std::string& msg); |
|
|
|
|
|
|
|
|
|
|
@ -364,10 +369,11 @@ class WALDumperCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return true; } |
|
|
|
bool NoDBOpen() override { return true; } |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
virtual void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
bool print_header_; |
|
|
|
bool print_header_; |
|
|
@ -389,7 +395,7 @@ class GetCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
@ -405,7 +411,7 @@ class ApproxSizeCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
@ -422,11 +428,11 @@ class BatchPutCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
|
virtual void OverrideBaseOptions() override; |
|
|
|
void OverrideBaseOptions() override; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -443,7 +449,7 @@ class ScanCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
@ -464,7 +470,23 @@ class DeleteCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
|
|
|
std::string key_; |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class SingleDeleteCommand : public LDBCommand { |
|
|
|
|
|
|
|
public: |
|
|
|
|
|
|
|
static std::string Name() { return "singledelete"; } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SingleDeleteCommand(const std::vector<std::string>& params, |
|
|
|
|
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
|
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
@ -480,7 +502,7 @@ class DeleteRangeCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
@ -497,11 +519,11 @@ class PutCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
|
virtual void OverrideBaseOptions() override; |
|
|
|
void OverrideBaseOptions() override; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
std::string key_; |
|
|
|
std::string key_; |
|
|
@ -522,7 +544,7 @@ class DBQuerierCommand : public LDBCommand { |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
static const char* HELP_CMD; |
|
|
|
static const char* HELP_CMD; |
|
|
@ -539,9 +561,9 @@ class CheckConsistencyCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return true; } |
|
|
|
bool NoDBOpen() override { return true; } |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -554,7 +576,7 @@ class CheckPointCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
@ -571,11 +593,11 @@ class RepairCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return true; } |
|
|
|
bool NoDBOpen() override { return true; } |
|
|
|
|
|
|
|
|
|
|
|
virtual void OverrideBaseOptions() override; |
|
|
|
void OverrideBaseOptions() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
@ -615,7 +637,7 @@ class BackupCommand : public BackupEngineCommand { |
|
|
|
BackupCommand(const std::vector<std::string>& params, |
|
|
|
BackupCommand(const std::vector<std::string>& params, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -625,8 +647,8 @@ class RestoreCommand : public BackupEngineCommand { |
|
|
|
RestoreCommand(const std::vector<std::string>& params, |
|
|
|
RestoreCommand(const std::vector<std::string>& params, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
virtual bool NoDBOpen() override { return true; } |
|
|
|
bool NoDBOpen() override { return true; } |
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -638,11 +660,11 @@ class WriteExternalSstFilesCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return false; } |
|
|
|
bool NoDBOpen() override { return false; } |
|
|
|
|
|
|
|
|
|
|
|
virtual void OverrideBaseOptions() override; |
|
|
|
void OverrideBaseOptions() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
@ -658,11 +680,11 @@ class IngestExternalSstFilesCommand : public LDBCommand { |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::map<std::string, std::string>& options, |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
const std::vector<std::string>& flags); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return false; } |
|
|
|
bool NoDBOpen() override { return false; } |
|
|
|
|
|
|
|
|
|
|
|
virtual void OverrideBaseOptions() override; |
|
|
|
void OverrideBaseOptions() override; |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
@ -710,9 +732,9 @@ class UnsafeRemoveSstFileCommand : public LDBCommand { |
|
|
|
|
|
|
|
|
|
|
|
static void Help(std::string& ret); |
|
|
|
static void Help(std::string& ret); |
|
|
|
|
|
|
|
|
|
|
|
virtual void DoCommand() override; |
|
|
|
void DoCommand() override; |
|
|
|
|
|
|
|
|
|
|
|
virtual bool NoDBOpen() override { return true; } |
|
|
|
bool NoDBOpen() override { return true; } |
|
|
|
|
|
|
|
|
|
|
|
private: |
|
|
|
private: |
|
|
|
uint64_t sst_file_number_; |
|
|
|
uint64_t sst_file_number_; |
|
|
|