Constructor and Description |
---|
PigAvroDatumWriter(org.apache.avro.Schema schema)
construct with output schema
|
Modifier and Type | Method and Description |
---|---|
protected Iterator<? extends Object> |
getArrayElements(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(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 Object |
getField(Object record,
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,
Object datum)
Recursively check whether "datum" is an instance of "schema" and called
by
resolveUnionSchema(Schema,Object) ,
unwrappedInstanceOf(Schema,Object) . |
protected NullPointerException |
npe(NullPointerException e,
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,
Object datum)
Called to resolve union.
|
protected void |
write(org.apache.avro.Schema schema,
Object datum,
org.apache.avro.io.Encoder out) |
protected void |
writeBoolean(Object datum,
org.apache.avro.io.Encoder out)
Write boolean.
|
protected void |
writeBytes(Object datum,
org.apache.avro.io.Encoder out)
Called to write a bytes.
|
protected void |
writeDouble(Object datum,
org.apache.avro.io.Encoder out)
Write double.
|
protected void |
writeFixed(org.apache.avro.Schema schema,
Object datum,
org.apache.avro.io.Encoder out)
Called to write a fixed value.
|
protected void |
writeFloat(Object datum,
org.apache.avro.io.Encoder out)
Write float.
|
protected void |
writeLong(Object datum,
org.apache.avro.io.Encoder out)
Write long.
|
protected void |
writeRecord(org.apache.avro.Schema schema,
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,
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, Object datum, org.apache.avro.io.Encoder out) throws IOException
write
in class org.apache.avro.generic.GenericDatumWriter<Object>
IOException
protected void writeUnion(org.apache.avro.Schema schema, Object datum, org.apache.avro.io.Encoder out) throws IOException
IOException
protected int resolveUnionSchema(org.apache.avro.Schema union, Object datum) throws IOException
IOException
protected boolean instanceOf(org.apache.avro.Schema schema, Object datum) throws IOException
resolveUnionSchema(Schema,Object)
,
unwrappedInstanceOf(Schema,Object)
.IOException
protected void writeDouble(Object datum, org.apache.avro.io.Encoder out) throws IOException
IOException
protected void writeFloat(Object datum, org.apache.avro.io.Encoder out) throws IOException
IOException
protected void writeLong(Object datum, org.apache.avro.io.Encoder out) throws IOException
IOException
protected void writeBoolean(Object datum, org.apache.avro.io.Encoder out) throws IOException
IOException
protected NullPointerException npe(NullPointerException e, String s)
npe
in class org.apache.avro.generic.GenericDatumWriter<Object>
protected void writeBytes(Object datum, org.apache.avro.io.Encoder out) throws IOException
writeBytes
in class org.apache.avro.generic.GenericDatumWriter<Object>
IOException
protected void writeFixed(org.apache.avro.Schema schema, Object datum, org.apache.avro.io.Encoder out) throws IOException
writeFixed
in class org.apache.avro.generic.GenericDatumWriter<Object>
IOException
protected void writeRecord(org.apache.avro.Schema schema, Object datum, org.apache.avro.io.Encoder out) throws IOException
writeRecord
in class org.apache.avro.generic.GenericDatumWriter<Object>
IOException
protected Object getField(Object record, 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(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<Object>
protected Iterator<? extends Object> getArrayElements(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<Object>
Copyright © 2007-2012 The Apache Software Foundation