Class IcebergEncoder<D>

java.lang.Object
org.apache.iceberg.data.avro.IcebergEncoder<D>
All Implemented Interfaces:
org.apache.avro.message.MessageEncoder<D>

public class IcebergEncoder<D> extends Object implements org.apache.avro.message.MessageEncoder<D>
  • Constructor Details

    • IcebergEncoder

      public IcebergEncoder(Schema schema)
      Creates a new MessageEncoder that will deconstruct datum instances described by the schema.

      Buffers returned by encode are copied and will not be modified by future calls to encode.

      Parameters:
      schema - the Schema for datum instances
    • IcebergEncoder

      public IcebergEncoder(Schema schema, boolean shouldCopy)
      Creates a new MessageEncoder that will deconstruct datum instances described by the schema.

      If shouldCopy is true, then buffers returned by encode are copied and will not be modified by future calls to encode.

      If shouldCopy is false, then buffers returned by encode wrap a thread-local buffer that can be reused by future calls to encode, but may not be. Callers should only set shouldCopy to false if the buffer will be copied before the current thread's next call to encode.

      Parameters:
      schema - the Schema for datum instances
      shouldCopy - whether to copy buffers before returning encoded results
  • Method Details