org.apache.pig.impl.util
Class StorageUtil

java.lang.Object
  extended by org.apache.pig.impl.util.StorageUtil

public final class StorageUtil
extends Object

This util class provides methods that are shared by storage class PigStorage and streaming class PigStreaming


Constructor Summary
StorageUtil()
           
 
Method Summary
static byte parseFieldDel(String delimiter)
          Transform a String into a byte representing the field delimiter.
static void putField(OutputStream out, Object field)
          Serialize an object to an OutputStream in the field-delimited form.
static Tuple textToTuple(org.apache.hadoop.io.Text val, byte fieldDel)
          Transform a line of Text to a Tuple
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorageUtil

public StorageUtil()
Method Detail

parseFieldDel

public static byte parseFieldDel(String delimiter)
Transform a String into a byte representing the field delimiter.

Parameters:
delimiter - a string that may be in single-quoted form
Returns:
the field delimiter in byte form

putField

public static void putField(OutputStream out,
                            Object field)
                     throws IOException
Serialize an object to an OutputStream in the field-delimited form.

Parameters:
out - an OutputStream object
field - an object to be serialized
Throws:
IOException - if serialization fails.

textToTuple

public static Tuple textToTuple(org.apache.hadoop.io.Text val,
                                byte fieldDel)
Transform a line of Text to a Tuple

Parameters:
val - a line of text
fieldDel - the field delimiter
Returns:
tuple constructed from the text


Copyright © 2012 The Apache Software Foundation