org.apache.hadoop.record
Interface RecordOutput

All Known Implementing Classes:
BinaryRecordOutput, CsvRecordOutput, XmlRecordOutput

public interface RecordOutput

Interface that alll the serializers have to implement.


Method Summary
 void endMap(java.util.TreeMap m, java.lang.String tag)
          Mark the end of a serialized map.
 void endRecord(Record r, java.lang.String tag)
          Mark the end of a serialized record.
 void endVector(java.util.ArrayList v, java.lang.String tag)
          Mark the end of a serialized vector.
 void startMap(java.util.TreeMap m, java.lang.String tag)
          Mark the start of a map to be serialized.
 void startRecord(Record r, java.lang.String tag)
          Mark the start of a record to be serialized.
 void startVector(java.util.ArrayList v, java.lang.String tag)
          Mark the start of a vector to be serialized.
 void writeBool(boolean b, java.lang.String tag)
          Write a boolean to serialized record.
 void writeBuffer(Buffer buf, java.lang.String tag)
          Write a buffer to serialized record.
 void writeByte(byte b, java.lang.String tag)
          Write a byte to serialized record.
 void writeDouble(double d, java.lang.String tag)
          Write a double precision floating point number to serialized record.
 void writeFloat(float f, java.lang.String tag)
          Write a single-precision float to serialized record.
 void writeInt(int i, java.lang.String tag)
          Write an integer to serialized record.
 void writeLong(long l, java.lang.String tag)
          Write a long integer to serialized record.
 void writeString(java.lang.String s, java.lang.String tag)
          Write a unicode string to serialized record.
 

Method Detail

writeByte

void writeByte(byte b,
               java.lang.String tag)
               throws java.io.IOException
Write a byte to serialized record.

Parameters:
b - Byte to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeBool

void writeBool(boolean b,
               java.lang.String tag)
               throws java.io.IOException
Write a boolean to serialized record.

Parameters:
b - Boolean to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeInt

void writeInt(int i,
              java.lang.String tag)
              throws java.io.IOException
Write an integer to serialized record.

Parameters:
i - Integer to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeLong

void writeLong(long l,
               java.lang.String tag)
               throws java.io.IOException
Write a long integer to serialized record.

Parameters:
l - Long to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeFloat

void writeFloat(float f,
                java.lang.String tag)
                throws java.io.IOException
Write a single-precision float to serialized record.

Parameters:
f - Float to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeDouble

void writeDouble(double d,
                 java.lang.String tag)
                 throws java.io.IOException
Write a double precision floating point number to serialized record.

Parameters:
d - Double to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeString

void writeString(java.lang.String s,
                 java.lang.String tag)
                 throws java.io.IOException
Write a unicode string to serialized record.

Parameters:
s - String to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

writeBuffer

void writeBuffer(Buffer buf,
                 java.lang.String tag)
                 throws java.io.IOException
Write a buffer to serialized record.

Parameters:
buf - Buffer to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

startRecord

void startRecord(Record r,
                 java.lang.String tag)
                 throws java.io.IOException
Mark the start of a record to be serialized.

Parameters:
r - Record to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

endRecord

void endRecord(Record r,
               java.lang.String tag)
               throws java.io.IOException
Mark the end of a serialized record.

Parameters:
r - Record to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

startVector

void startVector(java.util.ArrayList v,
                 java.lang.String tag)
                 throws java.io.IOException
Mark the start of a vector to be serialized.

Parameters:
v - Vector to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

endVector

void endVector(java.util.ArrayList v,
               java.lang.String tag)
               throws java.io.IOException
Mark the end of a serialized vector.

Parameters:
v - Vector to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

startMap

void startMap(java.util.TreeMap m,
              java.lang.String tag)
              throws java.io.IOException
Mark the start of a map to be serialized.

Parameters:
m - Map to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization

endMap

void endMap(java.util.TreeMap m,
            java.lang.String tag)
            throws java.io.IOException
Mark the end of a serialized map.

Parameters:
m - Map to be serialized
tag - Used by tagged serialization formats (such as XML)
Throws:
java.io.IOException - Indicates error in serialization


Copyright © 2009 The Apache Software Foundation