Class ColumnRegionObjectCached<T,ATTR extends Attributes.Values,OFFSET_LOOKUP_CACHE extends OffsetLookupCache<T,ChunkSource.FillContext>>
java.lang.Object
com.illumon.iris.db.v2.sources.regioned.ColumnRegionObjectCached<T,ATTR,OFFSET_LOOKUP_CACHE>
- All Implemented Interfaces:
ChunkSource<ATTR>
,DefaultChunkSource<ATTR>
,FillContextMaker
,GetContextMaker
,Page<ATTR>
,Page.WithDefaults<ATTR>
,PagingChunkSource<ATTR>
,ColumnRegion<ATTR>
,ColumnRegionObject<T,
,ATTR> Releasable
,OffsetLookup<T,
ChunkSource.FillContext>
public final class ColumnRegionObjectCached<T,ATTR extends Attributes.Values,OFFSET_LOOKUP_CACHE extends OffsetLookupCache<T,ChunkSource.FillContext>>
extends Object
implements ColumnRegionObject<T,ATTR>, OffsetLookup<T,ChunkSource.FillContext>, Page.WithDefaults<ATTR>
Column region interface for regions that support fetching objects.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
ColumnRegionObjectCached.CacheFactory<T,
OFFSET_LOOKUP_CACHE extends OffsetLookupCache<T, ChunkSource.FillContext>> 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.ColumnRegionObject
ColumnRegionObject.DictionaryKeysWrapper, ColumnRegionObject.IntDictionaryKeysWrapper, ColumnRegionObject.Null<T,
ATTR extends Attributes.Any> Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
DefaultChunkSource.SupportsContiguousGet<ATTR extends Attributes.Any>, DefaultChunkSource.WithPrev<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
-
Constructor Summary
ConstructorsConstructorDescriptionColumnRegionObjectCached
(ColumnRegionObjectCached.CacheFactory<T, OFFSET_LOOKUP_CACHE> cacheFactory, FillContextMaker fillContextMaker, ColumnRegionObject<T, ATTR> innerRegion) -
Method Summary
Modifier and TypeMethodDescriptionbinSearchMatch
(long firstKey, long lastKey, SortPair sortPair, Object[] keys) Given that this column is sorted, match the input keys using a binary search.chunkMatch
(long regionFirstKey, OrderedKeys keysToFilter, boolean caseInsensitive, boolean invertMatch, Object[] keys) boolean
couldInclude
(Object[] keys) Check if the region could possibly include any of the keys we're searching forvoid
fillChunkAppend
(ChunkSource.FillContext context, WritableChunk<? super ATTR> destination, OrderedKeys orderedKeys) Appends the values referenced byorderKeys
ontodestination
.getCache()
Get a view of this region as long dictionary keys.Get a view of this region as int dictionary keys.Get a view of this region as dictionary values.Class<?>
getObject
(long elementIndex) Get a single object from this region.getObject
(ChunkSource.FillContext context, long elementIndex) Get a single object from this region.long
length()
lookup
(long offset, ChunkSource.FillContext fillContext) void
Release any resources held for caching purposes.Get a version of this region that skips all internal value caching.supportsDictionaryFormat
(ReadOnlyIndex.SearchIterator keysToVisit) Check if this region can expose an alternate form as paired regions oflong
keys andDATA_TYPE
values covering all of its row keys inkeysToVisit
.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, specialMatch, supportsSpecialMatching
Methods inherited from interface com.illumon.iris.db.v2.sources.regioned.ColumnRegionObject
gatherDictionaryValuesRowSet
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeFillContext, makeGetContext
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.Page.WithDefaults
fillChunk, fillChunkAppend
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.page.PagingChunkSource
maxRow
-
Constructor Details
-
ColumnRegionObjectCached
public ColumnRegionObjectCached(@NotNull ColumnRegionObjectCached.CacheFactory<T, OFFSET_LOOKUP_CACHE> cacheFactory, @Nullable FillContextMaker fillContextMaker, @NotNull ColumnRegionObject<T, ATTR> innerRegion)
-
-
Method Details
-
getCache
-
getObject
Description copied from interface:ColumnRegionObject
Get a single object from this region.- Specified by:
getObject
in interfaceColumnRegionObject<T,
ATTR extends Attributes.Values> - Parameters:
context
- AColumnRegionFillContext
to enable resource caching where suitable, with current region index pointing to this regionelementIndex
- Element (object) index in the table's address space- Returns:
- The object value at the specified element (object) index
-
getObject
Description copied from interface:ColumnRegionObject
Get a single object from this region.- Specified by:
getObject
in interfaceColumnRegionObject<T,
ATTR extends Attributes.Values> - Parameters:
elementIndex
- Element (object) index in the table's address space- Returns:
- The object value at the specified element (object) index
-
length
public long length() -
getNativeType
- Specified by:
getNativeType
in interfaceChunkSource<T>
- Specified by:
getNativeType
in interfaceColumnRegionObject<T,
ATTR extends Attributes.Values>
-
skipCache
Description copied from interface:ColumnRegionObject
Get a version of this region that skips all internal value caching.- Specified by:
skipCache
in interfaceColumnRegionObject<T,
ATTR extends Attributes.Values> - Returns:
- a view of this region that ignores any value caching.
-
fillChunkAppend
public void fillChunkAppend(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super ATTR> destination, @NotNull OrderedKeys orderedKeys) Description copied from interface:Page.WithDefaults
Appends the values referenced byorderKeys
ontodestination
.orderKeys
are assumed to be entirely contained on thisPage
.- Specified by:
fillChunkAppend
in interfacePage.WithDefaults<T>
-
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
-
lookup
- Specified by:
lookup
in interfaceOffsetLookup<T,
ATTR extends Attributes.Values>
-
getDictionaryValuesRegion
Description copied from interface:ColumnRegionObject
Get a view of this region as dictionary values.- Specified by:
getDictionaryValuesRegion
in interfaceColumnRegionObject<T,
ATTR extends Attributes.Values> - Returns:
- A dictionary values region as specified by
ColumnRegionObject.supportsDictionaryFormat(Index.SearchIterator)
-
getDictionaryKeysRegionInt
Description copied from interface:ColumnRegionObject
Get a view of this region as int dictionary keys.- Specified by:
getDictionaryKeysRegionInt
in interfaceColumnRegionObject<T,
ATTR extends Attributes.Values> - Returns:
- A dictionary keys region as specified by
ColumnRegionObject.supportsDictionaryFormat(Index.SearchIterator)
-
getDictionaryKeysRegion
Description copied from interface:ColumnRegionObject
Get a view of this region as long dictionary keys.- Specified by:
getDictionaryKeysRegion
in interfaceColumnRegionObject<T,
ATTR extends Attributes.Values> - Returns:
- A dictionary keys region as specified by
ColumnRegionObject.supportsDictionaryFormat(Index.SearchIterator)
-
getDictionaryRegionType
- Specified by:
getDictionaryRegionType
in interfaceColumnRegionObject<T,
ATTR extends Attributes.Values>
-
supportsDictionaryFormat
public RegionVisitResult supportsDictionaryFormat(@NotNull ReadOnlyIndex.SearchIterator keysToVisit) Description copied from interface:ColumnRegionObject
Check if this region can expose an alternate form as paired regions oflong
keys andDATA_TYPE
values covering all of its row keys inkeysToVisit
.Both alternate regions must use the same or smaller row key space as this one. Indices fetched from the keys region must represent valid element indices in the values region. Values regions must support
ColumnRegionObject.gatherDictionaryValuesRowSet(Index.SearchIterator, Index.Iterator, Index.SequentialBuilder)
.Use
ColumnRegionObject.getDictionaryKeysRegion()
to access the region of keys andColumnRegionObject.getDictionaryValuesRegion()
to access the region of values.- Specified by:
supportsDictionaryFormat
in interfaceColumnRegionObject<T,
ATTR extends Attributes.Values> - Parameters:
keysToVisit
- Iterator positioned at the first relevant row key belonging to this region. Will be advanced to after this region iftrue
is returned. No guarantee is made iffalse
is returned.- Returns:
- A
RegionVisitResult
specifyingFAILED
if this region cannot supply a dictionary,CONTINUE
if it can andkeysToVisit
is not exhausted, andCOMPLETE
if it can andkeysToVisit
is exhausted
-
getLocation
- Specified by:
getLocation
in interfaceColumnRegion<T>
-
binSearchMatch
public Index binSearchMatch(long firstKey, long lastKey, @NotNull SortPair sortPair, @NotNull Object[] keys) Description copied from interface:ColumnRegion
Given that this column is sorted, match the input keys using a binary search.- Specified by:
binSearchMatch
in interfaceColumnRegion<T>
- Parameters:
firstKey
- The first key to searchlastKey
- The last key to searchsortPair
- the sorting definitionkeys
- the keys to search for, in no particular order
-
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<T>
- Parameters:
keys
- 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[] keys) - Specified by:
chunkMatch
in interfaceColumnRegion<T>
-