Class RankCursor
Container.select(int), Container.find(short) and Container.getShortRangeIterator(int) on a
BitmapContainer count words from the start of the bitmap on every call, and on a RunContainer count
runs from the first run, so a loop asking about consecutive ranks or values in one container does work proportional
to the square of the number of queries. This cursor remembers the word or run it last stopped at, together with the
number of values before it. A query at or beyond that point continues from there; one behind it starts over.
Ascending queries, the common case for bulk operations, cost the container's length once in total.
For the other container kinds these queries are already cheap, and the cursor delegates to the container.
The cursor's position describes the container as it was when reset(io.deephaven.engine.rowset.impl.rsp.container.Container) was called. A container mutated since
must be reset(io.deephaven.engine.rowset.impl.rsp.container.Container) again before the cursor is used. Cursors are not thread safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanintfind(short x) getShortRangeIterator(int rank) voidPoint the cursor at the start ofc.shortselect(int rank)
-
Constructor Details
-
RankCursor
public RankCursor()
-
-
Method Details
-
benefits
- Returns:
- whether queries on
cthrough a cursor save work over the container's own methods
-
reset
Point the cursor at the start ofc. -
container
- Returns:
- the container the cursor was last
reset(io.deephaven.engine.rowset.impl.rsp.container.Container)to, or null
-
select
public short select(int rank) -
find
public int find(short x) -
getShortRangeIterator
AsContainer.getShortRangeIterator(int). PreferContainer.getShortRangeIterator(int, RankCursor)from a call site that sees one container type: the iterator is then created at a single site inside the container's own method, where the JIT can inline and scalar-replace it, rather than at one of several sites here.
-