Class IcebergEncoder<D>

  • All Implemented Interfaces:
    org.apache.avro.message.MessageEncoder<D>

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

      Constructors 
      Constructor Description
      IcebergEncoder​(Schema schema)
      Creates a new MessageEncoder that will deconstruct datum instances described by the schema.
      IcebergEncoder​(Schema schema, boolean shouldCopy)
      Creates a new MessageEncoder that will deconstruct datum instances described by the schema.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.nio.ByteBuffer encode​(D datum)  
      void encode​(D datum, java.io.OutputStream stream)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • 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 Detail

      • encode

        public java.nio.ByteBuffer encode​(D datum)
                                   throws java.io.IOException
        Specified by:
        encode in interface org.apache.avro.message.MessageEncoder<D>
        Throws:
        java.io.IOException
      • encode

        public void encode​(D datum,
                           java.io.OutputStream stream)
                    throws java.io.IOException
        Specified by:
        encode in interface org.apache.avro.message.MessageEncoder<D>
        Throws:
        java.io.IOException