|
| SHAMap ()=delete |
|
| SHAMap (SHAMap const &)=delete |
|
SHAMap & | operator= (SHAMap const &)=delete |
|
| SHAMap (SHAMap const &other, bool isMutable) |
|
| SHAMap (SHAMapType t, Family &f) |
|
| SHAMap (SHAMapType t, uint256 const &hash, Family &f) |
|
| ~SHAMap ()=default |
|
Family const & | family () const |
|
Family & | family () |
|
const_iterator | begin () const |
|
const_iterator | end () const |
|
std::shared_ptr< SHAMap > | snapShot (bool isMutable) const |
|
void | setFull () |
|
void | setLedgerSeq (std::uint32_t lseq) |
|
bool | fetchRoot (SHAMapHash const &hash, SHAMapSyncFilter *filter) |
|
bool | hasItem (uint256 const &id) const |
| Does the tree have an item with the given ID? More...
|
|
bool | delItem (uint256 const &id) |
|
bool | addItem (SHAMapNodeType type, boost::intrusive_ptr< SHAMapItem const > item) |
|
SHAMapHash | getHash () const |
|
bool | updateGiveItem (SHAMapNodeType type, boost::intrusive_ptr< SHAMapItem const > item) |
|
bool | addGiveItem (SHAMapNodeType type, boost::intrusive_ptr< SHAMapItem const > item) |
|
boost::intrusive_ptr< SHAMapItem const > const & | peekItem (uint256 const &id) const |
|
boost::intrusive_ptr< SHAMapItem const > const & | peekItem (uint256 const &id, SHAMapHash &hash) const |
|
const_iterator | upper_bound (uint256 const &id) const |
| Find the first item after the given item. More...
|
|
const_iterator | lower_bound (uint256 const &id) const |
| Find the object with the greatest object id smaller than the input id. More...
|
|
void | visitNodes (std::function< bool(SHAMapTreeNode &)> const &function) const |
| Visit every node in this SHAMap. More...
|
|
void | visitDifferences (SHAMap const *have, std::function< bool(SHAMapTreeNode const &)> const &) const |
| Visit every node in this SHAMap that is not present in the specified SHAMap. More...
|
|
void | visitLeaves (std::function< void(boost::intrusive_ptr< SHAMapItem const > const &)> const &) const |
| Visit every leaf node in this SHAMap. More...
|
|
std::vector< std::pair< SHAMapNodeID, uint256 > > | getMissingNodes (int maxNodes, SHAMapSyncFilter *filter) |
| Check for nodes in the SHAMap not available. More...
|
|
bool | getNodeFat (SHAMapNodeID const &wanted, std::vector< std::pair< SHAMapNodeID, Blob >> &data, bool fatLeaves, std::uint32_t depth) const |
|
std::optional< std::vector< Blob > > | getProofPath (uint256 const &key) const |
| Get the proof path of the key. More...
|
|
void | serializeRoot (Serializer &s) const |
| Serializes the root in a format appropriate for sending over the wire. More...
|
|
SHAMapAddNode | addRootNode (SHAMapHash const &hash, Slice const &rootNode, SHAMapSyncFilter *filter) |
|
SHAMapAddNode | addKnownNode (SHAMapNodeID const &nodeID, Slice const &rawNode, SHAMapSyncFilter *filter) |
|
void | setImmutable () |
|
bool | isSynching () const |
|
void | setSynching () |
|
void | clearSynching () |
|
bool | isValid () const |
|
bool | compare (SHAMap const &otherMap, Delta &differences, int maxCount) const |
|
int | unshare () |
| Convert any modified nodes to shared. More...
|
|
int | flushDirty (NodeObjectType t) |
| Flush modified nodes to the nodestore and convert them to shared. More...
|
|
void | walkMap (std::vector< SHAMapMissingNode > &missingNodes, int maxMissing) const |
|
bool | walkMapParallel (std::vector< SHAMapMissingNode > &missingNodes, int maxMissing) const |
|
bool | deepCompare (SHAMap &other) const |
|
void | setUnbacked () |
|
void | dump (bool withHashes=false) const |
|
void | invariants () const |
|
|
std::shared_ptr< SHAMapTreeNode > | cacheLookup (SHAMapHash const &hash) const |
|
void | canonicalize (SHAMapHash const &hash, std::shared_ptr< SHAMapTreeNode > &) const |
|
std::shared_ptr< SHAMapTreeNode > | fetchNodeFromDB (SHAMapHash const &hash) const |
|
std::shared_ptr< SHAMapTreeNode > | fetchNodeNT (SHAMapHash const &hash) const |
|
std::shared_ptr< SHAMapTreeNode > | fetchNodeNT (SHAMapHash const &hash, SHAMapSyncFilter *filter) const |
|
std::shared_ptr< SHAMapTreeNode > | fetchNode (SHAMapHash const &hash) const |
|
std::shared_ptr< SHAMapTreeNode > | checkFilter (SHAMapHash const &hash, SHAMapSyncFilter *filter) const |
|
void | dirtyUp (SharedPtrNodeStack &stack, uint256 const &target, std::shared_ptr< SHAMapTreeNode > terminal) |
| Update hashes up to the root. More...
|
|
SHAMapLeafNode * | walkTowardsKey (uint256 const &id, SharedPtrNodeStack *stack=nullptr) const |
| Walk towards the specified id, returning the node. More...
|
|
SHAMapLeafNode * | findKey (uint256 const &id) const |
| Return nullptr if key not found. More...
|
|
template<class Node > |
std::shared_ptr< Node > | unshareNode (std::shared_ptr< Node >, SHAMapNodeID const &nodeID) |
| Unshare the node, allowing it to be modified. More...
|
|
template<class Node > |
std::shared_ptr< Node > | preFlushNode (std::shared_ptr< Node > node) const |
| prepare a node to be modified before flushing More...
|
|
std::shared_ptr< SHAMapTreeNode > | writeNode (NodeObjectType t, std::shared_ptr< SHAMapTreeNode > node) const |
| write and canonicalize modified node More...
|
|
SHAMapLeafNode * | firstBelow (std::shared_ptr< SHAMapTreeNode >, SharedPtrNodeStack &stack, int branch=0) const |
|
SHAMapLeafNode * | lastBelow (std::shared_ptr< SHAMapTreeNode > node, SharedPtrNodeStack &stack, int branch=branchFactor) const |
|
SHAMapLeafNode * | belowHelper (std::shared_ptr< SHAMapTreeNode > node, SharedPtrNodeStack &stack, int branch, std::tuple< int, std::function< bool(int)>, std::function< void(int &)>> const &loopParams) const |
|
SHAMapTreeNode * | descend (SHAMapInnerNode *, int branch) const |
|
SHAMapTreeNode * | descendThrow (SHAMapInnerNode *, int branch) const |
|
std::shared_ptr< SHAMapTreeNode > | descend (std::shared_ptr< SHAMapInnerNode > const &, int branch) const |
|
std::shared_ptr< SHAMapTreeNode > | descendThrow (std::shared_ptr< SHAMapInnerNode > const &, int branch) const |
|
SHAMapTreeNode * | descendAsync (SHAMapInnerNode *parent, int branch, SHAMapSyncFilter *filter, bool &pending, descendCallback &&) const |
|
std::pair< SHAMapTreeNode *, SHAMapNodeID > | descend (SHAMapInnerNode *parent, SHAMapNodeID const &parentID, int branch, SHAMapSyncFilter *filter) const |
|
std::shared_ptr< SHAMapTreeNode > | descendNoStore (std::shared_ptr< SHAMapInnerNode > const &, int branch) const |
|
boost::intrusive_ptr< SHAMapItem const > const & | onlyBelow (SHAMapTreeNode *) const |
| If there is only one leaf below this node, get its contents. More...
|
|
bool | hasInnerNode (SHAMapNodeID const &nodeID, SHAMapHash const &hash) const |
| Does this map have this inner node? More...
|
|
bool | hasLeafNode (uint256 const &tag, SHAMapHash const &hash) const |
| Does this map have this leaf node? More...
|
|
SHAMapLeafNode const * | peekFirstItem (SharedPtrNodeStack &stack) const |
|
SHAMapLeafNode const * | peekNextItem (uint256 const &id, SharedPtrNodeStack &stack) const |
|
bool | walkBranch (SHAMapTreeNode *node, boost::intrusive_ptr< SHAMapItem const > const &otherMapItem, bool isFirstMap, Delta &differences, int &maxCount) const |
|
int | walkSubTree (bool doWrite, NodeObjectType t) |
|
void | gmn_ProcessNodes (MissingNodes &, MissingNodes::StackEntry &node) |
|
void | gmn_ProcessDeferredReads (MissingNodes &) |
|
std::shared_ptr< SHAMapTreeNode > | finishFetch (SHAMapHash const &hash, std::shared_ptr< NodeObject > const &object) const |
|
A SHAMap is both a radix tree with a fan-out of 16 and a Merkle tree.
A radix tree is a tree with two properties:
- The key for a node is represented by the node's position in the tree (the "prefix property").
- A node with only one child is merged with that child (the "merge property")
These properties result in a significantly smaller memory footprint for a radix tree.
A fan-out of 16 means that each node in the tree has at most 16 children. See https://en.wikipedia.org/wiki/Radix_tree
A Merkle tree is a tree where each non-leaf node is labelled with the hash of the combined labels of its children nodes.
A key property of a Merkle tree is that testing for node inclusion is O(log(N)) where N is the number of nodes in the tree.
See https://en.wikipedia.org/wiki/Merkle_tree
Definition at line 95 of file SHAMap.h.
Check for nodes in the SHAMap not available.
Get a list of node IDs and hashes for nodes that are part of this SHAMap but not available locally.
Traverse the SHAMap efficiently, maximizing I/O concurrency, to discover nodes referenced in the SHAMap but not available locally.
- Parameters
-
maxNodes | The maximum number of found nodes to return |
filter | The filter to use when retrieving nodes |
return | The nodes known to be missing |
The filter can hold alternate sources of nodes that are not permanently stored locally
Definition at line 317 of file SHAMapSync.cpp.