Package org.apache.iceberg.data.avro
Class IcebergEncoder<D>
java.lang.Object
org.apache.iceberg.data.avro.IcebergEncoder<D>
- All Implemented Interfaces:
org.apache.avro.message.MessageEncoder<D>
-
Constructor Summary
ConstructorDescriptionIcebergEncoder
(Schema schema) Creates a newMessageEncoder
that will deconstruct datum instances described by theschema
.IcebergEncoder
(Schema schema, boolean shouldCopy) Creates a newMessageEncoder
that will deconstruct datum instances described by theschema
. -
Method Summary
-
Constructor Details
-
IcebergEncoder
Creates a newMessageEncoder
that will deconstruct datum instances described by theschema
.Buffers returned by
encode
are copied and will not be modified by future calls toencode
.- Parameters:
schema
- theSchema
for datum instances
-
IcebergEncoder
Creates a newMessageEncoder
that will deconstruct datum instances described by theschema
.If
shouldCopy
is true, then buffers returned byencode
are copied and will not be modified by future calls toencode
.If
shouldCopy
is false, then buffers returned byencode
wrap a thread-local buffer that can be reused by future calls toencode
, but may not be. Callers should only setshouldCopy
to false if the buffer will be copied before the current thread's next call toencode
.- Parameters:
schema
- theSchema
for datum instancesshouldCopy
- whether to copy buffers before returning encoded results
-
-
Method Details
-
encode
- Specified by:
encode
in interfaceorg.apache.avro.message.MessageEncoder<D>
- Throws:
IOException
-
encode
- Specified by:
encode
in interfaceorg.apache.avro.message.MessageEncoder<D>
- Throws:
IOException
-