Package com.illumon.iris.db.v2.sources
Class DoubleSparseArraySource
java.lang.Object
com.illumon.iris.db.v2.sources.AbstractColumnSource<T>
com.illumon.iris.db.v2.sources.SparseArrayColumnSource<Double>
com.illumon.iris.db.v2.sources.DoubleSparseArraySource
- All Implemented Interfaces:
ChunkSource<Attributes.Values>
,ChunkSource.WithPrev<Attributes.Values>
,DefaultChunkSource<Attributes.Values>
,DefaultChunkSource.WithPrev<Attributes.Values>
,FillContextMaker
,GetContextMaker
,ColumnSource<Double>
,ColumnSourceGetDefaults.ForDouble
,ElementSource<Double>
,FillUnordered
,MutableColumnSource<Double>
,MutableColumnSourceGetDefaults.ForDouble
,Releasable
,WritableChunkSink<Attributes.Values>
,WritableSource<Double>
,TupleExporter<Double>
,TupleSource<Double>
,Serializable
public class DoubleSparseArraySource
extends SparseArrayColumnSource<Double>
implements MutableColumnSourceGetDefaults.ForDouble
Sparse array source for Double.
The C-haracterSparseArraySource is replicated to all other types with com.illumon.iris.db.v2.sources.Replicate. (C-haracter is deliberately spelled that way in order to prevent Replicate from altering this very comment).
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.db.v2.sources.SparseArrayColumnSource
SparseArrayColumnSource.FillByContext<UArray>
Nested classes/interfaces inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
AbstractColumnSource.DefaultedImmutable<DATA_TYPE>, AbstractColumnSource.DefaultedMutable<DATA_TYPE>, AbstractColumnSource.IsSerializable
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.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.WritableChunkSink
WritableChunkSink.FillFromContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DoubleOneOrN.Block0
protected DoubleOneOrN.Block0
protected UpdateCommitter<DoubleSparseArraySource>
The presence of a prevFlusher means that this ArraySource wants to track previous values.Fields inherited from class com.illumon.iris.db.v2.sources.SparseArrayColumnSource
ZERO_LENGTH_SPARSE_ARRAY_COLUMN_SOURCE_ARRAY
Fields inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
componentType, type
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.chunk.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAY
Fields inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
ZERO_LENGTH_COLUMN_SOURCE_ARRAY
Fields inherited from interface com.illumon.iris.db.v2.sources.WritableChunkSink
DEFAULT_FILL_FROM_INSTANCE
Fields inherited from interface com.illumon.iris.db.v2.sources.WritableSource
ZERO_LENGTH_WRITABLE_SOURCE_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
copy
(ColumnSource<Double> sourceColumn, long sourceKey, long destKey) void
ensureCapacity
(long capacity) void
fillFromChunkUnordered
(WritableChunkSink.FillFromContext context, Chunk<? extends Attributes.Values> src, LongChunk<Attributes.KeyIndices> keys) Fills the ChunkSink with data from the source, with data corresponding to the keys from the given key chunk.void
fillPrevChunk
(ChunkSource.FillContext context, WritableChunk<? super Attributes.Values> dest, OrderedKeys orderedKeys) Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys
.get
(long index) Get the value from the source.getChunk
(ChunkSource.GetContext context, OrderedKeys orderedKeys) Returns a chunk of data corresponding to the keys from the givenOrderedKeys
.final double
getDouble
(long index) Get the value at the index as a double.getPrev
(long index) Get the previous value at the index.getPrevChunk
(ChunkSource.GetContext context, OrderedKeys orderedKeys) Returns a chunk of previous data corresponding to the keys from the givenOrderedKeys
.final double
getPrevDouble
(long index) Get the previous value at the index as a double.final void
set
(long key, double value) void
void
setNull
(long key) void
shift
(ReadOnlyIndex keysToShift, long shiftDelta) void
ColumnSource implementations that track previous values have the option to not actually start tracking previous values until this method is called.Methods inherited from class com.illumon.iris.db.v2.sources.SparseArrayColumnSource
fillChunk, fillChunkUnordered, fillFromChunk, fillPrevChunkUnordered, getDateTimeMemoryColumnSource, getPreferredChunkSize, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, getSparseMemoryColumnSource, isImmutable, makeFillFromContext, remove, set, set, set, set, set, set, setImmutable, setNull
Methods inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
allowsReinterpret, canUseGrouping, defaultFillChunk, doReinterpret, getComponentType, getGroupingBuilder, getGroupingProvider, getNativeType, getType, hasGrouping, isSerializable, match, matchWithGrouping, reinterpret, setGroupingProvider
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
fillChunk, getChunkType
Methods inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
allowsReinterpret, cast, createPreviousTuple, createTuple, createTupleFromValues, exportElement, exportElement, exportToExternalKey, getColumnSources, getComponentType, getGroupingBuilder, getGroupingProvider, getNativeType, getPrevSource, getType, hasGrouping, match, reinterpret, releaseCachedResources, setGroupingProvider
Methods inherited from interface com.illumon.iris.db.v2.sources.ColumnSourceGetDefaults.ForDouble
getBoolean, getByte, getChar, getFloat, getInt, getLong, getShort
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunkByFilling, makeFillContext, makeGetContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunkByFilling
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.MutableColumnSource
isImmutable
Methods inherited from interface com.illumon.iris.db.v2.sources.MutableColumnSourceGetDefaults.ForDouble
getPrevBoolean, getPrevByte, getPrevChar, getPrevFloat, getPrevInt, getPrevLong, getPrevShort
Methods inherited from interface com.illumon.iris.db.v2.tuples.TupleExporter
exportElementReinterpreted
Methods inherited from interface com.illumon.iris.db.v2.tuples.TupleSource
createTupleFromReinterpretedValues
-
Field Details
-
prevFlusher
The presence of a prevFlusher means that this ArraySource wants to track previous values. If prevFlusher is null, the ArraySource does not want (or does not yet want) to track previous values. Deserialized ArraySources never track previous values. -
blocks
-
prevBlocks
-
-
Constructor Details
-
DoubleSparseArraySource
public DoubleSparseArraySource()
-
-
Method Details
-
ensureCapacity
public void ensureCapacity(long capacity) - Specified by:
ensureCapacity
in interfaceWritableSource<Double>
-
setNull
public void setNull(long key) - Specified by:
setNull
in interfaceWritableSource<Double>
-
set
public final void set(long key, double value) - Specified by:
set
in interfaceWritableSource<Double>
- Overrides:
set
in classSparseArrayColumnSource<Double>
-
shift
- Overrides:
shift
in classSparseArrayColumnSource<Double>
-
set
- Specified by:
set
in interfaceWritableSource<Double>
-
get
Description copied from interface:ElementSource
Get the value from the source. This may return boxed values for basic types.- Specified by:
get
in interfaceColumnSourceGetDefaults.ForDouble
- Specified by:
get
in interfaceElementSource<Double>
- Parameters:
index
- the location in index space to get the value from.- Returns:
- the value at the index, potentially null.
-
getPrev
Description copied from interface:ElementSource
Get the previous value at the index. Previous values are used during anLTM
update
cycle to process changes in data. Duringnormal
operation previous values will be identical tocurrent
values.- Specified by:
getPrev
in interfaceElementSource<Double>
- Specified by:
getPrev
in interfaceMutableColumnSourceGetDefaults.ForDouble
- Parameters:
index
- the location in index space to get the value from.- Returns:
- the previous value at the index, or null.
-
copy
- Specified by:
copy
in interfaceWritableSource<Double>
-
getDouble
public final double getDouble(long index) Description copied from interface:ElementSource
Get the value at the index as a double.- Specified by:
getDouble
in interfaceElementSource<Double>
- Parameters:
index
- the location in index space to get the value from.- Returns:
- the double at the index, null values are represented by
QueryConstants.NULL_DOUBLE
-
getPrevDouble
public final double getPrevDouble(long index) Description copied from interface:ElementSource
Get the previous value at the index as a double. SeeElementSource.getPrev(long)
for more details.- Specified by:
getPrevDouble
in interfaceElementSource<Double>
- Parameters:
index
- the location in index space to get the previous value from.- Returns:
- the previous double at the index, null values are represented by
QueryConstants.NULL_DOUBLE
-
startTrackingPrevValues
public void startTrackingPrevValues()Description copied from interface:ColumnSource
ColumnSource implementations that track previous values have the option to not actually start tracking previous values until this method is called. This is an option, not an obligation: some simple ColumnSource implementations (like TSingleValueSource for various T) always track previous values; other implementations (like PrevColumnSource) never do; some (like TArrayColumnSource) only start tracking once this method is called. An immutable column source can not have distinct prev values; therefore it is implemented as a no-op.- Specified by:
startTrackingPrevValues
in interfaceColumnSource<Double>
-
fillFromChunkUnordered
public void fillFromChunkUnordered(@NotNull WritableChunkSink.FillFromContext context, @NotNull Chunk<? extends Attributes.Values> src, @NotNull LongChunk<Attributes.KeyIndices> keys) Description copied from interface:WritableChunkSink
Fills the ChunkSink with data from the source, with data corresponding to the keys from the given key chunk.- Specified by:
fillFromChunkUnordered
in interfaceWritableChunkSink<Attributes.Values>
- Specified by:
fillFromChunkUnordered
in interfaceWritableSource<Double>
- Parameters:
context
- A context containing all mutable/state related data used in writing the Chunk.src
- The source of the dataorderedKeys
keys
- ALongChunk
representing the keys to be written
-
fillPrevChunk
public void fillPrevChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Attributes.Values> dest, @NotNull OrderedKeys orderedKeys) Description copied from interface:ChunkSource.WithPrev
Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys
.- Specified by:
fillPrevChunk
in interfaceChunkSource.WithPrev<Attributes.Values>
- Overrides:
fillPrevChunk
in classAbstractColumnSource<Double>
- Parameters:
context
- A context containing all mutable/state related data used in retrieving the Chunk.dest
- 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
-
getChunk
public DoubleChunk<Attributes.Values> 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<Attributes.Values>
- Specified by:
getChunk
in interfaceDefaultChunkSource<Attributes.Values>
- 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
-
getPrevChunk
public DoubleChunk<Attributes.Values> getPrevChunk(@NotNull ChunkSource.GetContext context, @NotNull OrderedKeys orderedKeys) Description copied from interface:ChunkSource.WithPrev
Returns a chunk of previous data corresponding to the keys from the givenOrderedKeys
.- Specified by:
getPrevChunk
in interfaceChunkSource.WithPrev<Attributes.Values>
- Specified by:
getPrevChunk
in interfaceDefaultChunkSource.WithPrev<Attributes.Values>
- 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
.
-