Class H2TreeIndex
- java.lang.Object
-
- org.h2.engine.DbObjectBase
-
- org.h2.schema.SchemaObjectBase
-
- org.h2.index.BaseIndex
-
- org.apache.ignite.internal.processors.query.h2.opt.H2IndexCostedBase
-
- org.apache.ignite.internal.processors.query.h2.opt.GridH2IndexBase
-
- org.apache.ignite.internal.processors.query.h2.database.H2TreeIndexBase
-
- org.apache.ignite.internal.processors.query.h2.database.H2TreeIndex
-
- All Implemented Interfaces:
org.h2.engine.DbObject,org.h2.index.Index,org.h2.schema.SchemaObject
public class H2TreeIndex extends H2TreeIndexBase
H2 Index overBPlusTree.
-
-
Field Summary
-
Fields inherited from class org.apache.ignite.internal.processors.query.h2.opt.H2IndexCostedBase
tbl
-
-
Constructor Summary
Constructors Constructor Description H2TreeIndex(InlineIndexImpl queryIndex, GridH2Table tbl, org.h2.table.IndexColumn[] cols, boolean pk, IgniteLogger log)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description H2TreeIndexcreateCopy(InlineIndexImpl inlineIndex, SortedIndexDefinition idxDef)Creates a new index that is an exact copy of this index.org.h2.index.IndexLookupBatchcreateLookupBatch(org.h2.table.TableFilter[] filters, int filter)voiddestroy()Attempts to destroys index and release all the resources.org.h2.index.Cursorfind(org.h2.engine.Session ses, org.h2.result.SearchRow lower, org.h2.result.SearchRow upper)org.h2.index.CursorfindFirstOrLast(org.h2.engine.Session ses, boolean b)Iterator<H2Row>findForSegment(GridH2RowRangeBounds bounds, int segment, IndexQueryContext qryCtx)Find rows for the segments (distributed joins).longgetRowCount(org.h2.engine.Session ses)InlineIndexImplindex()UUIDindexId()intinlineSize()H2CacheRowput(H2CacheRow row)Puts row.booleanputx(H2CacheRow row)Puts row.booleanremovex(org.h2.result.SearchRow row)Removes row from index.intsegmentsCount()voidsend(Collection<ClusterNode> nodes, Message msg)longsize()Returns number of elements in the tree by scanning pages of the bottom (leaf) level.GridH2RowMessagetoSearchRowMessage(org.h2.result.SearchRow row)longtotalRowCount(IndexingQueryCacheFilter partsFilter)<T extends Index>
Tunwrap(Class<T> clazz)Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.-
Methods inherited from class org.apache.ignite.internal.processors.query.h2.database.H2TreeIndexBase
canGetFirstOrLast, getCost
-
Methods inherited from class org.apache.ignite.internal.processors.query.h2.opt.GridH2IndexBase
add, checkRename, close, columnsArray, getDiskSpaceUsed, getDistributedMultiplier, getRowCountApproximation, getTable, needRebuild, queryContextRegistry, refreshColumnIds, remove, remove, rowDescriptor, segment, segmentForPartition, segmentForRow, truncate
-
Methods inherited from class org.apache.ignite.internal.processors.query.h2.opt.H2IndexCostedBase
getCostRangeIndex
-
Methods inherited from class org.h2.index.BaseIndex
canFindNext, canScan, checkIndexColumnTypes, commit, compareRows, find, findNext, getColumnIndex, getColumns, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDropSQL, getDuplicateKeyException, getIndexColumns, getIndexType, getPlanSQL, getRow, getType, initBaseIndex, isFindUsingFullTableScan, isFirstColumn, isHidden, isRowIdIndex, mayHaveNullDuplicates, removeChildrenAndResources, setSortedInsertMode
-
Methods inherited from class org.h2.engine.DbObjectBase
getChildren, getComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
H2TreeIndex
public H2TreeIndex(InlineIndexImpl queryIndex, GridH2Table tbl, org.h2.table.IndexColumn[] cols, boolean pk, IgniteLogger log)
-
-
Method Detail
-
inlineSize
public int inlineSize()
- Returns:
- Inline size.
-
segmentsCount
public int segmentsCount()
- Specified by:
segmentsCountin classGridH2IndexBase- Returns:
- Index segments count.
-
totalRowCount
public long totalRowCount(IndexingQueryCacheFilter partsFilter)
- Specified by:
totalRowCountin classGridH2IndexBase- Parameters:
partsFilter- Partitions filter.- Returns:
- Total row count in the current index for filtered partitions.
-
find
public org.h2.index.Cursor find(org.h2.engine.Session ses, org.h2.result.SearchRow lower, org.h2.result.SearchRow upper)
-
getRowCount
public long getRowCount(org.h2.engine.Session ses)
-
findFirstOrLast
public org.h2.index.Cursor findFirstOrLast(org.h2.engine.Session ses, boolean b)
-
destroy
public void destroy()
Attempts to destroys index and release all the resources. We use this method instead ofGridH2IndexBase.close(Session)because that method is used by H2 internally.- Overrides:
destroyin classGridH2IndexBase
-
put
public H2CacheRow put(H2CacheRow row)
Puts row.- Specified by:
putin classGridH2IndexBase- Parameters:
row- Row.- Returns:
- Existing row or
null.
-
putx
public boolean putx(H2CacheRow row)
Puts row.- Specified by:
putxin classGridH2IndexBase- Parameters:
row- Row.- Returns:
Trueif existing row row has been replaced.
-
removex
public boolean removex(org.h2.result.SearchRow row)
Removes row from index.- Specified by:
removexin classGridH2IndexBase- Parameters:
row- Row.- Returns:
Trueif row has been removed.
-
createLookupBatch
public org.h2.index.IndexLookupBatch createLookupBatch(org.h2.table.TableFilter[] filters, int filter)- Specified by:
createLookupBatchin interfaceorg.h2.index.Index- Overrides:
createLookupBatchin classorg.h2.index.BaseIndex
-
send
public void send(Collection<ClusterNode> nodes, Message msg)
- Parameters:
nodes- Nodes.msg- Message.
-
findForSegment
public Iterator<H2Row> findForSegment(GridH2RowRangeBounds bounds, int segment, IndexQueryContext qryCtx)
Find rows for the segments (distributed joins).- Parameters:
bounds- Bounds.segment- Segment.qryCtx- Index query context.- Returns:
- Iterator.
-
toSearchRowMessage
public GridH2RowMessage toSearchRowMessage(org.h2.result.SearchRow row)
- Parameters:
row- Search row.- Returns:
- Row message.
-
size
public long size() throws IgniteCheckedExceptionReturns number of elements in the tree by scanning pages of the bottom (leaf) level.- Returns:
- Number of elements in the tree.
- Throws:
IgniteCheckedException- If failed.
-
createCopy
public H2TreeIndex createCopy(InlineIndexImpl inlineIndex, SortedIndexDefinition idxDef) throws IgniteCheckedException
Creates a new index that is an exact copy of this index.- Returns:
- New index.
- Throws:
IgniteCheckedException
-
indexId
public UUID indexId()
- Returns:
- Index's id.
-
index
public InlineIndexImpl index()
- Returns:
- Index.
-
unwrap
public <T extends Index> T unwrap(Class<T> clazz)
Finds an instance of an interface implemented by this object, or returns null if this object does not support that interface.- Overrides:
unwrapin classGridH2IndexBase
-
-