public abstract class GridMergeIndex
extends BaseIndex
| Modifier and Type | Class and Description |
|---|---|
protected class |
GridMergeIndex.FetchingCursor
Fetching cursor.
|
protected static interface |
GridMergeIndex.Pollable<E>
Pollable.
|
| Modifier and Type | Field and Description |
|---|---|
protected Comparator<SearchRow> |
firstRowCmp |
protected Comparator<SearchRow> |
lastRowCmp |
| Modifier | Constructor and Description |
|---|---|
protected |
GridMergeIndex(GridKernalContext ctx) |
|
GridMergeIndex(GridKernalContext ctx,
GridMergeTable tbl,
String name,
IndexType type,
IndexColumn[] cols) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Session ses,
Row row) |
void |
addPage(GridResultPage page) |
protected abstract void |
addPage0(GridResultPage page) |
protected static int |
binarySearchRow(List<Row> rows,
SearchRow searchRow,
Comparator<SearchRow> cmp,
boolean checkLast) |
boolean |
canGetFirstOrLast() |
protected void |
checkBounds(Row lastEvictedRow,
SearchRow first,
SearchRow last) |
void |
checkRename() |
void |
close(Session ses) |
protected GridResultPage |
createDummyLastPage(GridResultPage lastPage) |
void |
fail(CacheException e) |
void |
fail(UUID nodeId,
CacheException e) |
abstract boolean |
fetchedAll() |
Cursor |
find(Session ses,
SearchRow first,
SearchRow last) |
protected abstract Cursor |
findAllFetched(List<Row> fetched,
SearchRow first,
SearchRow last) |
Cursor |
findFirstOrLast(Session ses,
boolean first) |
protected abstract Cursor |
findInStream(SearchRow first,
SearchRow last) |
long |
getDiskSpaceUsed() |
long |
getRowCount(Session ses) |
long |
getRowCountApproximation() |
boolean |
hasSource(UUID nodeId) |
boolean |
needRebuild() |
protected Iterator<Value[]> |
pollNextIterator(GridMergeIndex.Pollable<GridResultPage> queue,
Iterator<Value[]> iter) |
void |
remove(Session ses) |
void |
remove(Session ses,
Row row) |
void |
setPageSize(int pageSize) |
void |
setSources(Collection<ClusterNode> nodes,
int segmentsCnt)
Set source nodes.
|
Set<UUID> |
sources() |
void |
truncate(Session ses) |
protected final Comparator<SearchRow> firstRowCmp
protected final Comparator<SearchRow> lastRowCmp
public GridMergeIndex(GridKernalContext ctx,
GridMergeTable tbl,
String name,
IndexType type,
IndexColumn[] cols)
ctx - Context.tbl - Table.name - Index name.type - Type.cols - Columns.protected GridMergeIndex(GridKernalContext ctx)
ctx - Context.public boolean hasSource(UUID nodeId)
nodeId - Node ID.true If this index needs data from the given source node.public long getRowCount(Session ses)
public long getRowCountApproximation()
public void setSources(Collection<ClusterNode> nodes, int segmentsCnt)
nodes - Nodes.segmentsCnt - Index segments per table.public void setPageSize(int pageSize)
pageSize - Page size.protected final Iterator<Value[]> pollNextIterator(GridMergeIndex.Pollable<GridResultPage> queue, Iterator<Value[]> iter)
queue - Queue to poll.iter - Current iterator.public void fail(CacheException e)
e - Error.public void fail(UUID nodeId, CacheException e)
nodeId - Node ID.e - Exception.public final void addPage(GridResultPage page)
page - Page.protected final GridResultPage createDummyLastPage(GridResultPage lastPage)
lastPage - Real last page.protected abstract void addPage0(GridResultPage page)
page - Page.public final Cursor find(Session ses,
SearchRow first,
SearchRow last)
public abstract boolean fetchedAll()
true If we have fetched all the remote rows into a fetched list.protected void checkBounds(Row lastEvictedRow,
SearchRow first,
SearchRow last)
lastEvictedRow - Last evicted fetched row.first - Lower bound.last - Upper bound.protected abstract Cursor findInStream(SearchRow first,
SearchRow last)
first - Lower bound.last - Upper bound.GridMergeIndex.FetchingCursor instance.protected abstract Cursor findAllFetched(List<Row> fetched, SearchRow first, SearchRow last)
fetched - Fetched rows.first - Lower bound.last - Upper bound.public void checkRename()
public void close(Session ses)
public void add(Session ses,
Row row)
public void remove(Session ses,
Row row)
public void remove(Session ses)
public void truncate(Session ses)
public boolean canGetFirstOrLast()
public Cursor findFirstOrLast(Session ses,
boolean first)
public boolean needRebuild()
public long getDiskSpaceUsed()
protected static int binarySearchRow(List<Row> rows, SearchRow searchRow, Comparator<SearchRow> cmp, boolean checkLast)
rows - Sorted rows list.searchRow - Search row.cmp - Comparator.checkLast - If we need to optimistically check the last row right away.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2-p3 Release Date : April 25 2019