Package io.deephaven.engine.rowset.impl
Class RspBitmapBuilderSequential
java.lang.Object
io.deephaven.engine.rowset.impl.RspBitmapBuilderSequential
- All Implemented Interfaces:
OrderedLongSet.BuilderSequential,LongRangeConsumer
- Direct Known Subclasses:
OrderedLongSetBuilderSequential
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected longThe greatest key moved out of the pending range, intopendingContainerorrb, or -1 when it is not known.protected longprotected Containerprotected longprotected longprotected longprotected RspBitmapFields inherited from interface io.deephaven.engine.rowset.impl.OrderedLongSet.BuilderSequential
check, outOfOrderKeyErrorMsg -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendKey(long rowKey) voidappendOrderedLongSet(long shiftAmount, OrderedLongSet ix) voidappendOrderedRowKeysChunk(LongChunk<OrderedRowKeys> chunk, int offset, int length) voidappendRange(long rangeFirstRowKey, long rangeLastRowKey) protected final voidAppend the ranges ofsr, which must all come after every key this builder holds.static RspBitmapbuildRsp(SortedRanges sr) AnRspBitmapholding the keys ofsr, with each container created at its final size and in the representation that suits it.protected final voidBuilders are single use: a second build fails instead.protected booleanCalled whenix, a bitmap whose spans could be shared, is appended beforerbexists: create rb now, so that they are, or leave it and haveixappended a range at a time.protected voidprotected voidprotected voidflushRangeToPendingContainer(long start, long end) voidsetDomain(long minRowKey, long maxRowKey) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.engine.rowset.impl.OrderedLongSet.BuilderSequential
accept
-
Field Details
-
disposable
protected final boolean disposable -
pendingStart
protected long pendingStart -
pendingEnd
protected long pendingEnd -
pendingContainerKey
protected long pendingContainerKey -
pendingContainer
-
rb
-
maxKeyHint
protected long maxKeyHint -
lastFlushedKey
protected long lastFlushedKeyThe greatest key moved out of the pending range, intopendingContainerorrb, or -1 when it is not known. Order checks againstrbuse this rather thanrb.lastValue(), which has to scan a bitmap container backward over the words past its last value.
-
-
Constructor Details
-
RspBitmapBuilderSequential
public RspBitmapBuilderSequential() -
RspBitmapBuilderSequential
public RspBitmapBuilderSequential(boolean disposable)
-
-
Method Details
-
checkAndMarkBuilt
protected final void checkAndMarkBuilt()Builders are single use: a second build fails instead. Only the build methods check this; appends stay unchecked to keep the hot path free of conditionals, so the effect of appending after a build is undefined rather than detected. -
setDomain
public void setDomain(long minRowKey, long maxRowKey) - Specified by:
setDomainin interfaceOrderedLongSet.BuilderSequential
-
getOrderedLongSet
- Specified by:
getOrderedLongSetin interfaceOrderedLongSet.BuilderSequential
-
appendKey
public void appendKey(long rowKey) - Specified by:
appendKeyin interfaceOrderedLongSet.BuilderSequential
-
appendRange
public void appendRange(long rangeFirstRowKey, long rangeLastRowKey) - Specified by:
appendRangein interfaceOrderedLongSet.BuilderSequential
-
appendOrderedLongSet
- Specified by:
appendOrderedLongSetin interfaceOrderedLongSet.BuilderSequential
-
commitToBitmapFor
Called whenix, a bitmap whose spans could be shared, is appended beforerbexists: create rb now, so that they are, or leave it and haveixappended a range at a time.This builder's result is a bitmap whatever it holds, so it always creates rb. A builder that can produce another representation decides whether giving that up pays.
- Returns:
- Whether rb now exists
-
appendOrderedRowKeysChunk
- Specified by:
appendOrderedRowKeysChunkin interfaceOrderedLongSet.BuilderSequential
-
flushPendingRange
protected void flushPendingRange() -
flushRangeToPendingContainer
protected void flushRangeToPendingContainer(long start, long end) -
appendSortedRangesSizingBlocks
Append the ranges ofsr, which must all come after every key this builder holds.Every range is already known, so rather than growing each container one range at a time -- which reallocates its backing storage as it fills, and may pass through representations it does not end in -- we walk two cursors over the ranges. One feeds ranges to the builder; the other runs ahead to the end of the block being started, so the container for it can be created at its final size and in the representation that suits it.
-
buildRsp
AnRspBitmapholding the keys ofsr, with each container created at its final size and in the representation that suits it. -
flushPendingContainer
protected void flushPendingContainer()
-