Class ImmutableByteTestSource

java.lang.Object
com.illumon.iris.db.v2.sources.AbstractColumnSource<Byte>
io.deephaven.engine.testutil.v2.sources.ImmutableByteTestSource
All Implemented Interfaces:
ChunkSource<Attributes.Values>, ChunkSource.WithPrev<Attributes.Values>, DefaultChunkSource<Attributes.Values>, DefaultChunkSource.WithPrev<Attributes.Values>, FillContextMaker, GetContextMaker, ColumnSource<Byte>, ColumnSourceGetDefaults.ForByte, ElementSource<Byte>, ImmutableColumnSource<Byte>, ImmutableColumnSourceGetDefaults.ForByte, Releasable, TupleExporter<Byte>, TupleSource<Byte>, TestColumnSource<Byte>, Serializable

public class ImmutableByteTestSource extends AbstractColumnSource<Byte> implements ImmutableColumnSourceGetDefaults.ForByte, TestColumnSource<Byte>
A test column source that ignores additions, only removing values.

It uses a fastutil open addressed hash map from long Index keys to byte values. If an uninitialized key is accessed; then an IllegalStateException is thrown. If the test framework attempts to remove or shift values, then an UnsupportedOperationException is thrown.

See Also:
  • Field Details

    • data

      protected final io.deephaven.shadow.fastutil.it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap data
  • Constructor Details

  • Method Details

    • checkIndex

      public void checkIndex(Index index)
    • add

      public void add(ReadOnlyIndex index, Chunk<Attributes.Values> vs)
      Description copied from interface: TestColumnSource
      Add 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 ObjectChunk containing boxed values.

      Specified by:
      add in interface TestColumnSource<Byte>
      Parameters:
      index - the index locations to add the data
      vs - the data to add
    • remove

      public void remove(ReadOnlyIndex index)
      Description copied from interface: TestColumnSource
      Remove the given index from the column source.
      Specified by:
      remove in interface TestColumnSource<Byte>
      Parameters:
      index - the keys to remove
    • shift

      public void shift(long startKeyInclusive, long endKeyInclusive, long shiftDelta)
      Description copied from interface: TestColumnSource
      Move data within the column source.
      Specified by:
      shift in interface TestColumnSource<Byte>
      Parameters:
      startKeyInclusive - the first key to shift
      endKeyInclusive - the last key to shift
      shiftDelta - how far to shift the data (either positive or negative)
    • get

      public Byte get(long index)
      Description copied from interface: ElementSource
      Get the value from the source. This may return boxed values for basic types.
      Specified by:
      get in interface ColumnSourceGetDefaults.ForByte
      Specified by:
      get in interface ElementSource<Byte>
      Parameters:
      index - the location in index space to get the value from.
      Returns:
      the value at the index, potentially null.
    • getByte

      public byte getByte(long index)
      Description copied from interface: ElementSource
      Get the value at the index as a byte.
      Specified by:
      getByte in interface ElementSource<Byte>
      Parameters:
      index - the location in index space to get the value from.
      Returns:
      the boolean at the index, null values are represented by QueryConstants.NULL_BYTE
    • isImmutable

      public boolean isImmutable()
      Description copied from interface: ColumnSource
      Determine if this column source is immutable, meaning that the values at a given index key never change.
      Specified by:
      isImmutable in interface ColumnSource<Byte>
      Specified by:
      isImmutable in interface ImmutableColumnSource<Byte>
      Returns:
      true if the values at a given index of the column source never change, false otherwise
    • 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 interface ColumnSource<Byte>