Class DefaultChunkWriterFactory
java.lang.Object
io.deephaven.extensions.barrage.chunk.DefaultChunkWriterFactory
- All Implemented Interfaces:
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis supplier interface simplifies the cost to operate off of the ArrowType directly since the Arrow POJO is not yet supported over GWT. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDisables the default behavior of converting unknown types to theirtoString()representation.protected Map<Class<?>,DefaultChunkWriterFactory.ArrowTypeChunkWriterSupplier> lookupWriterFactory(org.apache.arrow.vector.types.pojo.ArrowType.ArrowTypeID typeId) <T extends Chunk<Values>>
ChunkWriter<T>newWriter(@NotNull BarrageTypeInfo<org.apache.arrow.flatbuf.Field> typeInfo) Returns aChunkWriterfor the specified arguments.<T extends Chunk<Values>>
ChunkWriter<T>newWriterPojo(@NotNull BarrageTypeInfo<org.apache.arrow.vector.types.pojo.Field> typeInfo) voidregister(org.apache.arrow.vector.types.pojo.ArrowType.ArrowTypeID arrowType, Class<?> deephavenType, DefaultChunkWriterFactory.ArrowTypeChunkWriterSupplier chunkWriterFactory)
-
Field Details
-
log
-
INSTANCE
-
-
Constructor Details
-
DefaultChunkWriterFactory
protected DefaultChunkWriterFactory()
-
-
Method Details
-
disableToStringUnknownTypes
public void disableToStringUnknownTypes()Disables the default behavior of converting unknown types to theirtoString()representation.By default, the
DefaultChunkWriterFactorywill use an encoder that invokestoString()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.FactoryReturns aChunkWriterfor the specified arguments.- Specified by:
newWriterin interfaceChunkWriter.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
public void register(org.apache.arrow.vector.types.pojo.ArrowType.ArrowTypeID arrowType, Class<?> deephavenType, DefaultChunkWriterFactory.ArrowTypeChunkWriterSupplier chunkWriterFactory)
-