rippled
ShardArchive.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2021 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #ifndef RIPPLE_APP_RDB_SHARDARCHIVE_H_INCLUDED
21 #define RIPPLE_APP_RDB_SHARDARCHIVE_H_INCLUDED
22 
23 #include <ripple/core/DatabaseCon.h>
24 #include <boost/filesystem.hpp>
25 
26 namespace ripple {
27 
36 makeArchiveDB(boost::filesystem::path const& dir, std::string const& dbName);
37 
44 void
46  DatabaseCon& db,
47  std::function<void(std::string const&, int)> const& func);
48 
55 void
57  DatabaseCon& db,
58  std::uint32_t shardIndex,
59  std::string const& url);
60 
66 void
67 deleteFromArchiveDB(DatabaseCon& db, std::uint32_t shardIndex);
68 
73 void
74 dropArchiveDB(DatabaseCon& db);
75 
76 } // namespace ripple
77 
78 #endif
std::string
STL class.
std::function
ripple::deleteFromArchiveDB
void deleteFromArchiveDB(DatabaseCon &db, std::uint32_t shardIndex)
deleteFromArchiveDB Deletes an entry from the shard archive database.
Definition: ShardArchive.cpp:56
ripple::dropArchiveDB
void dropArchiveDB(DatabaseCon &db)
dropArchiveDB Removes a table in the shard archive database.
Definition: ShardArchive.cpp:63
std::uint32_t
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::readArchiveDB
void readArchiveDB(DatabaseCon &db, std::function< void(std::string const &, int)> const &func)
readArchiveDB Reads entries from the shard archive database and invokes the given callback for each e...
Definition: ShardArchive.cpp:32
ripple::insertArchiveDB
void insertArchiveDB(DatabaseCon &db, std::uint32_t shardIndex, std::string const &url)
insertArchiveDB Adds an entry to the shard archive database.
Definition: ShardArchive.cpp:46
ripple::makeArchiveDB
std::unique_ptr< DatabaseCon > makeArchiveDB(boost::filesystem::path const &dir, std::string const &dbName)
makeArchiveDB Opens the shard archive database and returns its descriptor.
Definition: ShardArchive.cpp:25
std::unique_ptr
STL class.