public class PythonStreamer extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected AbstractRichFunction |
function |
protected DataInputStream |
in |
protected static org.slf4j.Logger |
LOG |
protected StringBuilder |
msg |
protected DataOutputStream |
out |
protected int |
port |
protected PythonReceiver |
receiver |
protected PythonSender |
sender |
protected ServerSocket |
server |
protected Socket |
socket |
Constructor and Description |
---|
PythonStreamer(AbstractRichFunction function,
int id,
boolean usesByteArray) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this streamer.
|
void |
open()
Starts the python script.
|
void |
sendBroadCastVariables(Configuration config)
Sends all broadcast-variables encoded in the configuration to the external process.
|
void |
streamBufferWithGroups(Iterator i1,
Iterator i2,
Collector c)
Sends all values contained in both iterators to the external process and collects all results.
|
void |
streamBufferWithoutGroups(Iterator i,
Collector c)
Sends all values contained in the iterator to the external process and collects all results.
|
protected static final org.slf4j.Logger LOG
protected ServerSocket server
protected Socket socket
protected DataInputStream in
protected DataOutputStream out
protected int port
protected PythonSender sender
protected PythonReceiver receiver
protected StringBuilder msg
protected final AbstractRichFunction function
public PythonStreamer(AbstractRichFunction function, int id, boolean usesByteArray)
public void open() throws IOException
IOException
public void close() throws IOException
IOException
public final void sendBroadCastVariables(Configuration config) throws IOException
config
- configuration object containing broadcast-variable count and namesIOException
public final void streamBufferWithoutGroups(Iterator i, Collector c) throws IOException
i
- iteratorc
- collectorIOException
public final void streamBufferWithGroups(Iterator i1, Iterator i2, Collector c) throws IOException
i1
- iteratori2
- iteratorc
- collectorIOException
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.