public class InstantAsLongEncoding extends org.apache.avro.reflect.CustomEncoding<Instant>
CustomEncoding
encodes/decodes Instant
to a long (time in milliseconds) before encoding it in
Avro format.Modifier and Type | Field and Description |
---|---|
protected static int |
LONG_SCHEMA_INDEX |
protected static int |
NULL_SCHEMA_INDEX |
Constructor and Description |
---|
InstantAsLongEncoding() |
Modifier and Type | Method and Description |
---|---|
protected Instant |
read(Object o,
org.apache.avro.io.Decoder decoder) |
protected void |
write(Object o,
org.apache.avro.io.Encoder encoder) |
protected static final int NULL_SCHEMA_INDEX
protected static final int LONG_SCHEMA_INDEX
public InstantAsLongEncoding()
protected void write(Object o, org.apache.avro.io.Encoder encoder) throws IOException
write
in class org.apache.avro.reflect.CustomEncoding<Instant>
IOException
protected Instant read(Object o, org.apache.avro.io.Decoder decoder) throws IOException
read
in class org.apache.avro.reflect.CustomEncoding<Instant>
IOException
Copyright © 2019 Nuxeo. All rights reserved.