Class ImmutableFloatArraySource
java.lang.Object
io.deephaven.engine.table.impl.AbstractColumnSource<Float>
io.deephaven.engine.table.impl.sources.immutable.ImmutableFloatArraySource
- All Implemented Interfaces:
ChunkSink<Values>,ChunkSource<Values>,ChunkSource.WithPrev<Values>,ColumnSource<Float>,ElementSource<Float>,FillContextMaker,GetContextMaker,ColumnSourceGetDefaults.ForFloat,DefaultChunkSource<Values>,DefaultChunkSource.WithPrev<Values>,ImmutableColumnSource<Float>,ImmutableColumnSourceGetDefaults.ForFloat,PushdownFilterMatcher,ChunkedBackingStoreExposedWritableSource,FillUnordered<Values>,InMemoryColumnSource,Releasable,TupleExporter<Float>,TupleSource<Float>,WritableColumnSource<Float>,WritableSourceWithPrepareForParallelPopulation
public class ImmutableFloatArraySource
extends AbstractColumnSource<Float>
implements ImmutableColumnSourceGetDefaults.ForFloat, WritableColumnSource<Float>, FillUnordered<Values>, InMemoryColumnSource, ChunkedBackingStoreExposedWritableSource, WritableSourceWithPrepareForParallelPopulation
Simple flat array source that supports fillFromChunk for initial creation.
No previous value tracking is permitted, so this column source is only useful as a flat static source.
A single array backs the result, so getChunk calls with contiguous ranges should always be able to return a reference
to the backing store without an array copy. The immediate consequence is that you may not create sources that have a
capacity larger than the maximum capacity of an array.
If your size is greater than the maximum capacity of an array, prefer
Immutable2DFloatArraySource.-
Nested Class Summary
Nested classes/interfaces inherited from class io.deephaven.engine.table.impl.AbstractColumnSource
AbstractColumnSource.DefaultedImmutable<DATA_TYPE>, AbstractColumnSource.DefaultedMutable<DATA_TYPE>Nested classes/interfaces inherited from interface io.deephaven.engine.table.ChunkSink
ChunkSink.FillFromContextNested classes/interfaces inherited from interface io.deephaven.engine.table.ChunkSource
ChunkSource.FillContext, ChunkSource.GetContext, ChunkSource.WithPrev<ATTR extends Any>Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource
DefaultChunkSource.SupportsContiguousGet<ATTR extends Any>, DefaultChunkSource.WithPrev<ATTR extends Any>Nested classes/interfaces inherited from interface io.deephaven.engine.table.TupleExporter
TupleExporter.ExportElementFunction<TUPLE_TYPE>Nested classes/interfaces inherited from interface io.deephaven.engine.table.WritableColumnSource
WritableColumnSource.ByteFiller, WritableColumnSource.CharFiller, WritableColumnSource.DoubleFiller, WritableColumnSource.FloatFiller, WritableColumnSource.IntFiller, WritableColumnSource.LongFiller, WritableColumnSource.ObjectFiller, WritableColumnSource.ShortFiller, WritableColumnSource.SinkFiller -
Field Summary
Fields inherited from class io.deephaven.engine.table.impl.AbstractColumnSource
componentType, type, updateGraph, USE_PARALLEL_ROWSET_BUILD, USE_PARTIAL_TABLE_DATA_INDEX, USE_RANGES_AVERAGE_RUN_LENGTHFields inherited from interface io.deephaven.engine.table.ChunkSink
DEFAULT_FILL_FROM_INSTANCEFields inherited from interface io.deephaven.engine.table.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAYFields inherited from interface io.deephaven.engine.table.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAYFields inherited from interface io.deephaven.engine.table.ColumnSource
ZERO_LENGTH_COLUMN_SOURCE_ARRAYFields inherited from interface io.deephaven.engine.table.impl.sources.InMemoryColumnSource
TWO_DIMENSIONAL_COLUMN_SOURCE_THRESHOLD -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidensureCapacity(long capacity, boolean nullFilled) Ensure that this WritableColumnSource can accept row keys in range[0, capacity).voidfillChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Values> destination, @NotNull RowSequence rowSequence) Populates the given destination chunk with data corresponding to the keys from the givenRowSequence.voidfillChunkUnordered(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Values> dest, @NotNull LongChunk<? extends RowKeys> keys) Populates a contiguous portion of the given destination chunk with data corresponding to the keys from the givenLongChunk.voidfillFromChunk(@NotNull ChunkSink.FillFromContext context, @NotNull Chunk<? extends Values> src, @NotNull RowSequence rowSequence) Our default, inefficient, implementation.voidfillFromChunkUnordered(@NotNull ChunkSink.FillFromContext context, @NotNull Chunk<? extends Values> src, @NotNull LongChunk<RowKeys> keys) Fills the ChunkSink with data from the source, with data corresponding to the keys from the given key chunk.voidfillPrevChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Values> destination, @NotNull RowSequence rowSequence) Populates the given destination chunk with data corresponding to the keys from the givenRowSequence.voidfillPrevChunkUnordered(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super Values> dest, @NotNull LongChunk<? extends RowKeys> keys) Populates a contiguous portion of the given destination chunk with prev data corresponding to the keys from the givenLongChunk.final floatgetAndSetUnsafe(long rowKey, float newValue) float[]getArray()getChunk(@NotNull ChunkSource.GetContext context, long firstKey, long lastKey) Same asChunkSource.getChunk(GetContext, RowSequence), except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anRowSequence.getChunk(@NotNull ChunkSource.GetContext context, @NotNull RowSequence rowSequence) Returns a chunk of data corresponding to the keys from the givenRowSequence.final floatgetFloat(long rowKey) Get the value at the rowKey as a float.getPrevChunk(@NotNull ChunkSource.GetContext context, long firstKey, long lastKey) Same asChunkSource.WithPrev.getPrevChunk(GetContext, RowSequence), except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anRowSequence.getPrevChunk(@NotNull ChunkSource.GetContext context, @NotNull RowSequence rowSequence) Returns a chunk of previous data corresponding to the keys from the givenRowSequence.final floatgetUnsafe(long rowKey) voidprepareForParallelPopulation(@NotNull RowSequence rowSequence) Prepare this column source such that: all values in rowSet may be accessed using getPrev all values in rowSet may be populated in parallelbooleanReturns true if this column source can efficiently provide an unordered fill.longresetWritableChunkToBackingStore(@NotNull ResettableWritableChunk<?> chunk, long position) Resets the given chunk to provide a write-through reference to our backing array.longresetWritableChunkToBackingStoreSlice(@NotNull ResettableWritableChunk<?> chunk, long position) Resets the given chunk to provide a write-through reference to our backing array.final voidset(long key, float value) voidsetArray(float[] array) final voidsetNull(long key) Methods inherited from class io.deephaven.engine.table.impl.AbstractColumnSource
allowsReinterpret, defaultFillChunk, defaultFillPrevChunk, doReinterpret, estimatePushdownFilterCost, getComponentType, getPrevSource, getType, makePushdownFilterContext, match, pushdownFilter, pushdownManager, reinterpretMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.engine.table.impl.sources.ChunkedBackingStoreExposedWritableSource
exposesChunkedBackingStoreMethods inherited from interface io.deephaven.engine.table.ColumnSource
allowsReinterpret, cast, cast, cast, cast, createPreviousTuple, createTuple, createTupleFromValues, exportAllTo, exportElement, exportElement, getChunkType, getComponentType, getPrevSource, getType, isStateless, match, reinterpret, releaseCachedResources, startTrackingPrevValues, tupleLengthMethods inherited from interface io.deephaven.engine.table.impl.ColumnSourceGetDefaults.ForFloat
get, getBoolean, getByte, getChar, getDouble, getInt, getLong, getShortMethods inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource
getChunkByFilling, makeFillContext, makeGetContextMethods inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource.WithPrev
getPrevChunkByFillingMethods inherited from interface io.deephaven.engine.table.FillContextMaker
makeFillContextMethods inherited from interface io.deephaven.engine.table.GetContextMaker
makeGetContextMethods inherited from interface io.deephaven.engine.table.impl.ImmutableColumnSource
getPrev, getPrevBoolean, getPrevByte, getPrevChar, getPrevDouble, getPrevFloat, getPrevInt, getPrevLong, getPrevShort, isImmutableMethods inherited from interface io.deephaven.engine.table.impl.sources.InMemoryColumnSource
isInMemoryMethods inherited from interface io.deephaven.engine.table.TupleExporter
exportAllReinterpretedTo, exportAllReinterpretedTo, exportAllTo, exportElementReinterpretedMethods inherited from interface io.deephaven.engine.table.TupleSource
createTupleFromReinterpretedValuesMethods inherited from interface io.deephaven.engine.table.WritableColumnSource
ensureCapacity, makeFillFromContext, set, set, set, set, set, set, set, setNull
-
Constructor Details
-
ImmutableFloatArraySource
public ImmutableFloatArraySource() -
ImmutableFloatArraySource
public ImmutableFloatArraySource(float[] data)
-
-
Method Details
-
getFloat
public final float getFloat(long rowKey) Description copied from interface:ElementSourceGet the value at the rowKey as a float. RowKeys that are not present are undefined.- Specified by:
getFloatin interfaceElementSource<Float>- Parameters:
rowKey- the location in key space to get the value from.- Returns:
- the float at the rowKey, null values are represented by
QueryConstants.NULL_FLOAT
-
getUnsafe
public final float getUnsafe(long rowKey) -
getAndSetUnsafe
public final float getAndSetUnsafe(long rowKey, float newValue) -
setNull
public final void setNull(long key) - Specified by:
setNullin interfaceWritableColumnSource<Float>
-
set
public final void set(long key, float value) - Specified by:
setin interfaceWritableColumnSource<Float>
-
ensureCapacity
public void ensureCapacity(long capacity, boolean nullFilled) Description copied from interface:WritableColumnSourceEnsure that this WritableColumnSource can accept row keys in range[0, capacity).- Specified by:
ensureCapacityin interfaceWritableColumnSource<Float>- Parameters:
capacity- The new minimum capacitynullFilled- Whether data should be "null-filled". If true, get operations at row keys that have not been set will return the appropriate null value; otherwise such gets produce undefined results.
-
fillChunk
public void fillChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:ChunkSourcePopulates the given destination chunk with data corresponding to the keys from the givenRowSequence.- Specified by:
fillChunkin interfaceChunkSource<Values>- Overrides:
fillChunkin classAbstractColumnSource<Float>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.destination- The chunk to be populated according torowSequence. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,rowSequence.size()).rowSequence- AnRowSequencerepresenting the keys to be fetched
-
getChunk
public Chunk<? extends Values> getChunk(@NotNull @NotNull ChunkSource.GetContext context, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:ChunkSourceReturns a chunk of data corresponding to the keys from the givenRowSequence.- Specified by:
getChunkin interfaceChunkSource<Values>- Specified by:
getChunkin interfaceDefaultChunkSource<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 poolrowSequence- AnRowSequencerepresenting the keys to be fetched- Returns:
- A chunk of data corresponding to the keys from the given
RowSequence
-
resetWritableChunkToBackingStore
public long resetWritableChunkToBackingStore(@NotNull @NotNull ResettableWritableChunk<?> chunk, long position) Description copied from interface:ChunkedBackingStoreExposedWritableSourceResets the given chunk to provide a write-through reference to our backing array.Note: This is unsafe to use if previous tracking has been enabled!
- Specified by:
resetWritableChunkToBackingStorein interfaceChunkedBackingStoreExposedWritableSource- Parameters:
chunk- the writable chunk to reset to our backing array.position- position that we require- Returns:
- the first position addressable by the chunk
-
resetWritableChunkToBackingStoreSlice
public long resetWritableChunkToBackingStoreSlice(@NotNull @NotNull ResettableWritableChunk<?> chunk, long position) Description copied from interface:ChunkedBackingStoreExposedWritableSourceResets the given chunk to provide a write-through reference to our backing array.Note: This is unsafe to use if previous tracking has been enabled!
- Specified by:
resetWritableChunkToBackingStoreSlicein interfaceChunkedBackingStoreExposedWritableSource- Parameters:
chunk- the writable chunk to reset to a slice of our backing array.position- position of the first value in the returned chunk- Returns:
- the capacity of the returned chunk
-
getChunk
public Chunk<? extends Values> getChunk(@NotNull @NotNull ChunkSource.GetContext context, long firstKey, long lastKey) Description copied from interface:ChunkSourceSame asChunkSource.getChunk(GetContext, RowSequence), except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anRowSequence. Typically you want to call this only if you don't have anRowSequence, such as during anRowSequence.forAllRowKeyRanges(LongRangeConsumer)call. In this case, it allows you to avoid creating an intermediaryRowSequenceobject.- Specified by:
getChunkin interfaceChunkSource<Values>- Specified by:
getChunkin interfaceDefaultChunkSource<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 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
-
fillFromChunk
public void fillFromChunk(@NotNull @NotNull ChunkSink.FillFromContext context, @NotNull @NotNull Chunk<? extends Values> src, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:WritableColumnSourceOur default, inefficient, implementation. Inheritors who care should provide a better implementation.- Specified by:
fillFromChunkin interfaceChunkSink<Values>- Specified by:
fillFromChunkin interfaceWritableColumnSource<Float>- Parameters:
context- A context containing all mutable/state related data used in writing the Chunk.src- The source of the datarowSequencerowSequence- AnRowSequencerepresenting the keys to be written
-
fillFromChunkUnordered
public void fillFromChunkUnordered(@NotNull @NotNull ChunkSink.FillFromContext context, @NotNull @NotNull Chunk<? extends Values> src, @NotNull @NotNull LongChunk<RowKeys> keys) Description copied from interface:ChunkSinkFills the ChunkSink with data from the source, with data corresponding to the keys from the given key chunk.- Specified by:
fillFromChunkUnorderedin interfaceChunkSink<Values>- Specified by:
fillFromChunkUnorderedin interfaceWritableColumnSource<Float>- Parameters:
context- A context containing all mutable/state related data used in writing the Chunk.src- The source of the dataRowSequencekeys- ALongChunkrepresenting the keys to be written
-
fillChunkUnordered
public void fillChunkUnordered(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> dest, @NotNull @NotNull LongChunk<? extends RowKeys> keys) Description copied from interface:FillUnorderedPopulates a contiguous portion of the given destination chunk with data corresponding to the keys from the givenLongChunk.It behaves as if the following code were executed:
destination.setSize(keys.size()); for (int ii = 0; ii < keys.size(); ++ii) { destination.set(ii, get(keys.get(ii))); }- Specified by:
fillChunkUnorderedin interfaceFillUnordered<Values>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.dest- The chunk to be populated according tokeyskeys- A chunk of individual, not assumed to be ordered keys to be fetched
-
fillPrevChunkUnordered
public void fillPrevChunkUnordered(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> dest, @NotNull @NotNull LongChunk<? extends RowKeys> keys) Description copied from interface:FillUnorderedPopulates a contiguous portion of the given destination chunk with prev data corresponding to the keys from the givenLongChunk.It behaves as if the following code were executed:
destination.setSize(keys.size()); for (int ii = 0; ii < keys.size(); ++ii) { destination.set(ii, getPrev(keys.get(ii))); }- Specified by:
fillPrevChunkUnorderedin interfaceFillUnordered<Values>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.dest- The chunk to be populated according tokeyskeys- A chunk of individual, not assumed to be ordered keys to be fetched
-
fillPrevChunk
public void fillPrevChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super Values> destination, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:ChunkSource.WithPrevPopulates the given destination chunk with data corresponding to the keys from the givenRowSequence.- Specified by:
fillPrevChunkin interfaceChunkSource.WithPrev<Values>- Overrides:
fillPrevChunkin classAbstractColumnSource<Float>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.destination- The chunk to be populated according torowSequence. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,rowSequence.size()).rowSequence- AnRowSequencerepresenting the keys to be fetched
-
getPrevChunk
public Chunk<? extends Values> getPrevChunk(@NotNull @NotNull ChunkSource.GetContext context, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:ChunkSource.WithPrevReturns a chunk of previous data corresponding to the keys from the givenRowSequence.- Specified by:
getPrevChunkin interfaceChunkSource.WithPrev<Values>- Specified by:
getPrevChunkin interfaceDefaultChunkSource.WithPrev<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 poolrowSequence- AnRowSequencerepresenting the keys to be fetched- Returns:
- A chunk of data corresponding to the keys from the given
RowSequence
-
getPrevChunk
public Chunk<? extends Values> getPrevChunk(@NotNull @NotNull ChunkSource.GetContext context, long firstKey, long lastKey) Description copied from interface:ChunkSource.WithPrevSame asChunkSource.WithPrev.getPrevChunk(GetContext, RowSequence), except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anRowSequence.- Specified by:
getPrevChunkin interfaceChunkSource.WithPrev<Values>- Specified by:
getPrevChunkin interfaceDefaultChunkSource.WithPrev<Values>
-
providesFillUnordered
public boolean providesFillUnordered()Description copied from interface:FillUnorderedReturns true if this column source can efficiently provide an unordered fill. If this method returns false, then fillChunkUnordered and fillPrevChunkUnordered may throw an UnsupportedOperationException.- Specified by:
providesFillUnorderedin interfaceFillUnordered<Values>- Returns:
- if this column source can provide an unordered fill
-
prepareForParallelPopulation
Description copied from interface:WritableSourceWithPrepareForParallelPopulationPrepare this column source such that:- all values in rowSet may be accessed using getPrev
- all values in rowSet may be populated in parallel
Further operations in this cycle need not check for previous when writing data to the column source; you must provide a row set that contains every row that may be written to this column source.
- Specified by:
prepareForParallelPopulationin interfaceWritableSourceWithPrepareForParallelPopulation- Parameters:
rowSequence- the row sequence of values that will change on this cycle
-
getArray
public float[] getArray() -
setArray
public void setArray(float[] array)
-