org.apache.pig.builtin
Class Utf8StorageConverter

java.lang.Object
  extended by org.apache.pig.builtin.Utf8StorageConverter
Direct Known Subclasses:
BinaryStorage, HBaseStorage, PigStorage

public abstract class Utf8StorageConverter
extends Object

This abstract class provides standard conversions between utf8 encoded data and pig data types. It is intended to be extended by load and store functions (such as PigStorage).


Field Summary
protected  BagFactory mBagFactory
           
protected  org.apache.commons.logging.Log mLog
           
protected  TupleFactory mTupleFactory
           
 
Constructor Summary
Utf8StorageConverter()
           
 
Method Summary
 DataBag bytesToBag(byte[] b)
           
 String bytesToCharArray(byte[] b)
           
 Double bytesToDouble(byte[] b)
           
 Float bytesToFloat(byte[] b)
           
 Integer bytesToInteger(byte[] b)
           
 Long bytesToLong(byte[] b)
           
 Map<String,Object> bytesToMap(byte[] b)
           
 Tuple bytesToTuple(byte[] b)
           
 byte[] toBytes(DataBag bag)
           
 byte[] toBytes(Double d)
           
 byte[] toBytes(Float f)
           
 byte[] toBytes(Integer i)
           
 byte[] toBytes(Long l)
           
 byte[] toBytes(Map<String,Object> m)
           
 byte[] toBytes(String s)
           
 byte[] toBytes(Tuple t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mBagFactory

protected BagFactory mBagFactory

mTupleFactory

protected TupleFactory mTupleFactory

mLog

protected final org.apache.commons.logging.Log mLog
Constructor Detail

Utf8StorageConverter

public Utf8StorageConverter()
Method Detail

bytesToBag

public DataBag bytesToBag(byte[] b)
                   throws IOException
Throws:
IOException

bytesToCharArray

public String bytesToCharArray(byte[] b)
                        throws IOException
Throws:
IOException

bytesToDouble

public Double bytesToDouble(byte[] b)

bytesToFloat

public Float bytesToFloat(byte[] b)
                   throws IOException
Throws:
IOException

bytesToInteger

public Integer bytesToInteger(byte[] b)
                       throws IOException
Throws:
IOException

bytesToLong

public Long bytesToLong(byte[] b)
                 throws IOException
Throws:
IOException

bytesToMap

public Map<String,Object> bytesToMap(byte[] b)
                              throws IOException
Throws:
IOException

bytesToTuple

public Tuple bytesToTuple(byte[] b)
                   throws IOException
Throws:
IOException

toBytes

public byte[] toBytes(DataBag bag)
               throws IOException
Throws:
IOException

toBytes

public byte[] toBytes(String s)
               throws IOException
Throws:
IOException

toBytes

public byte[] toBytes(Double d)
               throws IOException
Throws:
IOException

toBytes

public byte[] toBytes(Float f)
               throws IOException
Throws:
IOException

toBytes

public byte[] toBytes(Integer i)
               throws IOException
Throws:
IOException

toBytes

public byte[] toBytes(Long l)
               throws IOException
Throws:
IOException

toBytes

public byte[] toBytes(Map<String,Object> m)
               throws IOException
Throws:
IOException

toBytes

public byte[] toBytes(Tuple t)
               throws IOException
Throws:
IOException


Copyright © ${year} The Apache Software Foundation