Search in sources :

Example 1 with IgniteTree

use of org.apache.ignite.internal.util.IgniteTree in project ignite by apache.

the class GridH2TreeIndex method doFind.

/**
     * Returns sub-tree bounded by given values.
     *
     * @param first Lower bound.
     * @param includeFirst Whether lower bound should be inclusive.
     * @param last Upper bound always inclusive.
     * @return Iterator over rows in given range.
     */
@SuppressWarnings("unchecked")
private GridCursor<GridH2Row> doFind(@Nullable SearchRow first, boolean includeFirst, @Nullable SearchRow last) {
    int seg = threadLocalSegment();
    IgniteTree t = treeForRead(seg);
    return doFind0(t, first, includeFirst, last, threadLocalFilter());
}
Also used : IgniteTree(org.apache.ignite.internal.util.IgniteTree)

Example 2 with IgniteTree

use of org.apache.ignite.internal.util.IgniteTree in project ignite by apache.

the class GridH2TreeIndex method findFirstOrLast.

/** {@inheritDoc} */
@Override
public Cursor findFirstOrLast(Session ses, boolean first) {
    try {
        int seg = threadLocalSegment();
        IgniteTree t = treeForRead(seg);
        GridH2Row row = (GridH2Row) (first ? t.findFirst() : t.findLast());
        return new SingleRowCursor(row);
    } catch (IgniteCheckedException e) {
        throw DbException.convert(e);
    }
}
Also used : IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteTree(org.apache.ignite.internal.util.IgniteTree) SingleRowCursor(org.h2.index.SingleRowCursor)

Aggregations

IgniteTree (org.apache.ignite.internal.util.IgniteTree)2 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)1 SingleRowCursor (org.h2.index.SingleRowCursor)1