@InterfaceAudience.Public @InterfaceStability.Stable public abstract class PigStreamingBase extends 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 IOException
PigToStream
serialize
in interface PigToStream
t
- Tuple to serializeIOException
public abstract WritableByteArray serializeToBytes(Tuple t) throws IOException
t
- Tuple to serializeIOException
@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 LoadCasterCopyright © 2007-2017 The Apache Software Foundation