|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.impl.util.StorageUtil
public final class StorageUtil
This util class provides methods that are shared by storage class
PigStorage
and streaming class PigStreaming
Field Summary | |
---|---|
static StreamingDelimiters |
DEFAULT_DELIMITERS
|
Constructor Summary | |
---|---|
StorageUtil()
|
Method Summary | |
---|---|
static Tuple |
bytesToTuple(byte[] buf,
int offset,
int length,
byte fieldDel)
Transform bytes from a byte array up to the specified length to a Tuple |
static byte |
parseFieldDel(String delimiter)
Transform a String into a byte representing the
field delimiter. |
static void |
putField(OutputStream out,
Object field)
|
static void |
putField(OutputStream out,
Object field,
boolean includeTypeInformation)
|
static void |
putField(OutputStream out,
Object field,
StreamingDelimiters delims,
boolean includeTypeInformation)
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 |
Field Detail |
---|
public static final StreamingDelimiters DEFAULT_DELIMITERS
Constructor Detail |
---|
public StorageUtil()
Method Detail |
---|
public static byte parseFieldDel(String delimiter)
String
into a byte representing the
field delimiter.
delimiter
- a string that may be in single-quoted form
public static void putField(OutputStream out, Object field) throws IOException
IOException
public static void putField(OutputStream out, Object field, boolean includeTypeInformation) throws IOException
IOException
public static void putField(OutputStream out, Object field, StreamingDelimiters delims, boolean includeTypeInformation) throws IOException
OutputStream
in the
field-delimited form.
out
- an OutputStream objectfield
- an object to be serialized
IOException
- if serialization fails.public static Tuple textToTuple(org.apache.hadoop.io.Text val, byte fieldDel)
Text
to a Tuple
val
- a line of textfieldDel
- the field delimiter
public static Tuple bytesToTuple(byte[] buf, int offset, int length, byte fieldDel)
Tuple
buf
- the byte arraylength
- number of bytes to consume from the byte arrayfieldDel
- the field delimiter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |