org.apache.ignite.internal.cache.query.index.sorted

## Interface SortedSegmentedIndex

All Superinterfaces:
  Index

All Known Subinterfaces:
  InlineIndex

All Known Implementing Classes:
  ClientInlineIndex, InlineIndexImpl

    public interface SortedSegmentedIndex
    extends Index

Interface for sorted and segmented Ignite indexes.

### Method Summary

All Methods Instance Methods Abstract Methods
`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.
`GridCursor<IndexRow>` `find(@Nullable IndexRow lower, @Nullable IndexRow upper, boolean lowerIncl, boolean upperIncl, IndexQueryContext qryCtx)` Finds index rows by specified range in all tree segments with cache filtering.
`GridCursor<IndexRow>` `find(@Nullable IndexRow lower, @Nullable IndexRow upper, boolean lowerIncl, boolean upperIncl, 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.
`int` `segmentsCount()` Returns amount of index tree segments.
`long` `totalCount()` Counts index rows for all segments.

### Methods inherited from interface org.apache.ignite.internal.cache.query.index.Index

`canHandle, destroy, id, name, onUpdate, unwrap`

### Method Detail

#### find

    GridCursor<IndexRow> find(@Nullable
                              @Nullable IndexRow lower,
                              @Nullable
                              @Nullable IndexRow upper,
                              boolean lowerIncl,
                              boolean upperIncl,
                              int segment,
                              IndexQueryContext qryCtx)
                       throws IgniteCheckedException

Finds index rows by specified range in specifed tree segment with cache filtering. Range can be bound or unbound.

Parameters:
  `lower` - Nullable lower bound.
  `upper` - Nullable upper bound.
  `lowerIncl` - `true` for inclusive lower bound, otherwise `false`.
  `upperIncl` - `true` for inclusive upper bound, otherwise `false`.
  `segment` - Number of tree segment to find.
  `qryCtx` - External index query context.
Returns:
  Cursor of found index rows.
Throws:
  `IgniteCheckedException`

#### find

    GridCursor<IndexRow> find(@Nullable
                              @Nullable IndexRow lower,
                              @Nullable
                              @Nullable IndexRow upper,
                              boolean lowerIncl,
                              boolean upperIncl,
                              IndexQueryContext qryCtx)
                       throws IgniteCheckedException

Finds index rows by specified range in all tree segments with cache filtering. Range can be bound or unbound.

Parameters:
  `lower` - Nullable lower bound.
  `upper` - Nullable upper bound.
  `lowerIncl` - `true` for inclusive lower bound, otherwise `false`.
  `upperIncl` - `true` for inclusive upper bound, otherwise `false`.
  `qryCtx` - External index query context.
Returns:
  Cursor of found index rows.
Throws:
  `IgniteCheckedException`

#### findFirst

    GridCursor<IndexRow> findFirst(int segment,
                                   IndexQueryContext qryCtx)
                            throws IgniteCheckedException

Finds first index row for specified tree segment and cache filter.

Parameters:
  `segment` - Number of tree segment to find.
  `qryCtx` - External index qyery context.
Returns:
  Cursor of found index rows.
Throws:
  `IgniteCheckedException`

#### findLast

    GridCursor<IndexRow> findLast(int segment,
                                  IndexQueryContext qryCtx)
                           throws IgniteCheckedException

Finds last index row for specified tree segment and cache filter.

Parameters:
  `segment` - Number of tree segment to find.
  `qryCtx` - External index qyery context.
Returns:
  Cursor of found index rows.
Throws:
  `IgniteCheckedException`

#### findFirstOrLast

    GridCursor<IndexRow> findFirstOrLast(IndexQueryContext qryCtx,
                                         boolean first)
                                  throws IgniteCheckedException

Takes only one first or last index record.

Parameters:
  `qryCtx` - External index qyery context.
  `first` - `True` to take first index value. `False` to take last index value.
Throws:
  `IgniteCheckedException`

#### count

    long count(int segment)
        throws IgniteCheckedException

Counts index rows in specified tree segment.

Parameters:
  `segment` - Number of tree segment to find.
Returns:
  count of index rows for specified segment.
Throws:
  `IgniteCheckedException`

#### count

    long count(int segment,
               IndexQueryContext qryCtx)
        throws IgniteCheckedException

Counts index rows in specified tree segment with cache filter.

Parameters:
  `segment` - Number of tree segment to find.
  `qryCtx` - Index query context.
Returns:
  count of index rows for specified segment.
Throws:
  `IgniteCheckedException`

#### totalCount

    long totalCount()
             throws IgniteCheckedException

Counts index rows for all segments.

Returns:
  total count of index rows.
Throws:
  `IgniteCheckedException`

#### segmentsCount

    int segmentsCount()

Returns amount of index tree segments.

Returns:
  amount of index tree segments.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.16.0
Release Date | : December 15 2023