T - @InterfaceStability.Evolving
public interface ApexStream<T>
| Modifier and Type | Method and Description |
|---|---|
<O,INSTREAM extends ApexStream<T>,OUTSTREAM extends ApexStream<O>> |
addCompositeStreams(CompositeStreamTransform<INSTREAM,OUTSTREAM> compositeStreamTransform)
Extend the dag by adding one
CompositeStreamTransform |
<O,STREAM extends ApexStream<O>> |
addOperator(com.datatorrent.api.Operator op,
com.datatorrent.api.Operator.InputPort<T> inputPort,
com.datatorrent.api.Operator.OutputPort<O> outputPort,
Option... opts)
Extend the dag by adding one operator
|
com.datatorrent.api.DAG |
createDag()
Create dag from stream
|
<O,STREAM extends ApexStream<O>> |
endWith(com.datatorrent.api.Operator op,
com.datatorrent.api.Operator.InputPort<T> inputPort,
Option... opts)
Extend the dag by adding one end operator
|
<STREAM extends ApexStream<T>> |
filter(Function.FilterFunction<T> filter,
Option... opts)
Filter transformation
Add an operator to the DAG which filter out tuple T that cannot satisfy the FilterFunction |
<O,STREAM extends ApexStream<O>> |
flatMap(Function.FlatMapFunction<T,O> flatten,
Option... opts)
Flat map transformation
Add an operator to the DAG which convert tuple T to a collection of tuple O
|
<O,STREAM extends ApexStream<O>> |
map(Function.MapFunction<T,O> mapFunction,
Option... opts)
Simple map transformation
Add an operator to the DAG which convert tuple T to tuple O |
void |
populateDag(com.datatorrent.api.DAG dag)
Populate existing dag
|
<STREAM extends ApexStream<T>> |
print()
Add a stdout console output operator
|
<STREAM extends ApexStream<T>> |
print(Option... opts)
Add a stdout console output operator
|
<STREAM extends ApexStream<T>> |
printErr()
Add a stderr console output operator
|
void |
run()
Submit the application to cluster
|
void |
runEmbedded(boolean async,
long duration,
Callable<Boolean> exitCondition)
Run the stream application in local mode
In Async mode, the method would return immediately and the dag would run for "duration" milliseconds
In Sync mode, the method would block "duration" milliseconds to run the dag
If duration is negative the dag would run forever until being killed
|
<STREAM extends ApexStream<T>> |
setGlobalAttribute(com.datatorrent.api.Attribute attribute,
Object value)
Set attributes at the DAG level
|
<STREAM extends ApexStream<T>> |
union(ApexStream<T>... others)
Union multiple stream into one
|
WindowedStream<T> |
window(WindowOption windowOption)
Chunk tuples into Windows
Window Transform are defined in
WindowedStream |
WindowedStream<T> |
window(WindowOption windowOption,
TriggerOption triggerOption)
Chunk tuple into windows with window option and trigger option
|
WindowedStream<T> |
window(WindowOption windowOption,
TriggerOption triggerOption,
org.joda.time.Duration allowLateness)
Chunk tuple into windows with window option and trigger option and allowed lateness
|
<STREAM extends ApexStream<T>> |
with(com.datatorrent.api.Attribute attribute,
Object value)
Set the attribute value
If it is DAG attribute, it will be applied to the whole DAG If it is Operator attribute, it will be applied to last connected operatorIf it is InputPort attribute, it will be applied to the input port of the last connected streamIf it is OutputPort attribute, it will be applied to the output port of the last connected streamIf it is both InputPort&OutputPort attribute, it will be applied to last connected stream |
<STREAM extends ApexStream<T>> |
with(com.datatorrent.api.DAG.Locality locality)
Set the locality
|
<STREAM extends ApexStream<T>> |
with(String propName,
Object value)
Set the property value of the last connected operator
|
<O,STREAM extends ApexStream<O>> STREAM map(Function.MapFunction<T,O> mapFunction, Option... opts)
O - Type of the outputmapFunction - map function<O,STREAM extends ApexStream<O>> STREAM flatMap(Function.FlatMapFunction<T,O> flatten, Option... opts)
O - Type of the outputflatten - flat map<STREAM extends ApexStream<T>> STREAM filter(Function.FilterFunction<T> filter, Option... opts)
filter - filter function<O,STREAM extends ApexStream<O>> STREAM addOperator(com.datatorrent.api.Operator op, com.datatorrent.api.Operator.InputPort<T> inputPort, com.datatorrent.api.Operator.OutputPort<O> outputPort, Option... opts)
O - type of the outputop - Operator added to the streaminputPort - InputPort of the operator that is connected to last exposed OutputPort in the streamoutputPort - OutputPort of the operator will be connected to next operator<O,STREAM extends ApexStream<O>> STREAM endWith(com.datatorrent.api.Operator op, com.datatorrent.api.Operator.InputPort<T> inputPort, Option... opts)
O - type of the outputop - Operator added to the streaminputPort - InputPort of the operator that is connected to last exposed OutputPort in the stream<O,INSTREAM extends ApexStream<T>,OUTSTREAM extends ApexStream<O>> OUTSTREAM addCompositeStreams(CompositeStreamTransform<INSTREAM,OUTSTREAM> compositeStreamTransform)
CompositeStreamTransformcompositeStreamTransform - Composite Streams and Transforms<STREAM extends ApexStream<T>> STREAM union(ApexStream<T>... others)
others - other streams<STREAM extends ApexStream<T>> STREAM print(Option... opts)
<STREAM extends ApexStream<T>> STREAM print()
<STREAM extends ApexStream<T>> STREAM printErr()
<STREAM extends ApexStream<T>> STREAM with(com.datatorrent.api.Attribute attribute, Object value)
DAG attribute, it will be applied to the whole DAG Operator attribute, it will be applied to last connected operatorInputPort attribute, it will be applied to the input port of the last connected streamOutputPort attribute, it will be applied to the output port of the last connected streamInputPort&OutputPort attribute, it will be applied to last connected streamattribute - Attributevalue - value of the attribute<STREAM extends ApexStream<T>> STREAM setGlobalAttribute(com.datatorrent.api.Attribute attribute, Object value)
attribute - Attributevalue - value of the attribute<STREAM extends ApexStream<T>> STREAM with(com.datatorrent.api.DAG.Locality locality)
locality - DAG.Locality<STREAM extends ApexStream<T>> STREAM with(String propName, Object value)
propName - property namevalue - value of the propertycom.datatorrent.api.DAG createDag()
DAGvoid populateDag(com.datatorrent.api.DAG dag)
dag - DAGvoid runEmbedded(boolean async,
long duration,
Callable<Boolean> exitCondition)
async - true if run in Async mode
false if run in sync modevoid run()
WindowedStream<T> window(WindowOption windowOption)
WindowedStreamwindowOption - WindowedStream<T> window(WindowOption windowOption, TriggerOption triggerOption)
windowOption - triggerOption - WindowedStream<T> window(WindowOption windowOption, TriggerOption triggerOption, org.joda.time.Duration allowLateness)
windowOption - triggerOption - allowLateness - Copyright © 2015-2017 Apache Software Foundation. All Rights Reserved.