Class DefaultChunkWriterFactory

java.lang.Object
io.deephaven.extensions.barrage.chunk.DefaultChunkWriterFactory
All Implemented Interfaces:
ChunkWriter.Factory

public class DefaultChunkWriterFactory extends Object implements ChunkWriter.Factory
JVM implementation of ChunkWriter.Factory, suitable for use in Java clients and servers. This default implementation may not round trip flight types in a stable way, but will round trip Deephaven table definitions and table data. Neither of these is a required/expected property of being a Flight/Barrage/Deephaven client.
  • Field Details

  • Constructor Details

    • DefaultChunkWriterFactory

      protected DefaultChunkWriterFactory()
  • Method Details

    • disableToStringUnknownTypes

      public void disableToStringUnknownTypes()
      Disables the default behavior of converting unknown types to their toString() representation.

      By default, the DefaultChunkWriterFactory will use an encoder that invokes toString() on any incoming types it does not recognize or have a specific handler for. This method disables that behavior, ensuring that unsupported types throw an exception when a writer cannot be provided.

    • lookupWriterFactory

      protected Map<Class<?>,DefaultChunkWriterFactory.ArrowTypeChunkWriterSupplier> lookupWriterFactory(org.apache.arrow.vector.types.pojo.ArrowType.ArrowTypeID typeId)
    • newWriter

      public <T extends Chunk<Values>> ChunkWriter<T> newWriter(@NotNull @NotNull BarrageTypeInfo<org.apache.arrow.flatbuf.Field> typeInfo)
      Description copied from interface: ChunkWriter.Factory
      Returns a ChunkWriter for the specified arguments.
      Specified by:
      newWriter in interface ChunkWriter.Factory
      Parameters:
      typeInfo - the type of data to write into a chunk
      Returns:
      a ChunkWriter based on the given options, factory, and type to write
    • newWriterPojo

      public <T extends Chunk<Values>> ChunkWriter<T> newWriterPojo(@NotNull @NotNull BarrageTypeInfo<org.apache.arrow.vector.types.pojo.Field> typeInfo)
    • register

      protected void register(org.apache.arrow.vector.types.pojo.ArrowType.ArrowTypeID arrowType, Class<?> deephavenType, DefaultChunkWriterFactory.ArrowTypeChunkWriterSupplier chunkWriterFactory)