diff --git a/TODO.txt b/TODO.txt index 5621072c5..92fb9272d 100644 --- a/TODO.txt +++ b/TODO.txt @@ -9,6 +9,7 @@ Vinnie's Short List (Changes day to day) - Import beast::db and use it in SQliteBackend - Finish unit tests and code for Validators - Convert some Ripple boost unit tests to Beast. +- Move all code into modules/ -------------------------------------------------------------------------------- diff --git a/modules/ripple_app/node/ripple_NodeStore.cpp b/modules/ripple_app/node/ripple_NodeStore.cpp index 47f660a9f..ea088a07a 100644 --- a/modules/ripple_app/node/ripple_NodeStore.cpp +++ b/modules/ripple_app/node/ripple_NodeStore.cpp @@ -222,6 +222,11 @@ public: { } + String getName () const + { + return m_backend->getName (); + } + //------------------------------------------------------------------------------ NodeObject::Ptr fetch (uint256 const& hash) @@ -436,10 +441,6 @@ public: ScopedPointer srcBackend (createBackend (sourceBackendParameters, m_scheduler)); - WriteLog (lsWARNING, NodeObject) << - "Node import from '" << srcBackend->getName() << "' to '" - << m_backend->getName() << "'."; - ImportVisitCallback callback (*m_backend); srcBackend->visitAll (callback); @@ -736,7 +737,7 @@ public: Batch batch3; createPredictableBatch (batch3, 1, numObjectsToTest, seedValue); - expect (! areBatchesEqual (batch1, batch3), "Should be equal"); + expect (! areBatchesEqual (batch1, batch3), "Should not be equal"); } // Checks encoding/decoding blobs @@ -959,13 +960,13 @@ public: testBackend ("leveldb", seedValue); - #if RIPPLE_HYPERLEVELDB_AVAILABLE + #if RIPPLE_HYPERLEVELDB_AVAILABLE testBackend ("hyperleveldb", seedValue); - #endif + #endif - #if RIPPLE_MDB_AVAILABLE + #if RIPPLE_MDB_AVAILABLE testBackend ("mdb", seedValue); - #endif + #endif testBackend ("sqlite", seedValue); } diff --git a/modules/ripple_app/node/ripple_NodeStore.h b/modules/ripple_app/node/ripple_NodeStore.h index 0202f6017..78784df66 100644 --- a/modules/ripple_app/node/ripple_NodeStore.h +++ b/modules/ripple_app/node/ripple_NodeStore.h @@ -7,51 +7,6 @@ #ifndef RIPPLE_NODESTORE_H_INCLUDED #define RIPPLE_NODESTORE_H_INCLUDED -// Javadoc comments are added to all public classes, member functions, -// type definitions, data types, and global variables (which we should -// minimize the use of. -// -// A Javadoc comment is introduced with an extra asterisk following the -// beginning of a normal C++ style comment, or by using a triple forward slash. -// -// Structure of a Javadoc comment: - -/** Brief one line description. - - A more detailed description, which may be broken up into multiple - paragraphs. Doxygen commands are prefixed with the at-sign '@'. For - example, here's a formatted code snippet: - - @code - - int main (int argc, char** argv) - { - return 0; - } - - @endcode - - You can also add a note, or document an invariant: - - @note This appears as its own note. - - @invariant This must not be called while holding the lock. - - When documenting functions, you can use these Doxygen commands - to annotate the parameters, return value, template types. - - @param argc The number of arguments to the program. - @param argv An array of strings argc in size, one for each argument. - - @return The return value of the program, passed to to the enclosing process. -*/ - -/** Functions can be documented with just the brief description, like this */ - -/// Here's the alternate form of a brief description. - -//------------------------------------------------------------------------------ - /** Persistency layer for NodeObject A Node is a ledger object which is uniquely identified by a key, which is @@ -379,6 +334,13 @@ public: */ virtual ~NodeStore () { } + /** Retrieve the name associated with this backend. + + This is used for diagnostics and may not reflect the actual path + or paths used by the underlying backend. + */ + virtual String getName () const = 0; + /** Add the specified backend factory to the list of available factories. The names of available factories are compared against the "type" diff --git a/src/cpp/ripple/ripple_Application.cpp b/src/cpp/ripple/ripple_Application.cpp index 42307dc85..bbef76305 100644 --- a/src/cpp/ripple/ripple_Application.cpp +++ b/src/cpp/ripple/ripple_Application.cpp @@ -981,7 +981,13 @@ void ApplicationImp::updateTables () } if (!theConfig.DB_IMPORT.empty()) + { + WriteLog (lsWARNING, NodeObject) << + "Node import from '" << theConfig.DB_IMPORT << "' to '" + << getApp().getNodeStore().getName () << "'."; + getApp().getNodeStore().import(theConfig.DB_IMPORT); + } } //------------------------------------------------------------------------------