Class ObjectTestSource<T>
java.lang.Object
com.illumon.iris.db.v2.sources.AbstractColumnSource<T>
io.deephaven.engine.testutil.v2.sources.ObjectTestSource<T>
- All Implemented Interfaces:
ChunkSource<Attributes.Values>,ChunkSource.WithPrev<Attributes.Values>,DefaultChunkSource<Attributes.Values>,DefaultChunkSource.WithPrev<Attributes.Values>,FillContextMaker,GetContextMaker,ColumnSource<T>,ColumnSourceGetDefaults.ForObject<T>,ElementSource<T>,MutableColumnSource<T>,MutableColumnSourceGetDefaults.ForObject<T>,Releasable,TupleExporter<T>,TupleSource<T>,TestColumnSource<T>,Serializable
public class ObjectTestSource<T>
extends AbstractColumnSource<T>
implements MutableColumnSourceGetDefaults.ForObject<T>, TestColumnSource<T>
The ObjectTestSource is a ColumnSource used only for testing; not in live code.
It uses a fastutil open addressed hash map from long Index keys to Object values. Previous data is stored in a
completely separate map, which is copied from the primary map on the first change in a given cycle. If an
uninitialized key is accessed; then an IllegalStateException is thrown. The previous value map is discarded in
an UpdateCommitter using a TerminalNotification after the live table
monitor cycle is complete.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
AbstractColumnSource.DefaultedImmutable<DATA_TYPE>, AbstractColumnSource.DefaultedMutable<DATA_TYPE>, AbstractColumnSource.IsSerializableNested 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> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final io.deephaven.shadow.fastutil.it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<T>protected io.deephaven.shadow.fastutil.it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<T>Fields inherited from class com.illumon.iris.db.v2.sources.AbstractColumnSource
componentType, typeFields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAYFields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAYFields inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
ZERO_LENGTH_COLUMN_SOURCE_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionObjectTestSource(Class<T> type) ObjectTestSource(Class<T> type, ReadOnlyIndex index, Chunk<Attributes.Values> data) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ReadOnlyIndex index, Chunk<Attributes.Values> vs) Add the chunk of data, parallel to index to this column source.voidcheckIndex(Index index) static voidflushPrevious(ObjectTestSource source) get(long index) Get the value from the source.getPrev(long index) Get the previous value at the index.booleanDetermine if this column source is immutable, meaning that the values at a given index key never change.voidremove(ReadOnlyIndex index) Remove the given index from the column source.voidshift(long startKeyInclusive, long endKeyInclusive, long shiftDelta) Move data within the column source.voidColumnSource 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.AbstractColumnSource
allowsReinterpret, canUseGrouping, defaultFillChunk, doReinterpret, fillChunk, fillPrevChunk, getComponentType, getGroupingBuilder, getGroupingProvider, getNativeType, getType, hasGrouping, hasGrouping, isSerializable, match, matchWithGrouping, reinterpret, setGroupingProviderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
fillChunk, getChunkTypeMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
fillPrevChunkMethods 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, hasGrouping, match, reinterpret, releaseCachedResources, setGroupingProviderMethods inherited from interface com.illumon.iris.db.v2.sources.ColumnSourceGetDefaults.ForObject
getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getShortMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeFillContext, makeGetContextMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunk, getPrevChunkByFillingMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.FillContextMaker
makeFillContextMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.GetContextMaker
makeGetContextMethods inherited from interface com.illumon.iris.db.v2.sources.MutableColumnSourceGetDefaults.ForObject
getPrevBoolean, getPrevByte, getPrevChar, getPrevDouble, getPrevFloat, getPrevInt, getPrevLong, getPrevShortMethods inherited from interface com.illumon.iris.db.v2.tuples.TupleExporter
exportElementReinterpretedMethods inherited from interface com.illumon.iris.db.v2.tuples.TupleSource
createTupleFromReinterpretedValues
-
Field Details
-
Constructor Details
-
ObjectTestSource
-
ObjectTestSource
-
-
Method Details
-
checkIndex
-
add
Description copied from interface:TestColumnSourceAdd the chunk of data, parallel to index to this column source.For TestColumnSources with primitive types, the chunk of data must either be of the appropriate primitive type or an
ObjectChunkcontaining boxed values.- Specified by:
addin interfaceTestColumnSource<T>- Parameters:
index- the index locations to add the datavs- the data to add
-
remove
Description copied from interface:TestColumnSourceRemove the given index from the column source.- Specified by:
removein interfaceTestColumnSource<T>- Parameters:
index- the keys to remove
-
shift
public void shift(long startKeyInclusive, long endKeyInclusive, long shiftDelta) Description copied from interface:TestColumnSourceMove data within the column source.- Specified by:
shiftin interfaceTestColumnSource<T>- Parameters:
startKeyInclusive- the first key to shiftendKeyInclusive- the last key to shiftshiftDelta- how far to shift the data (either positive or negative)
-
get
Description copied from interface:ElementSourceGet the value from the source. This may return boxed values for basic types.- Specified by:
getin interfaceElementSource<T>- Parameters:
index- the location in index space to get the value from.- Returns:
- the value at the index, potentially null.
-
isImmutable
public boolean isImmutable()Description copied from interface:ColumnSourceDetermine if this column source is immutable, meaning that the values at a given index key never change.- Specified by:
isImmutablein interfaceColumnSource<T>- Specified by:
isImmutablein interfaceMutableColumnSource<T>- Returns:
- true if the values at a given index of the column source never change, false otherwise
-
getPrev
Description copied from interface:ElementSourceGet the previous value at the index. Previous values are used during anLTMupdatecycle to process changes in data. Duringnormaloperation previous values will be identical tocurrentvalues.- Specified by:
getPrevin interfaceElementSource<T>- Parameters:
index- the location in index space to get the value from.- Returns:
- the previous value at the index, or null.
-
flushPrevious
-
startTrackingPrevValues
public void startTrackingPrevValues()Description copied from interface:ColumnSourceColumnSource 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:
startTrackingPrevValuesin interfaceColumnSource<T>
-