public class GridH2TreeIndex extends GridH2IndexBase implements Comparator<GridSearchRowPointer>
GridH2IndexBase.FilteringIterator| Modifier and Type | Field and Description |
|---|---|
protected ConcurrentNavigableMap<GridSearchRowPointer,GridH2Row> |
tree |
filters, keyCol, valCol| Constructor and Description |
|---|
GridH2TreeIndex(String name,
GridH2Table tbl,
boolean unique,
int keyCol,
int valCol,
org.gridgain.grid.util.offheap.unsafe.GridUnsafeMemory memory,
org.h2.table.IndexColumn... cols)
Constructor with index initialization.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canFindNext() |
boolean |
canGetFirstOrLast() |
void |
close()
Closes index and releases resources.
|
void |
close(org.h2.engine.Session ses) |
int |
compare(GridSearchRowPointer r1,
GridSearchRowPointer r2) |
org.h2.index.Cursor |
find(org.h2.engine.Session ses,
org.h2.result.SearchRow first,
org.h2.result.SearchRow last) |
org.h2.index.Cursor |
findFirstOrLast(org.h2.engine.Session ses,
boolean first) |
org.h2.index.Cursor |
findNext(org.h2.engine.Session ses,
org.h2.result.SearchRow higherThan,
org.h2.result.SearchRow last) |
GridH2AbstractKeyValueRow |
findOne(GridSearchRowPointer row)
Finds row with key equal one in given search row.
|
double |
getCost(org.h2.engine.Session ses,
int[] masks,
org.h2.table.TableFilter filter,
org.h2.result.SortOrder sortOrder) |
long |
getRowCount(org.h2.engine.Session ses) |
long |
getRowCountApproximation() |
GridH2Row |
put(GridH2Row row,
boolean ifAbsent)
Put row if absent.
|
GridH2TreeIndex |
rebuild(org.gridgain.grid.util.offheap.unsafe.GridUnsafeMemory memory)
If the index supports rebuilding it has to creates its own copy.
|
void |
releaseSnapshot()
Releases snapshot for current thread.
|
GridH2Row |
remove(org.h2.result.SearchRow row)
Remove row from index.
|
Object |
takeSnapshot(Object s)
Takes snapshot to be used in current thread.
|
String |
toString() |
add, checkRename, filter, getDiskSpaceUsed, needRebuild, remove, remove, setFiltersForThread, truncatecanScan, checkIndexColumnTypes, commit, compareRows, containsNullAndAllowMultipleNull, find, getColumnIndex, getColumns, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDropSQL, getDuplicateKeyException, getIndexColumns, getIndexType, getPlanSQL, getRow, getTable, getType, initBaseIndex, isHidden, isRowIdIndex, removeChildrenAndResources, setSortedInsertModegetChildren, getComment, getDatabase, getId, getModificationId, getName, initDbObjectBase, invalidate, isTemporary, rename, setComment, setModified, setObjectName, setTemporaryclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitequalsprotected final ConcurrentNavigableMap<GridSearchRowPointer,GridH2Row> tree
public GridH2TreeIndex(String name, GridH2Table tbl, boolean unique, int keyCol, int valCol, org.gridgain.grid.util.offheap.unsafe.GridUnsafeMemory memory, org.h2.table.IndexColumn... cols)
name - Index name.tbl - Table.unique - If this index unique.keyCol - Primary key column index.valCol - Value column index.memory - Memory.cols - Index columns list.public void close()
public Object takeSnapshot(@Nullable Object s)
takeSnapshot in class GridH2IndexBases - Map to be used as snapshot if not null.public void releaseSnapshot()
releaseSnapshot in class GridH2IndexBasepublic void close(org.h2.engine.Session ses)
close in interface org.h2.index.Indexpublic long getRowCount(@Nullable
org.h2.engine.Session ses)
getRowCount in interface org.h2.index.Indexpublic long getRowCountApproximation()
getRowCountApproximation in interface org.h2.index.Indexpublic int compare(GridSearchRowPointer r1, GridSearchRowPointer r2)
compare in interface Comparator<GridSearchRowPointer>public String toString()
toString in class org.h2.engine.DbObjectBasepublic double getCost(org.h2.engine.Session ses,
int[] masks,
org.h2.table.TableFilter filter,
org.h2.result.SortOrder sortOrder)
getCost in interface org.h2.index.Indexpublic boolean canFindNext()
canFindNext in interface org.h2.index.IndexcanFindNext in class org.h2.index.BaseIndexpublic org.h2.index.Cursor find(org.h2.engine.Session ses,
@Nullable
org.h2.result.SearchRow first,
@Nullable
org.h2.result.SearchRow last)
find in interface org.h2.index.Indexpublic org.h2.index.Cursor findNext(org.h2.engine.Session ses,
org.h2.result.SearchRow higherThan,
org.h2.result.SearchRow last)
findNext in interface org.h2.index.IndexfindNext in class org.h2.index.BaseIndexpublic GridH2AbstractKeyValueRow findOne(GridSearchRowPointer row)
GridUnsafeMemory.begin()
GridUnsafeMemory.end(GridUnsafeMemory.Operation) block.row - Search row.public boolean canGetFirstOrLast()
canGetFirstOrLast in interface org.h2.index.Indexpublic org.h2.index.Cursor findFirstOrLast(org.h2.engine.Session ses,
boolean first)
findFirstOrLast in interface org.h2.index.Indexpublic GridH2Row put(GridH2Row row, boolean ifAbsent)
put in class GridH2IndexBaserow - Row.ifAbsent - Put only if such a row does not exist.public GridH2Row remove(org.h2.result.SearchRow row)
remove in class GridH2IndexBaserow - Row.public GridH2TreeIndex rebuild(org.gridgain.grid.util.offheap.unsafe.GridUnsafeMemory memory) throws InterruptedException
rebuild in class GridH2IndexBasememory - Memory.InterruptedException - If interrupted.Copyright © 2014. All rights reserved.