org.apache.pig.data
Class BinInterSedes

java.lang.Object
  extended by org.apache.pig.data.BinInterSedes
All Implemented Interfaces:
InterSedes

@InterfaceAudience.Private
@InterfaceStability.Stable
public class BinInterSedes
extends Object
implements InterSedes

A class to handle reading and writing of intermediate results of data types. The serialization format used by this class more efficient than what was used in DataReaderWriter . The format used by the functions in this class is subject to change, so it should be used ONLY to store intermediate results within a pig query.


Nested Class Summary
static class BinInterSedes.BinInterSedesTupleRawComparator
           
 
Field Summary
static byte BAG
           
static byte BIGDECIMAL
           
static byte BIGINTEGER
           
static byte BOOLEAN_FALSE
           
static byte BOOLEAN_TRUE
           
static byte BYTE
           
static byte BYTEARRAY
           
static byte CHARARRAY
           
static byte DATETIME
           
static byte DOUBLE
           
static byte FLOAT
           
static byte GENERIC_WRITABLECOMPARABLE
           
static byte INTEGER
           
static byte INTEGER_0
           
static byte INTEGER_1
           
static byte INTEGER_INBYTE
           
static byte INTEGER_INSHORT
           
static byte INTERNALMAP
           
static byte LONG
           
static byte LONG_0
           
static byte LONG_1
           
static byte LONG_INBYTE
           
static byte LONG_ININT
           
static byte LONG_INSHORT
           
static byte MAP
           
static byte NULL
           
static byte SCHEMA_TUPLE
           
static byte SCHEMA_TUPLE_BYTE_INDEX
           
static byte SCHEMA_TUPLE_SHORT_INDEX
           
static byte SMALLBAG
           
static byte SMALLBYTEARRAY
           
static byte SMALLCHARARRAY
           
static byte SMALLMAP
           
static byte SMALLTUPLE
           
static byte TINYBAG
           
static byte TINYBYTEARRAY
           
static byte TINYMAP
           
static byte TINYTUPLE
           
static byte TUPLE
           
static byte TUPLE_0
           
static byte TUPLE_1
           
static byte TUPLE_2
           
static byte TUPLE_3
           
static byte TUPLE_4
           
static byte TUPLE_5
           
static byte TUPLE_6
           
static byte TUPLE_7
           
static byte TUPLE_8
           
static byte TUPLE_9
           
static int UNSIGNED_BYTE_MAX
           
static int UNSIGNED_SHORT_MAX
           
static String UTF8
           
 
Constructor Summary
BinInterSedes()
           
 
Method Summary
 void addColsToTuple(DataInput in, Tuple t)
          The type of next object has been determined to be of type Tuple, add the columns that belong to the tuple to given tuple argument t
 Class<? extends TupleRawComparator> getTupleRawComparatorClass()
           
 int getTupleSize(DataInput in, byte type)
           
static boolean isTupleByte(byte b)
           
 Object readDatum(DataInput in)
          Get the next object from DataInput in
 Object readDatum(DataInput in, byte type)
          Expects binInterSedes data types (NOT DataType types!)
 Tuple readTuple(DataInput in)
           
 Tuple readTuple(DataInput in, byte type)
           
 void writeDatum(DataOutput out, Object val)
          Write given object val to DataOutput out
 void writeDatum(DataOutput out, Object val, byte type)
          Write given object val of DataType type to DataOutput out
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BOOLEAN_TRUE

public static final byte BOOLEAN_TRUE
See Also:
Constant Field Values

BOOLEAN_FALSE

public static final byte BOOLEAN_FALSE
See Also:
Constant Field Values

BYTE

public static final byte BYTE
See Also:
Constant Field Values

INTEGER

public static final byte INTEGER
See Also:
Constant Field Values

INTEGER_0

public static final byte INTEGER_0
See Also:
Constant Field Values

INTEGER_1

public static final byte INTEGER_1
See Also:
Constant Field Values

INTEGER_INSHORT

public static final byte INTEGER_INSHORT
See Also:
Constant Field Values

INTEGER_INBYTE

public static final byte INTEGER_INBYTE
See Also:
Constant Field Values

LONG

public static final byte LONG
See Also:
Constant Field Values

FLOAT

public static final byte FLOAT
See Also:
Constant Field Values

DOUBLE

public static final byte DOUBLE
See Also:
Constant Field Values

BYTEARRAY

public static final byte BYTEARRAY
See Also:
Constant Field Values

SMALLBYTEARRAY

public static final byte SMALLBYTEARRAY
See Also:
Constant Field Values

TINYBYTEARRAY

public static final byte TINYBYTEARRAY
See Also:
Constant Field Values

CHARARRAY

public static final byte CHARARRAY
See Also:
Constant Field Values

SMALLCHARARRAY

public static final byte SMALLCHARARRAY
See Also:
Constant Field Values

MAP

public static final byte MAP
See Also:
Constant Field Values

SMALLMAP

public static final byte SMALLMAP
See Also:
Constant Field Values

TINYMAP

public static final byte TINYMAP
See Also:
Constant Field Values

TUPLE

public static final byte TUPLE
See Also:
Constant Field Values

SMALLTUPLE

