@InterfaceAudience.Public @InterfaceStability.Stable public abstract class PigStreamingBase extends java.lang.Object implements PigToStream, StreamToPig
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 and Description |
---|
PigStreamingBase() |
Modifier and Type | Method and Description |
---|---|
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.
|
@Deprecated public final byte[] serialize(Tuple t) throws java.io.IOException
PigToStream
serialize
in interface PigToStream
t
- Tuple to serializejava.io.IOException
public abstract WritableByteArray serializeToBytes(Tuple t) throws java.io.IOException
t
- Tuple to serializejava.io.IOException
@Deprecated public final Tuple deserialize(byte[] bytes) throws java.io.IOException
StreamToPig
deserialize
in interface StreamToPig
bytes
- to deserialize.java.io.IOException
public abstract Tuple deserialize(byte[] bytes, int offset, int length) throws java.io.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.java.io.IOException
public abstract LoadCaster getLoadCaster() throws java.io.IOException
getLoadCaster
in interface StreamToPig
LoadCaster
associated with this object, or null if
there is no such LoadCaster.java.io.IOException
- if there is an exception during LoadCasterCopyright © 2007-2012 The Apache Software Foundation