public class InlineIndexImpl extends AbstractIndex implements InlineIndex
| Constructor and Description |
|---|
InlineIndexImpl(GridCacheContext<?,?> cctx,
SortedIndexDefinition def,
InlineIndexTree[] segments,
IoStatisticsHolderIndex stats)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateSegment(int segmentsCnt,
int part) |
boolean |
canHandle(CacheDataRow row)
Checks whether index handles specified cache row.
|
long |
count(int segment)
Counts index rows in specified tree segment.
|
long |
count(int segment,
IndexQueryContext qryCtx)
Counts index rows in specified tree segment with cache filter.
|
boolean |
created()
true if index is created and false if it is restored from disk. |
void |
destroy(boolean softDel)
Destroy index.
|
GridCursor<IndexRow> |
find(IndexRow lower,
IndexRow upper,
boolean lowIncl,
boolean upIncl,
IndexQueryContext qryCtx)
Finds index rows by specified range in all tree segments with cache filtering.
|
GridCursor<IndexRow> |
find(IndexRow lower,
IndexRow upper,
boolean lowIncl,
boolean upIncl,
int segment,
IndexQueryContext qryCtx)
Finds index rows by specified range in specifed tree segment with cache filtering.
|
GridCursor<IndexRow> |
findFirst(int segment,
IndexQueryContext qryCtx)
Finds first index row for specified tree segment and cache filter.
|
GridCursor<IndexRow> |
findFirstOrLast(IndexQueryContext qryCtx,
boolean first)
Takes only one first or last index record.
|
GridCursor<IndexRow> |
findLast(int segment,
IndexQueryContext qryCtx)
Finds last index row for specified tree segment and cache filter.
|
UUID |
id()
Unique ID.
|
SortedIndexDefinition |
indexDefinition() |
int |
inlineSize() |
IndexKeyTypeSettings |
keyTypeSettings() |
String |
name()
Index name.
|
void |
onUpdate(@Nullable CacheDataRow oldRow,
@Nullable CacheDataRow newRow,
boolean prevRowAvailable)
Callback that runs when the underlying cache is updated.
|
void |
putIndexRow(IndexRowImpl row)
Put index row to index.
|
InlineIndexTree |
segment(int segment) |
int |
segmentForRow(CacheDataRow row) |
int |
segmentsCount()
Returns amount of index tree segments.
|
long |
totalCount()
Returns number of elements in the tree by scanning pages of the bottom (leaf) level.
|
markIndexRebuild, rebuildInProgress, unwrappublic InlineIndexImpl(GridCacheContext<?,?> cctx, SortedIndexDefinition def, InlineIndexTree[] segments, IoStatisticsHolderIndex stats)
public GridCursor<IndexRow> find(IndexRow lower, IndexRow upper, boolean lowIncl, boolean upIncl, int segment, IndexQueryContext qryCtx) throws IgniteCheckedException
find in interface SortedSegmentedIndexlower - Nullable lower bound.upper - Nullable upper bound.lowIncl - true for inclusive lower bound, otherwise false.upIncl - true for inclusive upper bound, otherwise false.segment - Number of tree segment to find.qryCtx - External index query context.IgniteCheckedExceptionpublic GridCursor<IndexRow> findFirstOrLast(IndexQueryContext qryCtx, boolean first) throws IgniteCheckedException
findFirstOrLast in interface SortedSegmentedIndexqryCtx - External index qyery context.first - True to take first index value. False to take last index value.IgniteCheckedExceptionpublic GridCursor<IndexRow> find(IndexRow lower, IndexRow upper, boolean lowIncl, boolean upIncl, IndexQueryContext qryCtx) throws IgniteCheckedException
find in interface SortedSegmentedIndexlower - Nullable lower bound.upper - Nullable upper bound.lowIncl - true for inclusive lower bound, otherwise false.upIncl - true for inclusive upper bound, otherwise false.qryCtx - External index query context.IgniteCheckedExceptionpublic long count(int segment)
throws IgniteCheckedException
count in interface SortedSegmentedIndexsegment - Number of tree segment to find.IgniteCheckedExceptionpublic long count(int segment,
IndexQueryContext qryCtx)
throws IgniteCheckedException
count in interface SortedSegmentedIndexsegment - Number of tree segment to find.qryCtx - Index query context.IgniteCheckedExceptionpublic long totalCount()
throws IgniteCheckedException
totalCount in interface SortedSegmentedIndexIgniteCheckedException - If failed.public GridCursor<IndexRow> findFirst(int segment, IndexQueryContext qryCtx) throws IgniteCheckedException
findFirst in interface SortedSegmentedIndexsegment - Number of tree segment to find.qryCtx - External index qyery context.IgniteCheckedExceptionpublic GridCursor<IndexRow> findLast(int segment, IndexQueryContext qryCtx) throws IgniteCheckedException
findLast in interface SortedSegmentedIndexsegment - Number of tree segment to find.qryCtx - External index qyery context.IgniteCheckedExceptionpublic void onUpdate(@Nullable
@Nullable CacheDataRow oldRow,
@Nullable
@Nullable CacheDataRow newRow,
boolean prevRowAvailable)
throws IgniteCheckedException
onUpdate in interface IndexoldRow - Cache row that was replaced with newRow.newRow - Cache row that was stored.prevRowAvailable - Whether oldRow available.IgniteCheckedExceptionpublic void putIndexRow(IndexRowImpl row) throws IgniteCheckedException
row - Index row.IgniteCheckedExceptionpublic int inlineSize()
inlineSize in interface InlineIndexpublic IndexKeyTypeSettings keyTypeSettings()
public int segmentsCount()
segmentsCount in interface SortedSegmentedIndexpublic int segmentForRow(CacheDataRow row)
row - Сache row.public static int calculateSegment(int segmentsCnt,
int part)
segmentsCnt - Сount of segments in cache.part - Partition.public boolean created()
true if index is created and false if it is restored from disk.created in interface InlineIndexpublic InlineIndexTree segment(int segment)
segment in interface InlineIndexsegment - Number of tree segment.public void destroy(boolean softDel)
public boolean canHandle(CacheDataRow row) throws IgniteCheckedException
canHandle in interface Indexrow - Cache row.IgniteCheckedExceptionpublic SortedIndexDefinition indexDefinition()
indexDefinition in interface InlineIndex
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.15.0 Release Date : April 25 2023