public static final byte SMALLTUPLE
See Also:
Constant Field Values

TINYTUPLE

public static final byte TINYTUPLE
See Also:
Constant Field Values

BAG

public static final byte BAG
See Also:
Constant Field Values

SMALLBAG

public static final byte SMALLBAG
See Also:
Constant Field Values

TINYBAG

public static final byte TINYBAG
See Also:
Constant Field Values

GENERIC_WRITABLECOMPARABLE

public static final byte GENERIC_WRITABLECOMPARABLE
See Also:
Constant Field Values

INTERNALMAP

public static final byte INTERNALMAP
See Also:
Constant Field Values

NULL

public static final byte NULL
See Also:
Constant Field Values

SCHEMA_TUPLE_BYTE_INDEX

public static final byte SCHEMA_TUPLE_BYTE_INDEX
See Also:
Constant Field Values

SCHEMA_TUPLE_SHORT_INDEX

public static final byte SCHEMA_TUPLE_SHORT_INDEX
See Also:
Constant Field Values

SCHEMA_TUPLE

public static final byte SCHEMA_TUPLE
See Also:
Constant Field Values

LONG_INBYTE

public static final byte LONG_INBYTE
See Also:
Constant Field Values

LONG_INSHORT

public static final byte LONG_INSHORT
See Also:
Constant Field Values

LONG_ININT

public static final byte LONG_ININT
See Also:
Constant Field Values

LONG_0

public static final byte LONG_0
See Also:
Constant Field Values

LONG_1

public static final byte LONG_1
See Also:
Constant Field Values

TUPLE_0

public static final byte TUPLE_0
See Also:
Constant Field Values

TUPLE_1

public static final byte TUPLE_1
See Also:
Constant Field Values

TUPLE_2

public static final byte TUPLE_2
See Also:
Constant Field Values

TUPLE_3

public static final byte TUPLE_3
See Also:
Constant Field Values

TUPLE_4

public static final byte TUPLE_4
See Also:
Constant Field Values

TUPLE_5

public static final byte TUPLE_5
See Also:
Constant Field Values

TUPLE_6

public static final byte TUPLE_6
See Also:
Constant Field Values

TUPLE_7

public static final byte TUPLE_7
See Also:
Constant Field Values

TUPLE_8

public static final byte TUPLE_8
See Also:
Constant Field Values

TUPLE_9

public static final byte TUPLE_9
See Also:
Constant Field Values

BIGINTEGER

public static final byte BIGINTEGER
See Also:
Constant Field Values

BIGDECIMAL

public static final byte BIGDECIMAL
See Also:
Constant Field Values

DATETIME

public static final byte DATETIME
See Also:
Constant Field Values

UNSIGNED_SHORT_MAX

public static final int UNSIGNED_SHORT_MAX
See Also:
Constant Field Values

UNSIGNED_BYTE_MAX

public static final int UNSIGNED_BYTE_MAX
See Also:
Constant Field Values

UTF8

public static final String UTF8
See Also:
Constant Field Values
Constructor Detail

BinInterSedes

public BinInterSedes()
Method Detail

readTuple

public Tuple readTuple(DataInput in,
                       byte type)
                throws IOException
Throws:
IOException

getTupleSize

public int getTupleSize(DataInput in,
                        byte type)
                 throws IOException
Throws:
IOException

readDatum

public Object readDatum(DataInput in)
                 throws IOException,
                        ExecException
Description copied from interface: InterSedes
Get the next object from DataInput in

Specified by:
readDatum in interface InterSedes
Returns:
Next object from DataInput in
Throws:
IOException
ExecException

readDatum

public Object readDatum(DataInput in,
                        byte type)
                 throws IOException,
                        ExecException
Expects binInterSedes data types (NOT DataType types!)

Specified by:
readDatum in interface InterSedes
Returns:
Next object from DataInput in
Throws:
IOException
ExecException
See Also:
InterSedes.readDatum(java.io.DataInput, byte)

writeDatum

public void writeDatum(DataOutput out,
                       Object val)
                throws IOException
Description copied from interface: InterSedes
Write given object val to DataOutput out

Specified by:
writeDatum in interface InterSedes
Throws:
IOException

writeDatum

public void writeDatum(DataOutput out,
                       Object val,
                       byte type)
                throws IOException
Description copied from interface: InterSedes
Write given object val of DataType type to DataOutput out

Specified by:
writeDatum in interface InterSedes
Parameters:
out - output
val - value to write
type - type, as defined in DataType
Throws:
IOException

addColsToTuple

public void addColsToTuple(DataInput in,
                           Tuple t)
                    throws IOException
Description copied from interface: InterSedes
The type of next object has been determined to be of type Tuple, add the columns that belong to the tuple to given tuple argument t

Specified by:
addColsToTuple in interface InterSedes
Throws:
IOException

getTupleRawComparatorClass

public Class<? extends TupleRawComparator> getTupleRawComparatorClass()
Specified by:
getTupleRawComparatorClass in interface InterSedes

readTuple

public Tuple readTuple(DataInput in)
                throws IOException
Throws:
IOException

isTupleByte

public static boolean isTupleByte(byte b)


Copyright © 2007-2012 The Apache Software Foundation