|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.PigStreamingBase
@InterfaceAudience.Public @InterfaceStability.Stable public abstract class PigStreamingBase
The interface is used for the custom mapping of
- a Tuple
to a byte array. The byte array is fed to the stdin
of the streaming process.
- a byte array, received from the stdout of the streaming process,
to a Tuple
.
This interface is designed to provide a common protocol for data exchange
between Pig runtime and streaming executables.
Typically, a user implements this interface for a particular type of stream
command and specifies the implementation class in the Pig DEFINE statement.
Constructor Summary | |
---|---|
PigStreamingBase()
|
Method Summary | |
---|---|
Tuple |
deserialize(byte[] bytes)
Deprecated. |
abstract Tuple |
deserialize(byte[] bytes,
int offset,
int length)
Given a byte array from a streaming executable, produce a tuple. |
abstract LoadCaster |
getLoadCaster()
This will be called on the front end during planning and not on the back end during execution. |
byte[] |
serialize(Tuple t)
Deprecated. |
abstract WritableByteArray |
serializeToBytes(Tuple t)
Given a tuple, produce an array of bytes to be passed to the streaming executable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PigStreamingBase()
Method Detail |
---|
@Deprecated public final byte[] serialize(Tuple t) throws IOException
PigToStream
serialize
in interface PigToStream
t
- Tuple to serialize
IOException
public abstract WritableByteArray serializeToBytes(Tuple t) throws IOException
t
- Tuple to serialize
IOException
@Deprecated public final Tuple deserialize(byte[] bytes) throws IOException
StreamToPig
deserialize
in interface StreamToPig
bytes
- to deserialize.
IOException
public abstract Tuple deserialize(byte[] bytes, int offset, int length) throws IOException
bytes
- bytes to deserialize.offset
- the offset in the byte array from which to deserialize.length
- the number of bytes from the offset of the byte array to deserialize.
IOException
public abstract LoadCaster getLoadCaster() throws IOException
getLoadCaster
in interface StreamToPig
LoadCaster
associated with this object, or null if
there is no such LoadCaster.
IOException
- if there is an exception during LoadCaster
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |