Interface IDiskSegment<TKey, TValue>
Inherited Members
Namespace: Tenray.ZoneTree.Segments
Assembly: ZoneTree.dll
Syntax
public interface IDiskSegment<TKey, TValue> : IReadOnlySegment<TKey, TValue>, IIndexedReader<TKey, TValue>, IDisposable
Type Parameters
Name | Description |
---|---|
TKey | |
TValue |
Properties
| Improve this Doc View SourceLength
Gets number of the records in the segment.
Declaration
long Length { get; }
Property Value
Type | Description |
---|---|
long |
ReadBufferCount
Returns read buffer count.
Declaration
int ReadBufferCount { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Improve this Doc View SourceAttachIterator()
Increments the iterator reader counter to ensure that disk segment stays alive until all iterators call DetachIterator.
Declaration
void AttachIterator()
DetachIterator()
Decrements the iterator reader counter. When there is no attached iterator remaining and the drop is already requested, calls Drop().
Declaration
void DetachIterator()
Drop(HashSet<long>)
Drops all sectors excluding given exclusion list.
Declaration
void Drop(HashSet<long> excludedPartIds)
Parameters
Type | Name | Description |
---|---|---|
HashSet<long> | excludedPartIds |
GetFirstKeysOfEveryPart()
Returns the first keys of every part.
Declaration
TKey[] GetFirstKeysOfEveryPart()
Returns
Type | Description |
---|---|
TKey[] | Keys |
GetLastKeysOfEveryPart()
Returns the last keys of every part.
Declaration
TKey[] GetLastKeysOfEveryPart()
Returns
Type | Description |
---|---|
TKey[] | Keys |
GetLastValuesOfEveryPart()
Returns the last values of every part.
Declaration
TValue[] GetLastValuesOfEveryPart()
Returns
Type | Description |
---|---|
TValue[] | Values |
GetPart(int)
Gets part.
Declaration
IDiskSegment<TKey, TValue> GetPart(int partIndex)
Parameters
Type | Name | Description |
---|---|---|
int | partIndex |
Returns
Type | Description |
---|---|
IDiskSegment<TKey, TValue> |
InitSparseArray(int)
Inits sparse array.
Declaration
void InitSparseArray(int size)
Parameters
Type | Name | Description |
---|---|---|
int | size |
LoadIntoMemory()
Initialize a sparse array alligned with segment length, This enables faster reads without IO.
Declaration
void LoadIntoMemory()
ReleaseReadBuffers(long)
Release internal read buffers that are not used after given ticks.
Declaration
int ReleaseReadBuffers(long ticks)
Parameters
Type | Name | Description |
---|---|---|
long | ticks |
Returns
Type | Description |
---|---|
int | Total released read buffer count. |