Move log message up to caller of import

This commit is contained in:
Vinnie Falco
2013-07-22 08:44:27 -07:00
parent d60fc410ae
commit 061865a5da
4 changed files with 24 additions and 54 deletions

View File

@@ -9,6 +9,7 @@ Vinnie's Short List (Changes day to day)
- Import beast::db and use it in SQliteBackend - Import beast::db and use it in SQliteBackend
- Finish unit tests and code for Validators - Finish unit tests and code for Validators
- Convert some Ripple boost unit tests to Beast. - Convert some Ripple boost unit tests to Beast.
- Move all code into modules/
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@@ -222,6 +222,11 @@ public:
{ {
} }
String getName () const
{
return m_backend->getName ();
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
NodeObject::Ptr fetch (uint256 const& hash) NodeObject::Ptr fetch (uint256 const& hash)
@@ -436,10 +441,6 @@ public:
ScopedPointer <Backend> srcBackend (createBackend (sourceBackendParameters, m_scheduler)); ScopedPointer <Backend> srcBackend (createBackend (sourceBackendParameters, m_scheduler));
WriteLog (lsWARNING, NodeObject) <<
"Node import from '" << srcBackend->getName() << "' to '"
<< m_backend->getName() << "'.";
ImportVisitCallback callback (*m_backend); ImportVisitCallback callback (*m_backend);
srcBackend->visitAll (callback); srcBackend->visitAll (callback);
@@ -736,7 +737,7 @@ public:
Batch batch3; Batch batch3;
createPredictableBatch (batch3, 1, numObjectsToTest, seedValue); createPredictableBatch (batch3, 1, numObjectsToTest, seedValue);
expect (! areBatchesEqual (batch1, batch3), "Should be equal"); expect (! areBatchesEqual (batch1, batch3), "Should not be equal");
} }
// Checks encoding/decoding blobs // Checks encoding/decoding blobs
@@ -959,13 +960,13 @@ public:
testBackend ("leveldb", seedValue); testBackend ("leveldb", seedValue);
#if RIPPLE_HYPERLEVELDB_AVAILABLE #if RIPPLE_HYPERLEVELDB_AVAILABLE
testBackend ("hyperleveldb", seedValue); testBackend ("hyperleveldb", seedValue);
#endif #endif
#if RIPPLE_MDB_AVAILABLE #if RIPPLE_MDB_AVAILABLE
testBackend ("mdb", seedValue); testBackend ("mdb", seedValue);
#endif #endif
testBackend ("sqlite", seedValue); testBackend ("sqlite", seedValue);
} }

View File

@@ -7,51 +7,6 @@
#ifndef RIPPLE_NODESTORE_H_INCLUDED #ifndef RIPPLE_NODESTORE_H_INCLUDED
#define 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 /** Persistency layer for NodeObject
A Node is a ledger object which is uniquely identified by a key, which is A Node is a ledger object which is uniquely identified by a key, which is
@@ -379,6 +334,13 @@ public:
*/ */
virtual ~NodeStore () { } 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. /** Add the specified backend factory to the list of available factories.
The names of available factories are compared against the "type" The names of available factories are compared against the "type"

View File

@@ -981,7 +981,13 @@ void ApplicationImp::updateTables ()
} }
if (!theConfig.DB_IMPORT.empty()) if (!theConfig.DB_IMPORT.empty())
{
WriteLog (lsWARNING, NodeObject) <<
"Node import from '" << theConfig.DB_IMPORT << "' to '"
<< getApp().getNodeStore().getName () << "'.";
getApp().getNodeStore().import(theConfig.DB_IMPORT); getApp().getNodeStore().import(theConfig.DB_IMPORT);
}
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------