Class InlineObjectBytesDetector
- java.lang.Object
-
- org.apache.ignite.internal.cache.query.index.sorted.inline.InlineObjectBytesDetector
-
- All Implemented Interfaces:
BPlusTree.TreeRowClosure<IndexRow,IndexRow>
public class InlineObjectBytesDetector extends Object implements BPlusTree.TreeRowClosure<IndexRow,IndexRow>
This class helps to detect whether tree contains inlined JO type. When starting on old Ignite versions it's impossible to discover whether JO type was inlined or not. Then try to find that with 2 steps: 1. analyze of inline size; 2. traverse tree and check stored values.
-
-
Constructor Summary
Constructors Constructor Description InlineObjectBytesDetector(int inlineSize, Collection<IndexKeyDefinition> keyDefs, IndexName idxName, IgniteLogger log)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapply(BPlusTree<IndexRow,IndexRow> tree, BPlusIO<IndexRow> io, long pageAddr, int idx)Performs inspection or operation on a specified row and returns true if this row is required or matches or /operation successful (depending on the context).booleaninlineObjectSupported()static booleanobjectMayBeInlined(int inlineSize, Collection<IndexKeyDefinition> keyDefs)Static analyze inline_size and inline columns set.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.ignite.internal.processors.cache.persistence.tree.BPlusTree.TreeRowClosure
lastRow
-
-
-
-
Constructor Detail
-
InlineObjectBytesDetector
public InlineObjectBytesDetector(int inlineSize, Collection<IndexKeyDefinition> keyDefs, IndexName idxName, IgniteLogger log)- Parameters:
inlineSize- Inline size.keyDefs- Index key definitions.idxName- Index name.log- Ignite logger.
-
-
Method Detail
-
apply
public boolean apply(BPlusTree<IndexRow,IndexRow> tree, BPlusIO<IndexRow> io, long pageAddr, int idx) throws IgniteCheckedException
Performs inspection or operation on a specified row and returns true if this row is required or matches or /operation successful (depending on the context).- Specified by:
applyin interfaceBPlusTree.TreeRowClosure<IndexRow,IndexRow>- Parameters:
tree- The tree.io- Th tree IO object.pageAddr- The page address.idx- The item index.- Returns:
Trueif the item passes the predicate.- Throws:
IgniteCheckedException- If failed.
-
inlineObjectSupported
public boolean inlineObjectSupported()
- Returns:
trueif inline object is supported on current tree.
-
objectMayBeInlined
public static boolean objectMayBeInlined(int inlineSize, Collection<IndexKeyDefinition> keyDefs)Static analyze inline_size and inline columns set. e.g.: indexed: (long, obj) and inline_size < 12. In this case there is no space for inline object.- Parameters:
keyDefs- Index key definition.inlineSize- Inline size.- Returns:
trueIf the object may be inlined.
-
-