public class PigAvroDatumWriter
extends org.apache.avro.generic.GenericDatumWriter<java.lang.Object>
Constructor and Description |
---|
PigAvroDatumWriter(org.apache.avro.Schema schema)
construct with output schema
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Iterator<? extends java.lang.Object> |
getArrayElements(java.lang.Object array)
Called by the implementation of
GenericDatumWriter.writeArray(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder) to enumerate
array elements. |
protected long |
getArraySize(java.lang.Object array)
Called by the implementation of
GenericDatumWriter.writeArray(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder) to get the
size of an array. |
protected java.lang.Object |
getField(java.lang.Object record,
java.lang.String name,
int pos)
Called by the implementation of
writeRecord(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder) to retrieve
a record field value. |
protected boolean |
instanceOf(org.apache.avro.Schema schema,
java.lang.Object datum)
Recursively check whether "datum" is an instance of "schema" and called
by
resolveUnionSchema(Schema,Object) ,
unwrappedInstanceOf(Schema,Object) . |
protected java.lang.NullPointerException |
npe(java.lang.NullPointerException e,
java.lang.String s)
As of Avro 1.5.1 this method is now in the superclass so it's no longer
needed here, but leaving here for backward compatibility with Avro 1.4.1.
|
protected int |
resolveUnionSchema(org.apache.avro.Schema union,
java.lang.Object datum)
Called to resolve union.
|
protected void |
write(org.apache.avro.Schema schema,
java.lang.Object datum,
org.apache.avro.io.Encoder out) |
protected void |
writeBoolean(java.lang.Object datum,
org.apache.avro.io.Encoder out)
Write boolean.
|
protected void |
writeBytes(java.lang.Object datum,
org.apache.avro.io.Encoder out)
Called to write a bytes.
|
protected void |
writeDouble(java.lang.Object datum,
org.apache.avro.io.Encoder out)
Write double.
|
protected void |
writeFixed(org.apache.avro.Schema schema,
java.lang.Object datum,
org.apache.avro.io.Encoder out)
Called to write a fixed value.
|
protected void |
writeFloat(java.lang.Object datum,
org.apache.avro.io.Encoder out)
Write float.
|
protected void |
writeLong(java.lang.Object datum,
org.apache.avro.io.Encoder out)
Write long.
|
protected void |
writeRecord(org.apache.avro.Schema schema,
java.lang.Object datum,
org.apache.avro.io.Encoder out)
Overriding to fetch the field value from the Tuple.
|
protected void |
writeUnion(org.apache.avro.Schema schema,
java.lang.Object datum,
org.apache.avro.io.Encoder out)
Called to write union.
|
public PigAvroDatumWriter(org.apache.avro.Schema schema)
protected void write(org.apache.avro.Schema schema, java.lang.Object datum, org.apache.avro.io.Encoder out) throws java.io.IOException
write
in class org.apache.avro.generic.GenericDatumWriter<java.lang.Object>
java.io.IOException
protected void writeUnion(org.apache.avro.Schema schema, java.lang.Object datum, org.apache.avro.io.Encoder out) throws java.io.IOException
java.io.IOException
protected int resolveUnionSchema(org.apache.avro.Schema union, java.lang.Object datum) throws java.io.IOException
java.io.IOException
protected boolean instanceOf(org.apache.avro.Schema schema, java.lang.Object datum) throws java.io.IOException
resolveUnionSchema(Schema,Object)
,
unwrappedInstanceOf(Schema,Object)
.java.io.IOException
protected void writeDouble(java.lang.Object datum, org.apache.avro.io.Encoder out) throws java.io.IOException
java.io.IOException
protected void writeFloat(java.lang.Object datum, org.apache.avro.io.Encoder out) throws java.io.IOException
java.io.IOException
protected void writeLong(java.lang.Object datum, org.apache.avro.io.Encoder out) throws java.io.IOException
java.io.IOException
protected void writeBoolean(java.lang.Object datum, org.apache.avro.io.Encoder out) throws java.io.IOException
java.io.IOException
protected java.lang.NullPointerException npe(java.lang.NullPointerException e, java.lang.String s)
npe
in class org.apache.avro.generic.GenericDatumWriter<java.lang.Object>
protected void writeBytes(java.lang.Object datum, org.apache.avro.io.Encoder out) throws java.io.IOException
writeBytes
in class org.apache.avro.generic.GenericDatumWriter<java.lang.Object>
java.io.IOException
protected void writeFixed(org.apache.avro.Schema schema, java.lang.Object datum, org.apache.avro.io.Encoder out) throws java.io.IOException
writeFixed
in class org.apache.avro.generic.GenericDatumWriter<java.lang.Object>
java.io.IOException
protected void writeRecord(org.apache.avro.Schema schema, java.lang.Object datum, org.apache.avro.io.Encoder out) throws java.io.IOException
writeRecord
in class org.apache.avro.generic.GenericDatumWriter<java.lang.Object>
java.io.IOException
protected java.lang.Object getField(java.lang.Object record, java.lang.String name, int pos)
writeRecord(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder)
to retrieve
a record field value.protected long getArraySize(java.lang.Object array)
GenericDatumWriter.writeArray(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder)
to get the
size of an array.getArraySize
in class org.apache.avro.generic.GenericDatumWriter<java.lang.Object>
protected java.util.Iterator<? extends java.lang.Object> getArrayElements(java.lang.Object array)
GenericDatumWriter.writeArray(org.apache.avro.Schema, java.lang.Object, org.apache.avro.io.Encoder)
to enumerate
array elements.getArrayElements
in class org.apache.avro.generic.GenericDatumWriter<java.lang.Object>
Copyright © 2007-2012 The Apache Software Foundation