Class CacheDataTree
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.DataStructure
-
- org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree<CacheSearchRow,CacheDataRow>
-
- org.apache.ignite.internal.processors.cache.tree.CacheDataTree
-
- All Implemented Interfaces:
IgniteTree<CacheSearchRow,CacheDataRow>
public class CacheDataTree extends BPlusTree<CacheSearchRow,CacheDataRow>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree
BPlusTree.Get, BPlusTree.Insert, BPlusTree.Invoke, BPlusTree.Put, BPlusTree.Remove, BPlusTree.RemoveRange, BPlusTree.Replace, BPlusTree.Result, BPlusTree.Search, BPlusTree.TreeRowClosure<L,T extends L>, BPlusTree.TreeRowFactory<L,T extends L>
-
Nested classes/interfaces inherited from interface org.apache.ignite.internal.util.IgniteTree
IgniteTree.InvokeClosure<T>, IgniteTree.OperationType
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree
CONC_DESTROY_MSG, IGNITE_BPLUS_TREE_LOCK_RETRIES_DEFAULT, metaPageId, suspendFailureDiagnostic, testHndWrapper
-
Fields inherited from class org.apache.ignite.internal.processors.cache.persistence.DataStructure
grpId, grpName, metrics, pageFlag, pageIoRslvr, pageMem, reuseList, rnd, wal
-
-
Constructor Summary
Constructors Constructor Description CacheDataTree(CacheGroupContext grp, String name, ReuseList reuseList, CacheDataRowStore rowStore, long metaPageId, boolean initNew, PageLockTrackerManager pageLockTrackerManager, byte pageFlag)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcompare(BPlusIO<CacheSearchRow> iox, long pageAddr, int idx, CacheSearchRow row)static intcompareBytes(byte[] bytes1, byte[] bytes2)GridCursor<CacheDataRow>find(CacheSearchRow lower, CacheSearchRow upper, BPlusTree.TreeRowClosure<CacheSearchRow,CacheDataRow> c, Object x)CacheDataRowgetRow(BPlusIO<CacheSearchRow> io, long pageAddr, int idx, Object flags)Get data row.static booleanisDataPageScanEnabled()static BooleanisLastFindWithDataPageScan()CacheDataRowStorerowStore()static voidsetDataPageScanEnabled(boolean enabled)Enable or disable data page scan.protected IoStatisticsHolderstatisticsHolder()-
Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree
acquirePage, checkDestroyed, compare, corruptedTreeException, destroy, destroy, destroyDownPages, destroyed, enableSequentialWriteMode, find, find, find, findFirst, findFirst, findLast, findLast, findOne, findOne, findOne, getFirstPageIds, getLockRetries, getMetaPageId, getRow, initTree, initTree, interruptAll, invoke, isEmpty, latestInnerIO, latestLeafIO, lockRetryErrorMessage, markDestroyed, maxLockHoldTime, printTree, processFailure, put, putx, read, read, remove, remove, removex, removex, rootLevel, setIos, size, size, temporaryReleaseLock, toString, treeName, validateTree
-
Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.DataStructure
acquirePage, allocatePage, allocatePage, allocatePageNoReuse, close, groupId, init, name, needWalDeltaRecord, pageSize, randomInt, read, read, readLock, readUnlock, recyclePage, releasePage, tryWriteLock, write, write, write, write, writeLock, writeUnlock, writeUnlock
-
-
-
-
Constructor Detail
-
CacheDataTree
public CacheDataTree(CacheGroupContext grp, String name, ReuseList reuseList, CacheDataRowStore rowStore, long metaPageId, boolean initNew, PageLockTrackerManager pageLockTrackerManager, byte pageFlag) throws IgniteCheckedException
- Parameters:
grp- Cache group.name- Tree name.reuseList- Reuse list.rowStore- Row store.metaPageId- Meta page ID.initNew- Initialize new index.pageFlag- Default flag value for allocated pages.pageLockTrackerManager- Page lock tracker manager.- Throws:
IgniteCheckedException- If failed.
-
-
Method Detail
-
setDataPageScanEnabled
public static void setDataPageScanEnabled(boolean enabled)
Enable or disable data page scan.- Parameters:
enabled- {code true} If enabled.
-
isDataPageScanEnabled
public static boolean isDataPageScanEnabled()
- Returns:
trueIf data page scan is enabled.
-
isLastFindWithDataPageScan
@TestOnly public static Boolean isLastFindWithDataPageScan()
- Returns:
trueIf the last observed call to the methodfind(...)used data page scan.
-
find
public GridCursor<CacheDataRow> find(CacheSearchRow lower, CacheSearchRow upper, BPlusTree.TreeRowClosure<CacheSearchRow,CacheDataRow> c, Object x) throws IgniteCheckedException
- Overrides:
findin classBPlusTree<CacheSearchRow,CacheDataRow>- Parameters:
lower- Lower bound inclusive ornullif unbounded.upper- Upper bound inclusive ornullif unbounded.c- Filter closure.x- Implementation specific argument,nullalways means that we need to return full detached data row.- Returns:
- Cursor.
- Throws:
IgniteCheckedException- If failed.
-
rowStore
public CacheDataRowStore rowStore()
- Returns:
- Row store.
-
compare
protected int compare(BPlusIO<CacheSearchRow> iox, long pageAddr, int idx, CacheSearchRow row) throws IgniteCheckedException
- Specified by:
comparein classBPlusTree<CacheSearchRow,CacheDataRow>- Parameters:
iox- IO.pageAddr- Page address.idx- Index of row in the given buffer.row- Lookup row.- Returns:
- Comparison result as in
Comparator.compare(Object, Object). - Throws:
IgniteCheckedException- If failed.
-
getRow
public CacheDataRow getRow(BPlusIO<CacheSearchRow> io, long pageAddr, int idx, Object flags)
Get data row. Can be called on inner page only ifBPlusTree.canGetRowFromInneristrue.- Specified by:
getRowin classBPlusTree<CacheSearchRow,CacheDataRow>- Parameters:
io- IO.pageAddr- Page address.idx- Index.flags- Implementation specific argument,nullalways means that we need to return full detached data row.- Returns:
- Data row.
-
statisticsHolder
protected IoStatisticsHolder statisticsHolder()
- Overrides:
statisticsHolderin classBPlusTree<CacheSearchRow,CacheDataRow>- Returns:
- Statistics holder to track IO operations.
-
compareBytes
public static int compareBytes(byte[] bytes1, byte[] bytes2)- Parameters:
bytes1- First key bytes.bytes2- Second key bytes.- Returns:
- Comparsion result of bytes arrays according to
Comparator.compare(Object, Object)contract. - See Also:
compareKeys(KeyCacheObject, long)
-
-