2.5 KiB
API Overview
This page gives a quick map of the main API areas.
Tree
IZoneTree<TKey, TValue> is the main non-transactional interface.
Important methods:
TryGetContainsKeyUpsertTryAddTryDeleteForceDeleteCreateIteratorCreateReverseIteratorCreateMaintainerCountCountFullScan
Atomic Methods
Atomic methods synchronize same-key read-modify-write operations across LSM-tree segments.
Important methods:
TryAtomicGetAndUpdateTryAtomicAddTryAtomicUpdateTryAtomicAddOrUpdateAtomicUpsert
Use them only when the next value depends on the current value.
Transactions
Transactional trees coordinate multi-key changes.
Important areas:
BeginTransactionBeginFluentTransaction- read/write with transaction id
PreparePrepareAndCommitCommitRollbackReadCommittedTryGetUpsertAutoCommitDeleteAutoCommit- exceptionless transaction APIs,
- fluent transaction APIs.
Maintenance
Maintenance APIs expose segment lifecycle operations and events.
Use the maintainer for standard background maintenance. Use low-level maintenance APIs when building custom storage services.
Important metrics:
MutableSegmentRecordCountReadOnlySegmentsCountReadOnlySegmentsRecordCountInMemoryRecordCountTotalRecordCountIsMergingIsBottomSegmentsMerging
Important operations:
MoveMutableSegmentForwardStartMergeOperationStartBottomSegmentsMergeOperationSaveMetaDataReleaseReadBuffersfor decompressed disk block buffersReleaseCircularKeyCacheRecordsfor circular key cache recordsReleaseCircularValueCacheRecordsfor circular value cache records
Backup And Restore
Live backup APIs create complete backup generations while a built-in non-transactional ZoneTree remains open.
Important areas:
CreateLiveBackupLiveBackup<TKey, TValue>LiveBackupOptionsLiveBackupScheduleLocalLiveBackupProviderLocalLiveBackupOptionsILiveBackupStoreILiveBackupSourceRestoreFromLatestLiveBackupRestoreFromLiveBackupGeneration
Manual generations are created with CreateGenerationAsync. Automatic generations come from schedules or successful normal merges after Start() is called.
Iterators
Iterators scan in key order or reverse key order. Use Seek for range scans.
Dispose iterators promptly.
Iterator options:
IteratorType.AutoRefreshIteratorType.NoRefreshIteratorType.SnapshotIteratorType.ReadOnlyRegionincludeDeletedRecordscontributeToTheBlockCache