|
|
|
@ -74,12 +74,12 @@ public:
|
|
|
|
|
{
|
|
|
|
|
ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
|
|
|
|
|
ssKey << key;
|
|
|
|
|
leveldb::Slice slKey(ssKey.data(), ssKey.size());
|
|
|
|
|
leveldb::Slice slKey((const char*)ssKey.data(), ssKey.size());
|
|
|
|
|
|
|
|
|
|
ssValue.reserve(DBWRAPPER_PREALLOC_VALUE_SIZE);
|
|
|
|
|
ssValue << value;
|
|
|
|
|
ssValue.Xor(dbwrapper_private::GetObfuscateKey(parent));
|
|
|
|
|
leveldb::Slice slValue(ssValue.data(), ssValue.size());
|
|
|
|
|
leveldb::Slice slValue((const char*)ssValue.data(), ssValue.size());
|
|
|
|
|
|
|
|
|
|
batch.Put(slKey, slValue);
|
|
|
|
|
// LevelDB serializes writes as:
|
|
|
|
@ -99,7 +99,7 @@ public:
|
|
|
|
|
{
|
|
|
|
|
ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
|
|
|
|
|
ssKey << key;
|
|
|
|
|
leveldb::Slice slKey(ssKey.data(), ssKey.size());
|
|
|
|
|
leveldb::Slice slKey((const char*)ssKey.data(), ssKey.size());
|
|
|
|
|
|
|
|
|
|
batch.Delete(slKey);
|
|
|
|
|
// LevelDB serializes erases as:
|
|
|
|
@ -138,7 +138,7 @@ public:
|
|
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
|
|
|
|
|
ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
|
|
|
|
|
ssKey << key;
|
|
|
|
|
leveldb::Slice slKey(ssKey.data(), ssKey.size());
|
|
|
|
|
leveldb::Slice slKey((const char*)ssKey.data(), ssKey.size());
|
|
|
|
|
piter->Seek(slKey);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -233,7 +233,7 @@ public:
|
|
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
|
|
|
|
|
ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
|
|
|
|
|
ssKey << key;
|
|
|
|
|
leveldb::Slice slKey(ssKey.data(), ssKey.size());
|
|
|
|
|
leveldb::Slice slKey((const char*)ssKey.data(), ssKey.size());
|
|
|
|
|
|
|
|
|
|
std::string strValue;
|
|
|
|
|
leveldb::Status status = pdb->Get(readoptions, slKey, &strValue);
|
|
|
|
@ -267,7 +267,7 @@ public:
|
|
|
|
|
CDataStream ssKey(SER_DISK, CLIENT_VERSION);
|
|
|
|
|
ssKey.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
|
|
|
|
|
ssKey << key;
|
|
|
|
|
leveldb::Slice slKey(ssKey.data(), ssKey.size());
|
|
|
|
|
leveldb::Slice slKey((const char*)ssKey.data(), ssKey.size());
|
|
|
|
|
|
|
|
|
|
std::string strValue;
|
|
|
|
|
leveldb::Status status = pdb->Get(readoptions, slKey, &strValue);
|
|
|
|
@ -311,8 +311,8 @@ public:
|
|
|
|
|
ssKey2.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
|
|
|
|
|
ssKey1 << key_begin;
|
|
|
|
|
ssKey2 << key_end;
|
|
|
|
|
leveldb::Slice slKey1(ssKey1.data(), ssKey1.size());
|
|
|
|
|
leveldb::Slice slKey2(ssKey2.data(), ssKey2.size());
|
|
|
|
|
leveldb::Slice slKey1((const char*)ssKey1.data(), ssKey1.size());
|
|
|
|
|
leveldb::Slice slKey2((const char*)ssKey2.data(), ssKey2.size());
|
|
|
|
|
uint64_t size = 0;
|
|
|
|
|
leveldb::Range range(slKey1, slKey2);
|
|
|
|
|
pdb->GetApproximateSizes(&range, 1, &size);
|
|
|
|
@ -330,8 +330,8 @@ public:
|
|
|
|
|
ssKey2.reserve(DBWRAPPER_PREALLOC_KEY_SIZE);
|
|
|
|
|
ssKey1 << key_begin;
|
|
|
|
|
ssKey2 << key_end;
|
|
|
|
|
leveldb::Slice slKey1(ssKey1.data(), ssKey1.size());
|
|
|
|
|
leveldb::Slice slKey2(ssKey2.data(), ssKey2.size());
|
|
|
|
|
leveldb::Slice slKey1((const char*)ssKey1.data(), ssKey1.size());
|
|
|
|
|
leveldb::Slice slKey2((const char*)ssKey2.data(), ssKey2.size());
|
|
|
|
|
pdb->CompactRange(&slKey1, &slKey2);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|