SortedTreeTKey, TValue Class

Provides the basic user methods with any derived B+Tree. This base class translates all of the core methods into simple methods that must be implemented by classes derived from this base class.

Definition

Namespace: SnapDB.Snap.Tree
Assembly: SnapDB (in SnapDB.dll) Version: 1.0.102.0 -- Release Build+29075351d0e5aa4dea46a5c520805222f672dc2e
public class SortedTree<TKey, TValue>
where TKey : new(), SnapTypeBase<TKey>
where TValue : new(), SnapTypeBase<TValue>
Inheritance
Object    SortedTreeTKey, TValue

Type Parameters

TKey
The key type for the sorted tree.
TValue
The value type for the sorted tree.

Remarks

This class does not support concurrent read operations. This is due to the caching method of each tree. If concurrent read operations are desired, clone the tree. Trees cannot be cloned if the user plans to write to the tree.

Properties

AutoFlush The sorted tree will not continually call the Flush method every time the header is changed. When setting this to false, flushes must be manually invoked. Failing to do this can corrupt the SortedTree. Only set if you can guarantee that Flush will be called before disposing this class.
BlockSize Contains the block size that the tree nodes will be aligned on.
IsDirty Gets if the sorted tree needs to be flushed to the disk.
Stream Contains the stream for reading and writing.

Methods

Add Adds the provided key/value to the Tree.
AddRange Adds all of the points in the stream to the Tree
Create(BinaryStreamPointerBase, Int32) Creates a new fixed size SortedTree using the provided stream.
Create(BinaryStreamPointerBase, Int32, EncodingDefinition) Creates a new SortedTree writing to the provided streams and using the specified compression method for the tree node.
CreateTreeScanner Creates a tree scanner that can be used to seek this tree.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Flush Flushes any header data that may have changed to the main stream.
Get Gets the following key from the Tree. Assigns to the value.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetKeyRange Gets the lower and upper bounds of this tree.
GetNextNewNodeIndex Returns the node index address for a freshly allocated block.
GetTypeGets the Type of the current instance.
(Inherited from Object)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Open Opens a sorted tree using the provided stream.
SetDirtyFlag Sets a flag that requires that the header data is no longer valid.
ToStringReturns a string that represents the current object.
(Inherited from Object)
TryAdd Attempts to add the provided key/value to the Tree.
TryAddRange Adds all of the items in the stream to this tree. Skips any duplicate entries.
TryGet Attempts to get the following key from the Tree. Assigns to the value.
TryRemove Tries to remove the following key from the tree.

Fields

Indexer Gets or sets the sparse index associated with this node. It provides a mapping between keys and node indices.
LeafStorage Gets or sets the storage for leaf nodes. Leaf nodes store key-value pairs in the sorted tree.

See Also