Class DeferredColumnRegionBase<ATTR extends Attributes.Any,REGION_TYPE extends ColumnRegion<ATTR>>
java.lang.Object
com.illumon.iris.db.v2.sources.regioned.DeferredColumnRegionBase<ATTR,REGION_TYPE>
- All Implemented Interfaces:
ChunkSource<ATTR>
,FillContextMaker
,GetContextMaker
,Page<ATTR>
,PagingChunkSource<ATTR>
,ColumnRegion<ATTR>
,Releasable
- Direct Known Subclasses:
DeferredColumnRegionChar
,DeferredColumnRegionDouble
,DeferredColumnRegionFloat
,DeferredColumnRegionInt
,DeferredColumnRegionLong
,DeferredColumnRegionObject
,DeferredColumnRegionShort
public class DeferredColumnRegionBase<ATTR extends Attributes.Any,REGION_TYPE extends ColumnRegion<ATTR>>
extends Object
Base deferred region implementation.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
ChunkSource.FillContext, ChunkSource.GetContext, ChunkSource.WithPrev<ATTR extends Attributes.Any>
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.regioned.ColumnRegion
ColumnRegion.Null<ATTR extends Attributes.Any>
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.chunk.page.Page
Page.WithDefaults<ATTR extends Attributes.Any>, Page.WithDefaultsForRepeatingValues<ATTR extends Attributes.Any>
-
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAY
Fields inherited from interface com.illumon.iris.db.v2.sources.regioned.ColumnRegion
REGION_MASK
-
Method Summary
Modifier and TypeMethodDescriptionbinSearchMatch
(long firstKey, long lastKey, SortPair sortPair, Object[] sortedKeys) Given that this column is sorted, match the input keys using a binary search.chunkMatch
(long regionFirstKey, OrderedKeys keysToFilter, boolean caseInsensitive, boolean invertMatch, Object[] sortedKeys) boolean
couldInclude
(Object[] sortedKeys) Check if the region could possibly include any of the keys we're searching forvoid
fillChunk
(ChunkSource.FillContext context, WritableChunk<? super ATTR> destination, OrderedKeys orderedKeys) Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys
.void
fillChunkAppend
(ChunkSource.FillContext context, WritableChunk<? super ATTR> destination, OrderedKeys.Iterator orderedKeysIterator) Similar toChunkSource.fillChunk(FillContext, WritableChunk, OrderedKeys)
, except that the values from the ChunkSource are appended todestination
, rather than placed at the beginning.getChunk
(ChunkSource.GetContext context, long firstKey, long lastKey) Same asChunkSource.getChunk(GetContext, OrderedKeys)
, except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anOrderedKeys
.getChunk
(ChunkSource.GetContext context, OrderedKeys orderedKeys) Returns a chunk of data corresponding to the keys from the givenOrderedKeys
.Class<?>
final REGION_TYPE
long
length()
makeFillContext
(int chunkCapacity, SharedContext sharedContext) Allocate a newChunkSource.FillContext
for filling chunks from thisFillContextMaker
, typically aChunkSource
.makeGetContext
(int chunkCapacity, SharedContext sharedContext) Allocate a newChunkSource.GetContext
for retrieving chunks from thisGetContextMaker
, typically aChunkSource
.void
Release any resources held for caching purposes.specialMatch
(OrderedKeys keysToFilter, long regionFirstKey, boolean caseInsensitive, boolean invertMatch, Object[] sortedKeys) IfColumnRegion.supportsSpecialMatching()
istrue
this method will perform matching in lieu of the standardRegionedColumnSourceBase.match(boolean, boolean, boolean, ReadOnlyIndex, Object...)
.boolean
Check if this region has special matching features.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
getChunkType
Methods inherited from interface com.illumon.iris.db.v2.sources.regioned.ColumnRegion
firstRowOffset, mask
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.FillContextMaker
makeFillContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.GetContextMaker
makeGetContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.page.Page
advanceToNextPage, advanceToNextPage, advanceToNextPageAndGetPositionDistance, firstRow, getRowOffset, lastRow
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.page.PagingChunkSource
maxRow
-
Method Details
-
getResultRegion
-
releaseCachedResources
@OverridingMethodsMustInvokeSuper public void releaseCachedResources()Description copied from interface:Releasable
Release any resources held for caching purposes. Implementations need not guarantee that they are safe for normal use concurrently with invocations of this method.- Specified by:
releaseCachedResources
in interfaceReleasable
-
getNativeType
- Specified by:
getNativeType
in interfaceChunkSource<ATTR extends Attributes.Any>
-
length
public long length()- Specified by:
length
in interfacePage<ATTR extends Attributes.Any>
- Returns:
- the length of this page.
-
fillChunk
public void fillChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super ATTR> destination, @NotNull OrderedKeys orderedKeys) Description copied from interface:ChunkSource
Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys
.- Specified by:
fillChunk
in interfaceChunkSource<ATTR extends Attributes.Any>
- Parameters:
context
- A context containing all mutable/state related data used in retrieving the Chunk.destination
- The chunk to be populated according toorderedKeys
. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,orderedKeys.size()).orderedKeys
- AnOrderedKeys
representing the keys to be fetched
-
fillChunkAppend
public void fillChunkAppend(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super ATTR> destination, @NotNull OrderedKeys.Iterator orderedKeysIterator) Description copied from interface:PagingChunkSource
Similar to
ChunkSource.fillChunk(FillContext, WritableChunk, OrderedKeys)
, except that the values from the ChunkSource are appended todestination
, rather than placed at the beginning.The values to fill into
destination
are specified byorderedKeysIterator
, whoseOrderedKeys.firstKey()
must exist, and must be represented by thisPagingChunkSource
(modulo {#link @mask}), otherwise results are undefined.No more than the elements in
orderedKeysIterator
, which are on the same page asOrderedKeys.firstKey()
, have their values appended todestination
, and consumed fromorderedKeysIterator
. Keys are on the same page when the bits outside ofPagingChunkSource.mask()
are identical.- Specified by:
fillChunkAppend
in interfacePagingChunkSource<ATTR extends Attributes.Any>
- Parameters:
context
- A context containing all mutable/state related data used in retrieving the Chunk. In particular, the Context may be used to provide a Chunk data pooldestination
- The chunk to append the results to.orderedKeysIterator
- The iterator to the ordered keys, which contain at least the keys to extract from thisChunkSource
. The keys to extract will be at the beginning of iteration order.
-
getChunk
public Chunk<? extends ATTR> getChunk(@NotNull ChunkSource.GetContext context, @NotNull OrderedKeys orderedKeys) Description copied from interface:ChunkSource
Returns a chunk of data corresponding to the keys from the givenOrderedKeys
.- Specified by:
getChunk
in interfaceChunkSource<ATTR extends Attributes.Any>
- Parameters:
context
- A context containing all mutable/state related data used in retrieving the Chunk. In particular, the Context may be used to provide a Chunk data poolorderedKeys
- AnOrderedKeys
representing the keys to be fetched- Returns:
- A chunk of data corresponding to the keys from the given
OrderedKeys
-
getChunk
public Chunk<? extends ATTR> getChunk(@NotNull ChunkSource.GetContext context, long firstKey, long lastKey) Description copied from interface:ChunkSource
Same asChunkSource.getChunk(GetContext, OrderedKeys)
, except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anOrderedKeys
. Typically you want to call this only if you don't have anOrderedKeys
, such as during anOrderedKeys.forAllLongRanges(LongRangeConsumer)
call. In this case, it allows you to avoid creating an intermediaryOrderedKeys
object.- Specified by:
getChunk
in interfaceChunkSource<ATTR extends Attributes.Any>
- Parameters:
context
- A context containing all mutable/state related data used in retrieving the Chunk. In particular, the Context may be used to provide a Chunk data poolfirstKey
- The beginning key (inclusive) of the range to fetch in the chunklastKey
- The last key (inclusive) of the range to fetch in the chunk- Returns:
- A chunk of data corresponding to the keys from the given range.
-
getLocation
- Specified by:
getLocation
in interfaceColumnRegion<ATTR extends Attributes.Any>
-
binSearchMatch
public Index binSearchMatch(long firstKey, long lastKey, @NotNull SortPair sortPair, @NotNull Object[] sortedKeys) Description copied from interface:ColumnRegion
Given that this column is sorted, match the input keys using a binary search.- Specified by:
binSearchMatch
in interfaceColumnRegion<ATTR extends Attributes.Any>
- Parameters:
firstKey
- The first key to searchlastKey
- The last key to searchsortPair
- the sorting definitionsortedKeys
- the keys to search for, in no particular order
-
supportsSpecialMatching
public boolean supportsSpecialMatching()Description copied from interface:ColumnRegion
Check if this region has special matching features.- Specified by:
supportsSpecialMatching
in interfaceColumnRegion<ATTR extends Attributes.Any>
- Returns:
- true if this has special matching features
-
specialMatch
public Index specialMatch(@NotNull OrderedKeys keysToFilter, long regionFirstKey, boolean caseInsensitive, boolean invertMatch, @NotNull Object[] sortedKeys) Description copied from interface:ColumnRegion
IfColumnRegion.supportsSpecialMatching()
istrue
this method will perform matching in lieu of the standardRegionedColumnSourceBase.match(boolean, boolean, boolean, ReadOnlyIndex, Object...)
.- Specified by:
specialMatch
in interfaceColumnRegion<ATTR extends Attributes.Any>
- Parameters:
keysToFilter
- the keys being filteredregionFirstKey
- the first key within this regioncaseInsensitive
- if the match is case insensitiveinvertMatch
- if the match should be invertedsortedKeys
- the keys to search for, in no particular order- Returns:
- an index of matched rows
-
couldInclude
Description copied from interface:ColumnRegion
Check if the region could possibly include any of the keys we're searching for- Specified by:
couldInclude
in interfaceColumnRegion<ATTR extends Attributes.Any>
- Parameters:
sortedKeys
- the keys to search for- Returns:
- true if the region possibly contains the values
-
chunkMatch
public Index chunkMatch(long regionFirstKey, @NotNull OrderedKeys keysToFilter, boolean caseInsensitive, boolean invertMatch, @NotNull Object[] sortedKeys) - Specified by:
chunkMatch
in interfaceColumnRegion<ATTR extends Attributes.Any>
-