CSharpTest.Net
BPlusTree<TKey,TValue> Class Members
See Also  Properties  Methods  Send Feedback Download Help File
CSharpTest.Net.BPlusTree Assembly > CSharpTest.Net.Collections Namespace : BPlusTree<TKey,TValue> Class


Glossary Item Box

The following tables list the members exposed by BPlusTree<TKey,TValue>.

Public Constructors

 NameDescription
Public ConstructorBPlusTree<TKey,TValue> ConstructorOverloaded.   
Top

Public Properties

 NameDescription
Public PropertyCallLevelLockDefines the lock used to provide tree-level exclusive operations. This should be set at the time of construction, or not at all since operations depending on this (Clear, EnableCount, and UnloadCache) may behave poorly if operations that started prior to setting this value are still being processed. Out of the locks I've tested the ReaderWriterLocking implementation performs best here since it is a highly read-intensive lock. All public APIs that access tree content will aquire this lock as a reader except the tree exclusive operations. This also allows you, by way of aquiring a write lock, to gain exclusive access and perform mass updates, atomic enumeration, etc.  
Public PropertyCountSee comments on EnableCount() for usage of this property  
Public PropertyIsReadOnlyReturns true if the file was opened in ReadOnly mode.  
Public PropertyItemGets or sets the element with the specified key.  
Public PropertyKeysGets an ICollection containing the keys of the IDictionary.  
Public PropertyValuesGets an ICollection containing the values in the IDictionary.  
Top

Public Methods

 NameDescription
Public MethodAddAdds an element with the provided key and value to the IDictionary.  
Public MethodAddRangeOverloaded. Presorts the provided enumeration in batches and then performs an optimized insert on the resulting set(s).  
Public MethodAddRangeSortedOverloaded. Optimized insert of presorted key/value pairs. If the input is not presorted, please use AddRange() instead.  
Public MethodBulkInsertOverloaded. Rewrite the entire BTree as a transaction to include the provided items. This method is Thread safe. If the input is already sorted, use BulkInsertOptions overload to specify InputIsSorted = true.  
Public MethodClearRemoves all items from the collection and permanently destroys all storage.  
Public MethodCommitWhen using TransactionLog, this method commits the changes in the current instance to the output file and truncates the log. For all other cases the method is a no-op and no exception is raised. This method is NOT thread safe UNLESS the CallLevelLock property has been set to valid reader/writer lock. If you need to call this method while writers are currently accessing the tree, make sure the CallLevelLock options is specified.  
Public MethodContainsKeyDetermines whether the IDictionary contains an element with the specified key.  
Public MethodCopyToCopies the elements of the ICollection to an System.Array, starting at a particular System.Array index.  
Public MethodDebugSetOutputSets a text writter that the entire btree will be dumped to after every read/write/seek operation. The format is a single line of text in abbreviated form: {k1{k1,k2,k3},k4{k4,k5}}  
Public MethodDebugSetValidateOnCheckpointSets a boolean condition that will validate the state of the entire btree after every operation.  
Public MethodDisposeCloses the storage and clears memory used by the instance  
Public MethodEnableCountDue to the cost of upkeep, this must be enable each time the object is created via a call to EnableCount() which itself must be done before any writer threads are active for it to be accurate. This requires that the entire tree be loaded (sequentially) in order to build the initial working count. Once completed, members like Add() and Remove() will keep the initial count accurate.  
Public Methodstatic (Shared in Visual Basic)EnumerateFileDirectly enumerates the contents of BPlusTree from disk in read-only mode.  
Public MethodEnumerateFromInclusivly enumerates from start key to the end of the collection  
Public MethodEnumerateRangeInclusivly enumerates from start key to stop key  
Public MethodFirstReturns the first key and it's associated value.  
Public MethodGetEnumeratorReturns an enumerator that iterates through the collection.  
Public MethodGetOrAddOverloaded. Adds a key/value pair to the IDictionary if the key does not already exist.  
Public MethodLastReturns the last key and it's associated value.  
Public MethodPrintPrints the entire tree to the text writer  
Public Methodstatic (Shared in Visual Basic)RecoverFileRecovers as much file content as possible into a newly created BPlusTree<TKey,TValue>, if the operation returns a non-zero result it was successful and the file has been replaced with a new database containing the recovered data. The original file remains in-tact but was renamed with a '.deleted' extension.  
Public Methodstatic (Shared in Visual Basic)RecoveryScanPerforms a low-level scan of the storage file to yield all Key/Value pairs it was able to read from the file.  
Public MethodRemoveRemoves the element with the specified key from the IDictionary.  
Public MethodRollbackWith version 2 storage this will revert the contents of tree to it's initial state when the file was first opened, or to the state captured with the last call to commit. Any transaction log data will be truncated.  
Public MethodTryAddOverloaded. Adds an element with the provided key and value to the IDictionary by calling the provided factory method to construct the value if the key is not already present in the collection.  
Public MethodTryGetFirstReturns the first key and it's associated value.  
Public MethodTryGetLastReturns the last key and it's associated value.  
Public MethodTryGetValueGets the value associated with the specified key.  
Public MethodTryRemoveOverloaded. Removes the element with the specified key from the IDictionary.  
Public MethodTryUpdateOverloaded. Updates an element with the provided key to the value if it exists.  
Public MethodUnloadCacheSafely removes all items from the in-memory cache.  
Public MethodValidateForces a top-down, depth-first, crawl of the entire tree in which every node and every link or key is checked for accuracy. Throws on error.  
Top

See Also

Generated with Document! X 2011 by Innovasys