mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Refactor NodeStore
This commit is contained in:
@@ -3,6 +3,19 @@
|
||||
Copyright (c) 2011-2013, OpenCoin, Inc.
|
||||
*/
|
||||
//==============================================================================
|
||||
/*
|
||||
|
||||
TODO
|
||||
|
||||
- Check consistency / range checking on read
|
||||
|
||||
- Cache top level tree nodes
|
||||
|
||||
- Coalesce I/O in RandomAccessFile
|
||||
|
||||
- Delete / file compaction
|
||||
|
||||
*/
|
||||
|
||||
class KeyvaDBImp : public KeyvaDB
|
||||
{
|
||||
@@ -336,10 +349,10 @@ public:
|
||||
|
||||
bool get (void const* key, GetCallback* callback)
|
||||
{
|
||||
// VFALCO TODD Swap these two lines
|
||||
SharedState::WriteAccess state (m_state);
|
||||
FindResult findResult (m_keyStorage.getData ());
|
||||
|
||||
SharedState::WriteAccess state (m_state);
|
||||
|
||||
bool found = false;
|
||||
|
||||
if (state->hasKeys ())
|
||||
@@ -348,7 +361,7 @@ public:
|
||||
|
||||
if (found)
|
||||
{
|
||||
void* const destStorage = callback->createStorageForValue (findResult.keyRecord.valSize);
|
||||
void* const destStorage = callback->getStorageForValue (findResult.keyRecord.valSize);
|
||||
|
||||
RandomAccessFileInputStream stream (state->valFile);
|
||||
|
||||
@@ -536,7 +549,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
void* createStorageForValue (int valueBytes)
|
||||
void* getStorageForValue (int valueBytes)
|
||||
{
|
||||
bassert (valueBytes <= maxPayloadBytes);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user