Class InlineIndexTree
- java.lang.Object
-
- org.apache.ignite.internal.processors.cache.persistence.DataStructure
-
- org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree<IndexRow,IndexRow>
-
- org.apache.ignite.internal.cache.query.index.sorted.inline.InlineIndexTree
-
-
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 Modifier and Type Field Description static intIGNITE_MAX_INDEX_PAYLOAD_SIZE_DEFAULTDefault value forIGNITE_MAX_INDEX_PAYLOAD_SIZEstatic intIGNITE_VARIABLE_TYPE_DEFAULT_INLINE_SIZEDefault sql index size for types with variable length (such as String or byte[]).-
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 InlineIndexTree(SortedIndexDefinition def, CacheGroupContext grpCtx, String treeName, IgniteCacheOffheapManager offheap, ReuseList reuseList, PageMemory pageMemory, PageIoResolver pageIoResolver, long metaPageId, boolean initNew, int configuredInlineSize, int maxInlineSize, IndexKeyTypeSettings keyTypeSettings, @Nullable IndexRowCache idxRowCache, @Nullable IoStatisticsHolder stats, InlineIndexRowHandlerFactory rowHndFactory, InlineRecommender recommender)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheGroupContextcacheGroupContext()Getting cache group context.protected intcompare(BPlusIO<IndexRow> io, long pageAddr, int idx, IndexRow row)static intcompareFullRows(IndexRow currRow, IndexRow row, int from, InlineIndexRowHandler rowHnd, IndexRowComparator rowCmp)static intcomputeInlineSize(String name, List<InlineIndexKeyType> keyTypes, List<IndexKeyDefinition> keyDefs, int cfgInlineSize, int maxInlineSize, IgniteLogger log)voidcopyMetaInfo(MetaPageInfo info)Copy info from another meta page.protected CorruptedTreeExceptioncorruptedTreeException(String msg, Throwable cause, int grpId, long... pageIds)Construct the exception and invoke failure processor.booleancreated()IndexRowImplcreateIndexRow(long link)Creates an index row for this tree.IndexRowgetRow(BPlusIO<IndexRow> io, long pageAddr, int idx, Object ignore)Get data row.intinlineSize()protected StringlockRetryErrorMessage(String op)Create an error message when reaching the maximum number of repetitions to capture a lock in the B+Tree.protected longmaxLockHoldTime()Maximum time for which tree destroy process is allowed to hold the lock, after this time exceeds,BPlusTree.temporaryReleaseLock()is called and hold time is reset.MetaPageInfometaInfo()InlineIndexRowHandlerrowHandler()protected IoStatisticsHolderstatisticsHolder()protected voidtemporaryReleaseLock()Releases the lock that is held by long tree destroy process for a short period of time and acquires it again, allowing other processes to acquire it.StringtoString()-
Methods inherited from class org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree
acquirePage, checkDestroyed, compare, destroy, destroy, destroyDownPages, destroyed, enableSequentialWriteMode, find, find, find, find, findFirst, findFirst, findLast, findLast, findOne, findOne, findOne, getFirstPageIds, getLockRetries, getMetaPageId, getRow, initTree, initTree, interruptAll, invoke, isEmpty, latestInnerIO, latestLeafIO, markDestroyed, printTree, processFailure, put, putx, read, read, remove, remove, removex, removex, rootLevel, setIos, size, size, 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
-
-
-
-
Field Detail
-
IGNITE_VARIABLE_TYPE_DEFAULT_INLINE_SIZE
public static final int IGNITE_VARIABLE_TYPE_DEFAULT_INLINE_SIZE
Default sql index size for types with variable length (such as String or byte[]). Note that effective length will be lower, because 3 bytes will be taken for the inner representation of variable type.- See Also:
- Constant Field Values
-
IGNITE_MAX_INDEX_PAYLOAD_SIZE_DEFAULT
public static final int IGNITE_MAX_INDEX_PAYLOAD_SIZE_DEFAULT
Default value forIGNITE_MAX_INDEX_PAYLOAD_SIZE- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InlineIndexTree
public InlineIndexTree(SortedIndexDefinition def, CacheGroupContext grpCtx, String treeName, IgniteCacheOffheapManager offheap, ReuseList reuseList, PageMemory pageMemory, PageIoResolver pageIoResolver, long metaPageId, boolean initNew, int configuredInlineSize, int maxInlineSize, IndexKeyTypeSettings keyTypeSettings, @Nullable @Nullable IndexRowCache idxRowCache, @Nullable @Nullable IoStatisticsHolder stats, InlineIndexRowHandlerFactory rowHndFactory, InlineRecommender recommender) throws IgniteCheckedException
Constructor.- Throws:
IgniteCheckedException
-
-
Method Detail
-
compare
protected int compare(BPlusIO<IndexRow> io, long pageAddr, int idx, IndexRow row) throws IgniteCheckedException
- Specified by:
comparein classBPlusTree<IndexRow,IndexRow>- Parameters:
io- 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.
-
compareFullRows
public static int compareFullRows(IndexRow currRow, IndexRow row, int from, InlineIndexRowHandler rowHnd, IndexRowComparator rowCmp) throws IgniteCheckedException
- Throws:
IgniteCheckedException
-
createIndexRow
public IndexRowImpl createIndexRow(long link) throws IgniteCheckedException
Creates an index row for this tree.- Throws:
IgniteCheckedException
-
getRow
public IndexRow getRow(BPlusIO<IndexRow> io, long pageAddr, int idx, Object ignore) throws IgniteCheckedException
Get data row. Can be called on inner page only ifBPlusTree.canGetRowFromInneristrue.- Specified by:
getRowin classBPlusTree<IndexRow,IndexRow>- Parameters:
io- IO.pageAddr- Page address.idx- Index.ignore- Implementation specific argument,nullalways means that we need to return full detached data row.- Returns:
- Data row.
- Throws:
IgniteCheckedException- If failed.
-
inlineSize
public int inlineSize()
-
computeInlineSize
public static int computeInlineSize(String name, List<InlineIndexKeyType> keyTypes, List<IndexKeyDefinition> keyDefs, int cfgInlineSize, int maxInlineSize, IgniteLogger log)
- Parameters:
name- Index name.keyTypes- Index key types.keyDefs- Index key definitions.cfgInlineSize- Inline size from index config.maxInlineSize- Max inline size from cache config.log- Logger.- Returns:
- Inline size.
-
cacheGroupContext
public CacheGroupContext cacheGroupContext()
Getting cache group context.- Returns:
- Cache group context.
-
metaInfo
public MetaPageInfo metaInfo() throws IgniteCheckedException
- Returns:
- Inline size.
- Throws:
IgniteCheckedException- If failed.
-
copyMetaInfo
public void copyMetaInfo(MetaPageInfo info) throws IgniteCheckedException
Copy info from another meta page.- Parameters:
info- Meta page info.- Throws:
IgniteCheckedException- If failed.
-
created
public boolean created()
-
corruptedTreeException
protected CorruptedTreeException corruptedTreeException(String msg, Throwable cause, int grpId, long... pageIds)
Construct the exception and invoke failure processor.- Overrides:
corruptedTreeExceptionin classBPlusTree<IndexRow,IndexRow>- Parameters:
msg- Message.cause- Cause.grpId- Group id.pageIds- Pages ids.- Returns:
- New CorruptedTreeException instance.
-
temporaryReleaseLock
protected void temporaryReleaseLock()
Releases the lock that is held by long tree destroy process for a short period of time and acquires it again, allowing other processes to acquire it.- Overrides:
temporaryReleaseLockin classBPlusTree<IndexRow,IndexRow>
-
maxLockHoldTime
protected long maxLockHoldTime()
Maximum time for which tree destroy process is allowed to hold the lock, after this time exceeds,BPlusTree.temporaryReleaseLock()is called and hold time is reset.- Overrides:
maxLockHoldTimein classBPlusTree<IndexRow,IndexRow>- Returns:
- Time, in milliseconds.
-
statisticsHolder
protected IoStatisticsHolder statisticsHolder()
- Overrides:
statisticsHolderin classBPlusTree<IndexRow,IndexRow>- Returns:
- Statistics holder to track IO operations.
-
rowHandler
public InlineIndexRowHandler rowHandler()
- Returns:
- Index row handler for this tree. Row handler for a tree can be set externally with the holder.
-
lockRetryErrorMessage
protected String lockRetryErrorMessage(String op)
Create an error message when reaching the maximum number of repetitions to capture a lock in the B+Tree.- Overrides:
lockRetryErrorMessagein classBPlusTree<IndexRow,IndexRow>- Parameters:
op- Operation name, for example: GET, PUT.- Returns:
- Error message.
-
-