|
|
@ -8,9 +8,49 @@ |
|
|
|
#include "rocksdb/utilities/debug.h" |
|
|
|
#include "rocksdb/utilities/debug.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "db/db_impl/db_impl.h" |
|
|
|
#include "db/db_impl/db_impl.h" |
|
|
|
|
|
|
|
#include "rocksdb/utilities/options_type.h" |
|
|
|
|
|
|
|
|
|
|
|
namespace ROCKSDB_NAMESPACE { |
|
|
|
namespace ROCKSDB_NAMESPACE { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static std::unordered_map<std::string, ValueType> value_type_string_map = { |
|
|
|
|
|
|
|
{"TypeDeletion", ValueType::kTypeDeletion}, |
|
|
|
|
|
|
|
{"TypeValue", ValueType::kTypeValue}, |
|
|
|
|
|
|
|
{"TypeMerge", ValueType::kTypeMerge}, |
|
|
|
|
|
|
|
{"TypeLogData", ValueType::kTypeLogData}, |
|
|
|
|
|
|
|
{"TypeColumnFamilyDeletion", ValueType::kTypeColumnFamilyDeletion}, |
|
|
|
|
|
|
|
{"TypeColumnFamilyValue", ValueType::kTypeColumnFamilyValue}, |
|
|
|
|
|
|
|
{"TypeColumnFamilyMerge", ValueType::kTypeColumnFamilyMerge}, |
|
|
|
|
|
|
|
{"TypeSingleDeletion", ValueType::kTypeSingleDeletion}, |
|
|
|
|
|
|
|
{"TypeColumnFamilySingleDeletion", |
|
|
|
|
|
|
|
ValueType::kTypeColumnFamilySingleDeletion}, |
|
|
|
|
|
|
|
{"TypeBeginPrepareXID", ValueType::kTypeBeginPrepareXID}, |
|
|
|
|
|
|
|
{"TypeEndPrepareXID", ValueType::kTypeEndPrepareXID}, |
|
|
|
|
|
|
|
{"TypeCommitXID", ValueType::kTypeCommitXID}, |
|
|
|
|
|
|
|
{"TypeRollbackXID", ValueType::kTypeRollbackXID}, |
|
|
|
|
|
|
|
{"TypeNoop", ValueType::kTypeNoop}, |
|
|
|
|
|
|
|
{"TypeColumnFamilyRangeDeletion", |
|
|
|
|
|
|
|
ValueType::kTypeColumnFamilyRangeDeletion}, |
|
|
|
|
|
|
|
{"TypeRangeDeletion", ValueType::kTypeRangeDeletion}, |
|
|
|
|
|
|
|
{"TypeColumnFamilyBlobIndex", ValueType::kTypeColumnFamilyBlobIndex}, |
|
|
|
|
|
|
|
{"TypeBlobIndex", ValueType::kTypeBlobIndex}, |
|
|
|
|
|
|
|
{"TypeBeginPersistedPrepareXID", ValueType::kTypeBeginPersistedPrepareXID}, |
|
|
|
|
|
|
|
{"TypeBeginUnprepareXID", ValueType::kTypeBeginUnprepareXID}, |
|
|
|
|
|
|
|
{"TypeDeletionWithTimestamp", ValueType::kTypeDeletionWithTimestamp}, |
|
|
|
|
|
|
|
{"TypeCommitXIDAndTimestamp", ValueType::kTypeCommitXIDAndTimestamp}, |
|
|
|
|
|
|
|
{"TypeWideColumnEntity", ValueType::kTypeWideColumnEntity}, |
|
|
|
|
|
|
|
{"TypeColumnFamilyWideColumnEntity", |
|
|
|
|
|
|
|
ValueType::kTypeColumnFamilyWideColumnEntity}}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string KeyVersion::GetTypeName() const { |
|
|
|
|
|
|
|
std::string type_name; |
|
|
|
|
|
|
|
if (SerializeEnum<ValueType>(value_type_string_map, |
|
|
|
|
|
|
|
static_cast<ValueType>(type), &type_name)) { |
|
|
|
|
|
|
|
return type_name; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return "Invalid"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Status GetAllKeyVersions(DB* db, Slice begin_key, Slice end_key, |
|
|
|
Status GetAllKeyVersions(DB* db, Slice begin_key, Slice end_key, |
|
|
|
size_t max_num_ikeys, |
|
|
|
size_t max_num_ikeys, |
|
|
|
std::vector<KeyVersion>* key_versions) { |
|
|
|
std::vector<KeyVersion>* key_versions) { |
|
|
|