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
Gets the count of read buffers.
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 of the segment except those in the specified exclusion list.
Declaration
void Drop(HashSet<long> excludedPartIds)
Parameters
Type | Name | Description |
---|---|---|
HashSet<long> | excludedPartIds | A set of part IDs to exclude from dropping. |
GetFirstKeysOfEveryPart()
Returns the first keys of every part.
Declaration
TKey[] GetFirstKeysOfEveryPart()
Returns
Type | Description |
---|---|
TKey[] | An array of the first keys of each part. |
GetLastKeysOfEveryPart()
Returns the last keys of every part.
Declaration
TKey[] GetLastKeysOfEveryPart()
Returns
Type | Description |
---|---|
TKey[] | An array of the last keys of each part. |
GetLastValuesOfEveryPart()
Returns the last values of every part.
Declaration
TValue[] GetLastValuesOfEveryPart()
Returns
Type | Description |
---|---|
TValue[] | An array of the last values of each part. |
GetPart(int)
Retrieves the part of the segment at the specified index.
Declaration
IDiskSegment<TKey, TValue> GetPart(int partIndex)
Parameters
Type | Name | Description |
---|---|---|
int | partIndex | The index of the part to retrieve. |
Returns
Type | Description |
---|---|
IDiskSegment<TKey, TValue> | The part of the segment at the specified index. |
GetPartCount()
Returns the total number of parts in the segment.
Declaration
int GetPartCount()
Returns
Type | Description |
---|---|
int | The total number of parts. |
InitSparseArray(int)
Initializes the sparse array with the specified size.
Declaration
void InitSparseArray(int size)
Parameters
Type | Name | Description |
---|---|---|
int | size | The size of the sparse array to initialize. |
LoadIntoMemory()
Initialize a sparse array alligned with segment length, enabling faster reads without I/O operations.
Declaration
void LoadIntoMemory()
ReleaseCircularKeyCacheRecords()
Releases expired circular cache key records.
Declaration
int ReleaseCircularKeyCacheRecords()
Returns
Type | Description |
---|---|
int | The total number of released cached records. |
ReleaseCircularValueCacheRecords()
Releases expired circular cache value records.
Declaration
int ReleaseCircularValueCacheRecords()
Returns
Type | Description |
---|---|
int | The total number of released cached records. |
ReleaseReadBuffers(long)
Releases internal read buffers that have not been used since the specified tick count.
Declaration
int ReleaseReadBuffers(long ticks)
Parameters
Type | Name | Description |
---|---|---|
long | ticks |
Returns
Type | Description |
---|---|
int | The total number of released read buffers. |
SetDefaultSparseArray(IReadOnlyList<SparseArrayEntry<TKey, TValue>>)
Sets default sparse array of the disk segment and persists it to the disk.
Declaration
void SetDefaultSparseArray(IReadOnlyList<SparseArrayEntry<TKey, TValue>> defaultSparseArray)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<SparseArrayEntry<TKey, TValue>> | defaultSparseArray |