rippled
|
DeterministicShard class. More...
Public Member Functions | |
~DeterministicShard () | |
void | close () |
Finalizes and closes the shard. More... | |
boost::filesystem::path const & | getDir () const |
bool | store (std::shared_ptr< NodeObject > const &nodeObject) |
Store a node object in memory. More... | |
Private Member Functions | |
DeterministicShard (DeterministicShard const &)=delete | |
DeterministicShard & | operator= (DeterministicShard const &)=delete |
DeterministicShard (Application &app, boost::filesystem::path const &dir, std::uint32_t index, beast::Journal j) | |
Creates the object for shard database. More... | |
bool | init (Serializer const &finalKey) |
Initializes the deterministic shard. More... | |
void | close (bool cancel) |
Finalizes and closes the shard. More... | |
Private Attributes | |
Application & | app_ |
const std::uint32_t | index_ |
const boost::filesystem::path | dir_ |
DummyScheduler | scheduler_ |
std::unique_ptr< nudb::context > | ctx_ |
std::shared_ptr< Backend > | backend_ |
const beast::Journal | j_ |
std::uint32_t | curMemObjs_ |
const std::uint32_t | maxMemObjs_ |
Static Private Attributes | |
constexpr static std::uint32_t | maxMemObjsDefault = 16384u |
constexpr static std::uint32_t | maxMemObjsTest = 16u |
constexpr static std::uint64_t | deterministicType = 0x5348524400000000ll |
Friends | |
std::shared_ptr< DeterministicShard > | make_DeterministicShard (Application &app, boost::filesystem::path const &shardDir, std::uint32_t shardIndex, Serializer const &finalKey, beast::Journal j) |
Creates shared pointer to deterministic shard and initializes it. More... | |
DeterministicShard class.
Definition at line 40 of file DeterministicShard.h.
|
privatedelete |
|
private |
Creates the object for shard database.
app | Application object |
dir | Directory where shard is located |
index | Index of the shard |
j | Journal to logging |
Definition at line 35 of file DeterministicShard.cpp.
ripple::NodeStore::DeterministicShard::~DeterministicShard | ( | ) |
Definition at line 52 of file DeterministicShard.cpp.
|
privatedelete |
|
private |
Initializes the deterministic shard.
finalKey | Serializer of shard's final key which consists of: shard version (32 bit) first ledger sequence in the shard (32 bit) last ledger sequence in the shard (32 bit) hash of last ledger (256 bits) |
Definition at line 58 of file DeterministicShard.cpp.
void ripple::NodeStore::DeterministicShard::close | ( | ) |
Finalizes and closes the shard.
Definition at line 84 of file DeterministicShard.h.
boost::filesystem::path const& ripple::NodeStore::DeterministicShard::getDir | ( | ) | const |
Definition at line 90 of file DeterministicShard.h.
bool ripple::NodeStore::DeterministicShard::store | ( | std::shared_ptr< NodeObject > const & | nodeObject | ) |
Store a node object in memory.
nodeObject | The node object to store |
Definition at line 191 of file DeterministicShard.cpp.
|
private |
Finalizes and closes the shard.
cancel | True if reject the shard and delete all files, false if finalize the shard and store them |
Definition at line 166 of file DeterministicShard.cpp.
|
friend |
Creates shared pointer to deterministic shard and initializes it.
app | Application object |
shardDir | Directory where shard is located |
shardIndex | Index of the shard |
finalKey | Serializer of shard's ginal key which consists of: shard version (32 bit) first ledger sequence in the shard (32 bit) last ledger sequence in the shard (32 bit) hash of last ledger (256 bits) |
j | Journal to logging |
Definition at line 151 of file DeterministicShard.cpp.
|
staticconstexprprivate |
Definition at line 42 of file DeterministicShard.h.
|
staticconstexprprivate |
Definition at line 43 of file DeterministicShard.h.
|
staticconstexprprivate |
Definition at line 46 of file DeterministicShard.h.
|
private |
Definition at line 115 of file DeterministicShard.h.
|
private |
Definition at line 118 of file DeterministicShard.h.
|
private |
Definition at line 121 of file DeterministicShard.h.
|
private |
Definition at line 124 of file DeterministicShard.h.
|
private |
Definition at line 127 of file DeterministicShard.h.
|
private |
Definition at line 130 of file DeterministicShard.h.
|
private |
Definition at line 133 of file DeterministicShard.h.
|
private |
Definition at line 136 of file DeterministicShard.h.
|
private |
Definition at line 139 of file DeterministicShard.h.