Package com.rpl.rama
Interface Block
- All Known Subinterfaces:
Block.Impl,Block.MultiOutImpl,Block.OutImpl
public interface Block
Core API for specifying dataflow code using the builder pattern. On module deployment compiles to efficient bytecode.
For learning, a Block can be executed directly using the
Parameters with "arg" in the name can be a var, value, or
execute method.
Parameters with "arg" in the name can be a var, value, or
Expr.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic interfacestatic interface -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic Block.ImplAccumulate value according to depot source options to return with depot appends done with AckLevel.ACKstatic Block.OutImplAggregates input in abatch blockto a single value.static Block.ImplUpdate PState partition on current task with given aggregator.static Block.ImplExecutes subsequent code on all tasks in modulestatic Block.ImplallPartition(String pobjectVar) Executes subsequent code on all partitions of given depot or PStatestatic Block.ImplAttaches a no-op node with the given anchorstatic Block.ImplatomicBlock(Block block) Runs subblock until it completes synchronously.static Block.ImplbatchBlock(Block batchBlock) Specifies a batch block.static Block.Implstatic Block.OutImplcompoundAgg(CompoundAgg compoundAgg) Aggregates input in abatch blockto a single value.static Block.ImplcompoundAgg(String pstateVar, CompoundAgg compoundAgg) Update PState partition on current task with given aggregation template.static Block.ImplEvaluates condition for eachCasein order.static Block.ImplcontinueLoop(Object... args) Executes another iteration of the loop.static Block.Implcreate()Creates an empty Block that can have additional code attached.static Block.ImplChanges task to task ID specified by custom partitioner function with one argument.static <T0> Block.ImplcustomPartition(RamaFunction2<Integer, T0, Integer> op, Object arg0) Changes task to task ID specified by custom partitioner function with two arguments.static <T0,T1> Block.Impl customPartition(RamaFunction3<Integer, T0, T1, Integer> op, Object arg0, Object arg1) Changes task to task ID specified by custom partitioner function with three arguments.static <T0,T1, T2>
Block.ImplcustomPartition(RamaFunction4<Integer, T0, T1, T2, Integer> op, Object arg0, Object arg1, Object arg2) Changes task to task ID specified by custom partitioner function with four arguments.static <T0,T1, T2, T3>
Block.ImplcustomPartition(RamaFunction5<Integer, T0, T1, T2, T3, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3) Changes task to task ID specified by custom partitioner function with five arguments.static <T0,T1, T2, T3, T4>
Block.ImplcustomPartition(RamaFunction6<Integer, T0, T1, T2, T3, T4, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Changes task to task ID specified by custom partitioner function with six arguments.static <T0,T1, T2, T3, T4, T5>
Block.ImplcustomPartition(RamaFunction7<Integer, T0, T1, T2, T3, T4, T5, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) Changes task to task ID specified by custom partitioner function with seven arguments.static <T0,T1, T2, T3, T4, T5, T6>
Block.ImplcustomPartition(RamaFunction8<Integer, T0, T1, T2, T3, T4, T5, T6, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) Changes task to task ID specified by custom partitioner function with eight arguments.static Block.ImplcustomPartition(String pobjectVar, RamaFunction1<Integer, Integer> op) Changes to task containing PState partition specified by custom partitioner function with one argument.static <T0> Block.ImplcustomPartition(String pobjectVar, RamaFunction2<Integer, T0, Integer> op, Object arg0) Changes to task containing PState partition specified by custom partitioner function with two arguments.static <T0,T1> Block.Impl customPartition(String pobjectVar, RamaFunction3<Integer, T0, T1, Integer> op, Object arg0, Object arg1) Changes to task containing PState partition specified by custom partitioner function with three arguments.static <T0,T1, T2>
Block.ImplcustomPartition(String pobjectVar, RamaFunction4<Integer, T0, T1, T2, Integer> op, Object arg0, Object arg1, Object arg2) Changes to task containing PState partition specified by custom partitioner function with four arguments.static <T0,T1, T2, T3>
Block.ImplcustomPartition(String pobjectVar, RamaFunction5<Integer, T0, T1, T2, T3, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3) Changes to task containing PState partition specified by custom partitioner function with five arguments.static <T0,T1, T2, T3, T4>
Block.ImplcustomPartition(String pobjectVar, RamaFunction6<Integer, T0, T1, T2, T3, T4, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Changes to task containing PState partition specified by custom partitioner function with six arguments.static <T0,T1, T2, T3, T4, T5>
Block.ImplcustomPartition(String pobjectVar, RamaFunction7<Integer, T0, T1, T2, T3, T4, T5, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) Changes to task containing PState partition specified by custom partitioner function with seven arguments.static <T0,T1, T2, T3, T4, T5, T6>
Block.ImplcustomPartition(String pobjectVar, RamaFunction8<Integer, T0, T1, T2, T3, T4, T5, T6, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) Changes to task containing PState partition specified by custom partitioner function with eight arguments.static Block.OutImpldepotPartitionAppend(String depotVar, Object arg) Append data to the partition of the depot represented by current task.static Block.OutImpldepotPartitionAppend(String depotVar, Object arg, AckLevel ackLevel) Append data to the partition of the depot represented by current task.static Block.ImpldirectPartition(Object argTaskId) Changes to specified task IDstatic Block.ImpldirectPartition(String pobjectVar, Object argPartitionId) Changes to specified partition of the given depot or PStatestatic <R> Block.OutImpleach(RamaFunction0<R> op) Invokes a function of zero arguments.static <T0,R> Block.OutImpl each(RamaFunction1<T0, R> op, Object arg0) Invokes a function of one argument.static <T0,T1, R>
Block.OutImpleach(RamaFunction2<T0, T1, R> op, Object arg0, Object arg1) Invokes a function of two arguments.static <T0,T1, T2, R>
Block.OutImpleach(RamaFunction3<T0, T1, T2, R> op, Object arg0, Object arg1, Object arg2) Invokes a function of three arguments.static <T0,T1, T2, T3, R>
Block.OutImplInvokes a function of four arguments.static <T0,T1, T2, T3, T4, R>
Block.OutImpleach(RamaFunction5<T0, T1, T2, T3, T4, R> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Invokes a function of five arguments.static <T0,T1, T2, T3, T4, T5, R>
Block.OutImpleach(RamaFunction6<T0, T1, T2, T3, T4, T5, R> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) Invokes a function of six arguments.static <T0,T1, T2, T3, T4, T5, T6, R>
Block.OutImpleach(RamaFunction7<T0, T1, T2, T3, T4, T5, T6, R> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) Invokes a function of seven arguments.static <T0,T1, T2, T3, T4, T5, T6, T7, R>
Block.OutImpleach(RamaFunction8<T0, T1, T2, T3, T4, T5, T6, T7, R> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) Invokes a function of eight arguments.static Block.MultiOutImpleach(RamaOperation0 op) Invokes an operation of zero arguments.static <T0> Block.MultiOutImpleach(RamaOperation1<T0> op, Object arg0) Invokes an operation of one argument.static <T0,T1> Block.MultiOutImpl each(RamaOperation2<T0, T1> op, Object arg0, Object arg1) Invokes an operation of two arguments.static <T0,T1, T2>
Block.MultiOutImpleach(RamaOperation3<T0, T1, T2> op, Object arg0, Object arg1, Object arg2) Invokes an operation of three arguments.static <T0,T1, T2, T3>
Block.MultiOutImplInvokes an operation of four arguments.static <T0,T1, T2, T3, T4>
Block.MultiOutImpleach(RamaOperation5<T0, T1, T2, T3, T4> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Invokes an operation of five arguments.static <T0,T1, T2, T3, T4, T5>
Block.MultiOutImpleach(RamaOperation6<T0, T1, T2, T3, T4, T5> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) Invokes an operation of six arguments.static <T0,T1, T2, T3, T4, T5, T6>
Block.MultiOutImpleach(RamaOperation7<T0, T1, T2, T3, T4, T5, T6> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) Invokes an operation of seven arguments.static <T0,T1, T2, T3, T4, T5, T6, T7>
Block.MultiOutImpleach(RamaOperation8<T0, T1, T2, T3, T4, T5, T6, T7> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) Invokes an operation of eight arguments.static Block.OutImplInvokes a function of zero arguments that returns its result asynchronously via a returned CompletableFuture.static <T0> Block.OutImpleachAsync(RamaFunction1<T0, CompletableFuture> op, Object arg0) Invokes a function of one argument that returns its result asynchronously via a returned CompletableFuture.static <T0,T1> Block.OutImpl eachAsync(RamaFunction2<T0, T1, CompletableFuture> op, Object arg0, Object arg1) Invokes a function of two arguments that returns its result asynchronously via a returned CompletableFuture.static <T0,T1, T2>
Block.OutImpleachAsync(RamaFunction3<T0, T1, T2, CompletableFuture> op, Object arg0, Object arg1, Object arg2) Invokes a function of three arguments that returns its result asynchronously via a returned CompletableFuture.static <T0,T1, T2, T3>
Block.OutImpleachAsync(RamaFunction4<T0, T1, T2, T3, CompletableFuture> op, Object arg0, Object arg1, Object arg2, Object arg3) Invokes a function of four arguments that returns its result asynchronously via a returned CompletableFuture.static <T0,T1, T2, T3, T4>
Block.OutImpleachAsync(RamaFunction5<T0, T1, T2, T3, T4, CompletableFuture> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Invokes a function of five arguments that returns its result asynchronously via a returned CompletableFuture.static <T0,T1, T2, T3, T4, T5>
Block.OutImpleachAsync(RamaFunction6<T0, T1, T2, T3, T4, T5, CompletableFuture> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) Invokes a function of six arguments that returns its result asynchronously via a returned CompletableFuture.static <T0,T1, T2, T3, T4, T5, T6>
Block.OutImpleachAsync(RamaFunction7<T0, T1, T2, T3, T4, T5, T6, CompletableFuture> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) Invokes a function of seven arguments that returns its result asynchronously via a returned CompletableFuture.static <T0,T1, T2, T3, T4, T5, T6, T7>
Block.OutImpleachAsync(RamaFunction8<T0, T1, T2, T3, T4, T5, T6, T7, CompletableFuture> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) Invokes a function of eight arguments that returns its result asynchronously via a returned CompletableFuture.static Block.ImplEmits from a loop.static Block.OutImplexplodeMaterialized(String pstateVar) Emits all tuples across all partitions of a temporary PState created frommaterialize(java.lang.Object...).static Block.OutImplexplodeMicrobatch(String microbatchVar) Emits all data for this microbatch source across all partitions of depotstatic Block.ImplDeclares a new batch source within pre-agg portion of abatch blockstatic Block.ImplChanges to task 0static Block.ImplglobalPartition(String pobjectVar) Changes to partition 0 of given depot or PState.static Block.ImplGroups input by one key and performs aggregations in the specified block on each group of data independently.static Block.ImplGroups input by two keys and performs aggregations in the specified block on each group of data independently.static Block.ImplGroups input by three keys and performs aggregations in the specified block on each group of data independently.static Block.ImplGroups input by four keys and performs aggregations in the specified block on each group of data independently.static Block.ImplGroups input by five keys and performs aggregations in the specified block on each group of data independently.static Block.ImplgroupBy(String var0, String var1, String var2, String var3, String var4, String var5, Block groupByBlock) Groups input by six keys and performs aggregations in the specified block on each group of data independently.static Block.ImplhashPartition(Object arg) Changes tasks based on hash of argument modulo number of tasks in module.static Block.ImplhashPartition(String pobjectVar, Object arg) Changes tasks based on hash of argument modulo number of partitions of given depot or PState.static Block.ImplChanges attachment point for subsequent code to node with given anchorstatic Block.ImplIf argument is truthy (not null or boolean false), runs thenBlock.static Block.ImplIf argument is truthy (not null or boolean false), runs thenBlock – otherwise, runs elseBlock.static Block.OutImplinvokeQuery(String queryVarOrTopologyName, Object... args) Invokes a colocated or mirror query topologystatic Block.ImplContinues dataflow execution only if arg is truthy (not null or boolean false).static Block.ImplLimits incoming data to a fixed amount according to optional sort options.static Block.ImpllocalClear(String pstateVar) Removes all data from the PState partition on current task.static Block.OutImpllocalSelect(String pstateVar, Path path) Navigates into the PState partition on current task using the givenPath.static Block.OutImpllocalSelect(String pstateVar, Path path, SelectOptions options) Navigates into the PState partition on current task using the givenPath.static Block.ImpllocalTransform(String pstateVar, Path path) Executestransform Pathon the PState partition on current task.static Block.OutImplCreates a dataflow loop with the given body.static Block.OutImplloopWithVars(LoopVars loopVars, Block loopBlock) Creates a dataflow loop with the given vars and body.static Block.ImplInserts all code from given Block into the current callsite.static Block.OutImplmaterialize(Object... args) Produces a temporary PState of tuples within a batch block in a microbatch topology.static Block.ImplChanges back to starting task for a query topology invocation.static Block.ImplpathPartition(String pstateVar, Path path) Changes to task for given PState containing data for givenPathstatic Block.OutImplChanges to task for given PState containing data for givenPathand then performs alocalSelect.static Block.OutImplselect(Object arg, Path path, SelectOptions options) Changes to task for given PState containing data for givenPathand then performs alocalSelect.static Block.ImplChanges to a random task chosen uniformly.static Block.OutImplUse specified SubBatch as a batch source in abatch block.static Block.ImplConditionally dispatch code based on type of input objectstatic Block.ImplAttaches subsequent code to each of the anchors specified, merging computation flowing out of those nodes.static Block.ImplYield the task thread if current event is using too much time.
-
Method Details
-
create
Creates an empty Block that can have additional code attached.Block.each(Ops.PRINTLN)is the same asBlock.create().each(Ops.PRINTLN) -
anchor
Attaches a no-op node with the given anchor- Parameters:
anchor- Label for the node- See Also:
-
atomicBlock
Runs subblock until it completes synchronously. Then runs code following atomicBlock exactly one time.- Parameters:
block- Subblock- See Also:
-
branch
-
each
Invokes a function of zero arguments. Each argument can be a value, var, orExpr. A function always emits exactly one time. Output can be captured with a call tooutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
Invokes a function of one argument. Each argument can be a value, var, orExpr. A function always emits exactly one time. Output can be captured with a call tooutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
Invokes a function of two arguments. Each argument can be a value, var, orExpr. A function always emits exactly one time. Output can be captured with a call tooutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.OutImpl eachT2, R> (RamaFunction3<T0, T1, T2, R> op, Object arg0, Object arg1, Object arg2) Invokes a function of three arguments. Each argument can be a value, var, orExpr. A function always emits exactly one time. Output can be captured with a call tooutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.OutImpl eachT2, T3, R> (RamaFunction4<T0, T1, T2, T3, R> op, Object arg0, Object arg1, Object arg2, Object arg3) Invokes a function of four arguments. Each argument can be a value, var, orExpr. A function always emits exactly one time. Output can be captured with a call tooutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.OutImpl eachT2, T3, T4, R> (RamaFunction5<T0, T1, T2, T3, T4, R> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Invokes a function of five arguments. Each argument can be a value, var, orExpr. A function always emits exactly one time. Output can be captured with a call tooutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.OutImpl eachT2, T3, T4, T5, R> (RamaFunction6<T0, T1, T2, T3, T4, T5, R> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) Invokes a function of six arguments. Each argument can be a value, var, orExpr. A function always emits exactly one time. Output can be captured with a call tooutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.OutImpl eachT2, T3, T4, T5, T6, R> (RamaFunction7<T0, T1, T2, T3, T4, T5, T6, R> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) Invokes a function of seven arguments. Each argument can be a value, var, orExpr. A function always emits exactly one time. Output can be captured with a call tooutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.OutImpl eachT2, T3, T4, T5, T6, T7, R> (RamaFunction8<T0, T1, T2, T3, T4, T5, T6, T7, R> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) Invokes a function of eight arguments. Each argument can be a value, var, orExpr. A function always emits exactly one time. Output can be captured with a call tooutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
Invokes an operation of zero arguments. Each argument can be a value, var, orExpr. An operation can emit any number of times to any number of output streams. Output can be captured with calls tooutStreamandoutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Operation to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
Invokes an operation of one argument. Each argument can be a value, var, orExpr. An operation can emit any number of times to any number of output streams. Output can be captured with calls tooutStreamandoutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Operation to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
Invokes an operation of two arguments. Each argument can be a value, var, orExpr. An operation can emit any number of times to any number of output streams. Output can be captured with calls tooutStreamandoutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Operation to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.MultiOutImpl eachT2> (RamaOperation3<T0, T1, T2> op, Object arg0, Object arg1, Object arg2) Invokes an operation of three arguments. Each argument can be a value, var, orExpr. An operation can emit any number of times to any number of output streams. Output can be captured with calls tooutStreamandoutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Operation to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.MultiOutImpl eachT2, T3> (RamaOperation4<T0, T1, T2, T3> op, Object arg0, Object arg1, Object arg2, Object arg3) Invokes an operation of four arguments. Each argument can be a value, var, orExpr. An operation can emit any number of times to any number of output streams. Output can be captured with calls tooutStreamandoutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Operation to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.MultiOutImpl eachT2, T3, T4> (RamaOperation5<T0, T1, T2, T3, T4> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Invokes an operation of five arguments. Each argument can be a value, var, orExpr. An operation can emit any number of times to any number of output streams. Output can be captured with calls tooutStreamandoutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Operation to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.MultiOutImpl eachT2, T3, T4, T5> (RamaOperation6<T0, T1, T2, T3, T4, T5> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) Invokes an operation of six arguments. Each argument can be a value, var, orExpr. An operation can emit any number of times to any number of output streams. Output can be captured with calls tooutStreamandoutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Operation to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.MultiOutImpl eachT2, T3, T4, T5, T6> (RamaOperation7<T0, T1, T2, T3, T4, T5, T6> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) Invokes an operation of seven arguments. Each argument can be a value, var, orExpr. An operation can emit any number of times to any number of output streams. Output can be captured with calls tooutStreamandoutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Operation to execute. Can also be specified as a lambda or method reference.- See Also:
-
each
static <T0,T1, Block.MultiOutImpl eachT2, T3, T4, T5, T6, T7> (RamaOperation8<T0, T1, T2, T3, T4, T5, T6, T7> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) Invokes an operation of eight arguments. Each argument can be a value, var, orExpr. An operation can emit any number of times to any number of output streams. Output can be captured with calls tooutStreamandoutfollowing this node. Built-in functions and operations can be found as static fields of theOps class.- Parameters:
op- Operation to execute. Can also be specified as a lambda or method reference.- See Also:
-
eachAsync
Invokes a function of zero arguments that returns its result asynchronously via a returned CompletableFuture. This is used to interact with external systems without blocking the task thread. Each argument can be a value, var, orExpr. Output can be captured with a call tooutfollowing this node. The var bound byoutis the value delivered to the returned CompletableFuture.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
eachAsync
Invokes a function of one argument that returns its result asynchronously via a returned CompletableFuture. This is used to interact with external systems without blocking the task thread. Each argument can be a value, var, orExpr. Output can be captured with a call tooutfollowing this node. The var bound byoutis the value delivered to the returned CompletableFuture.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
eachAsync
static <T0,T1> Block.OutImpl eachAsync(RamaFunction2<T0, T1, CompletableFuture> op, Object arg0, Object arg1) Invokes a function of two arguments that returns its result asynchronously via a returned CompletableFuture. This is used to interact with external systems without blocking the task thread. Each argument can be a value, var, orExpr. Output can be captured with a call tooutfollowing this node. The var bound byoutis the value delivered to the returned CompletableFuture.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
eachAsync
static <T0,T1, Block.OutImpl eachAsyncT2> (RamaFunction3<T0, T1, T2, CompletableFuture> op, Object arg0, Object arg1, Object arg2) Invokes a function of three arguments that returns its result asynchronously via a returned CompletableFuture. This is used to interact with external systems without blocking the task thread. Each argument can be a value, var, orExpr. Output can be captured with a call tooutfollowing this node. The var bound byoutis the value delivered to the returned CompletableFuture.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
eachAsync
static <T0,T1, Block.OutImpl eachAsyncT2, T3> (RamaFunction4<T0, T1, T2, T3, CompletableFuture> op, Object arg0, Object arg1, Object arg2, Object arg3) Invokes a function of four arguments that returns its result asynchronously via a returned CompletableFuture. This is used to interact with external systems without blocking the task thread. Each argument can be a value, var, orExpr. Output can be captured with a call tooutfollowing this node. The var bound byoutis the value delivered to the returned CompletableFuture.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
eachAsync
static <T0,T1, Block.OutImpl eachAsyncT2, T3, T4> (RamaFunction5<T0, T1, T2, T3, T4, CompletableFuture> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Invokes a function of five arguments that returns its result asynchronously via a returned CompletableFuture. This is used to interact with external systems without blocking the task thread. Each argument can be a value, var, orExpr. Output can be captured with a call tooutfollowing this node. The var bound byoutis the value delivered to the returned CompletableFuture.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
eachAsync
static <T0,T1, Block.OutImpl eachAsyncT2, T3, T4, T5> (RamaFunction6<T0, T1, T2, T3, T4, T5, CompletableFuture> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) Invokes a function of six arguments that returns its result asynchronously via a returned CompletableFuture. This is used to interact with external systems without blocking the task thread. Each argument can be a value, var, orExpr. Output can be captured with a call tooutfollowing this node. The var bound byoutis the value delivered to the returned CompletableFuture.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
eachAsync
static <T0,T1, Block.OutImpl eachAsyncT2, T3, T4, T5, T6> (RamaFunction7<T0, T1, T2, T3, T4, T5, T6, CompletableFuture> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) Invokes a function of seven arguments that returns its result asynchronously via a returned CompletableFuture. This is used to interact with external systems without blocking the task thread. Each argument can be a value, var, orExpr. Output can be captured with a call tooutfollowing this node. The var bound byoutis the value delivered to the returned CompletableFuture.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
eachAsync
static <T0,T1, Block.OutImpl eachAsyncT2, T3, T4, T5, T6, T7> (RamaFunction8<T0, T1, T2, T3, T4, T5, T6, T7, CompletableFuture> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) Invokes a function of eight arguments that returns its result asynchronously via a returned CompletableFuture. This is used to interact with external systems without blocking the task thread. Each argument can be a value, var, orExpr. Output can be captured with a call tooutfollowing this node. The var bound byoutis the value delivered to the returned CompletableFuture.- Parameters:
op- Function to execute. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
Changes task to task ID specified by custom partitioner function with one argument. Custom partitioner function receives all dataflow arguments followed by the number of tasks in the module.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
Changes task to task ID specified by custom partitioner function with two arguments. Custom partitioner function receives all dataflow arguments followed by the number of tasks in the module.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1> Block.Impl customPartition(RamaFunction3<Integer, T0, T1, Integer> op, Object arg0, Object arg1) Changes task to task ID specified by custom partitioner function with three arguments. Custom partitioner function receives all dataflow arguments followed by the number of tasks in the module.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1, Block.Impl customPartitionT2> (RamaFunction4<Integer, T0, T1, T2, Integer> op, Object arg0, Object arg1, Object arg2) Changes task to task ID specified by custom partitioner function with four arguments. Custom partitioner function receives all dataflow arguments followed by the number of tasks in the module.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1, Block.Impl customPartitionT2, T3> (RamaFunction5<Integer, T0, T1, T2, T3, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3) Changes task to task ID specified by custom partitioner function with five arguments. Custom partitioner function receives all dataflow arguments followed by the number of tasks in the module.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1, Block.Impl customPartitionT2, T3, T4> (RamaFunction6<Integer, T0, T1, T2, T3, T4, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Changes task to task ID specified by custom partitioner function with six arguments. Custom partitioner function receives all dataflow arguments followed by the number of tasks in the module.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1, Block.Impl customPartitionT2, T3, T4, T5> (RamaFunction7<Integer, T0, T1, T2, T3, T4, T5, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) Changes task to task ID specified by custom partitioner function with seven arguments. Custom partitioner function receives all dataflow arguments followed by the number of tasks in the module.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1, Block.Impl customPartitionT2, T3, T4, T5, T6> (RamaFunction8<Integer, T0, T1, T2, T3, T4, T5, T6, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) Changes task to task ID specified by custom partitioner function with eight arguments. Custom partitioner function receives all dataflow arguments followed by the number of tasks in the module.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
Changes to task containing PState partition specified by custom partitioner function with one argument. Custom partitioner function receives all dataflow arguments followed by the number of partitions of the PState.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0> Block.Impl customPartition(String pobjectVar, RamaFunction2<Integer, T0, Integer> op, Object arg0) Changes to task containing PState partition specified by custom partitioner function with two arguments. Custom partitioner function receives all dataflow arguments followed by the number of partitions of the PState.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1> Block.Impl customPartition(String pobjectVar, RamaFunction3<Integer, T0, T1, Integer> op, Object arg0, Object arg1) Changes to task containing PState partition specified by custom partitioner function with three arguments. Custom partitioner function receives all dataflow arguments followed by the number of partitions of the PState.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1, Block.Impl customPartitionT2> (String pobjectVar, RamaFunction4<Integer, T0, T1, T2, Integer> op, Object arg0, Object arg1, Object arg2) Changes to task containing PState partition specified by custom partitioner function with four arguments. Custom partitioner function receives all dataflow arguments followed by the number of partitions of the PState.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1, Block.Impl customPartitionT2, T3> (String pobjectVar, RamaFunction5<Integer, T0, T1, T2, T3, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3) Changes to task containing PState partition specified by custom partitioner function with five arguments. Custom partitioner function receives all dataflow arguments followed by the number of partitions of the PState.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1, Block.Impl customPartitionT2, T3, T4> (String pobjectVar, RamaFunction6<Integer, T0, T1, T2, T3, T4, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4) Changes to task containing PState partition specified by custom partitioner function with six arguments. Custom partitioner function receives all dataflow arguments followed by the number of partitions of the PState.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1, Block.Impl customPartitionT2, T3, T4, T5> (String pobjectVar, RamaFunction7<Integer, T0, T1, T2, T3, T4, T5, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) Changes to task containing PState partition specified by custom partitioner function with seven arguments. Custom partitioner function receives all dataflow arguments followed by the number of partitions of the PState.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
customPartition
static <T0,T1, Block.Impl customPartitionT2, T3, T4, T5, T6> (String pobjectVar, RamaFunction8<Integer, T0, T1, T2, T3, T4, T5, T6, Integer> op, Object arg0, Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) Changes to task containing PState partition specified by custom partitioner function with eight arguments. Custom partitioner function receives all dataflow arguments followed by the number of partitions of the PState.- Parameters:
op- Custom partitioner function. Can also be specified as a lambda or method reference.- See Also:
-
groupBy
Groups input by one key and performs aggregations in the specified block on each group of data independently. Only usable inbatchBlock. Emits into postagg the vars for keys and results of aggregations.- Parameters:
groupByBlock- Block containing aggregation code- See Also:
-
groupBy
Groups input by two keys and performs aggregations in the specified block on each group of data independently. Only usable inbatchBlock. Emits into postagg the vars for keys and results of aggregations.- Parameters:
groupByBlock- Block containing aggregation code- See Also:
-
groupBy
Groups input by three keys and performs aggregations in the specified block on each group of data independently. Only usable inbatchBlock. Emits into postagg the vars for keys and results of aggregations.- Parameters:
groupByBlock- Block containing aggregation code- See Also:
-
groupBy
Groups input by four keys and performs aggregations in the specified block on each group of data independently. Only usable inbatchBlock. Emits into postagg the vars for keys and results of aggregations.- Parameters:
groupByBlock- Block containing aggregation code- See Also:
-
groupBy
static Block.Impl groupBy(String var0, String var1, String var2, String var3, String var4, Block groupByBlock) Groups input by five keys and performs aggregations in the specified block on each group of data independently. Only usable inbatchBlock. Emits into postagg the vars for keys and results of aggregations.- Parameters:
groupByBlock- Block containing aggregation code- See Also:
-
groupBy
static Block.Impl groupBy(String var0, String var1, String var2, String var3, String var4, String var5, Block groupByBlock) Groups input by six keys and performs aggregations in the specified block on each group of data independently. Only usable inbatchBlock. Emits into postagg the vars for keys and results of aggregations.- Parameters:
groupByBlock- Block containing aggregation code- See Also:
-
hook
Changes attachment point for subsequent code to node with given anchor- Parameters:
anchor- Label of node to attach to- See Also:
-
ifTrue
If argument is truthy (not null or boolean false), runs thenBlock. In either case, continues to the code following the ifTrue. -
ifTrue
If argument is truthy (not null or boolean false), runs thenBlock – otherwise, runs elseBlock. In either case, continues to the code following the ifTrue. -
keepTrue
Continues dataflow execution only if arg is truthy (not null or boolean false).- Parameters:
arg- Value, var, orExpr- See Also:
-
unify
Attaches subsequent code to each of the anchors specified, merging computation flowing out of those nodes. After the unify the only vars in scope are vars that exist in all parent branches. Must unify at least two nodes.- See Also:
-
loop
Creates a dataflow loop with the given body.emitLoopis used to emit from the loop, andcontinueLoopis used to execute the loop body again. A loop call can be optionally followed by a call tooutto capture any output emitted as vars.- Parameters:
loopBlock- Body of the loop- See Also:
-
loopWithVars
Creates a dataflow loop with the given vars and body.emitLoopis used to emit from the loop, andcontinueLoopis used to execute the loop body again. The vars are given initial values and updated with each call tocontinueLoop. A loopWithVars call can be optionally followed by a call tooutto capture any output emitted as vars.- Parameters:
loopVars- Declaration of vars for each iteration of looploopBlock- Body of the loop- See Also:
-
continueLoop
Executes another iteration of the loop. Can only be used withinlooporloopWithVars. When used withloopWithVars, must provide as input values for all loop vars for the next loop iteration.- Parameters:
args- Values for loop vars for next iteration of loop- See Also:
-
emitLoop
Emits from a loop. Can only be used withinlooporloopWithVars. This is only way for code followinglooporloopWithVarsto execute.- Parameters:
args- Values to emit- See Also:
-
select
Changes to task for given PState containing data for givenPathand then performs alocalSelect. PState reference can be colocated PState or mirror PState. Code after select stays on new task and does not go back to original task.- Parameters:
arg- PState or object to query. Only changes tasks if PState var.path- Path definition- See Also:
-
select
Changes to task for given PState containing data for givenPathand then performs alocalSelect. PState reference can be colocated PState or mirror PState. Code after select stays on new task and does not go back to original task.- Parameters:
arg- PState or object to query. Only changes tasks if PState var.path- Path definitionoptions- Options for select call- See Also:
-
localSelect
Navigates into the PState partition on current task using the givenPath. Emits once for every value navigated to. Useoutto capture emits into subsequent dataflow code.- Parameters:
pstateVar- PState to querypath- Path definition- See Also:
-
localSelect
Navigates into the PState partition on current task using the givenPath. Emits once for every value navigated to. Useoutto capture emits into subsequent dataflow code.- Parameters:
pstateVar- PState to querypath- Path definitionoptions- Options for localSelect call- See Also:
-
localTransform
Executestransform Pathon the PState partition on current task.- Parameters:
pstateVar- PState to modifypath- Path definition- See Also:
-
localClear
Removes all data from the PState partition on current task. Can only be used with PStates owned by stream topologies. Extremely expensive to run for large PState partitions.- Parameters:
pstateVar- PState to clear- See Also:
-
hashPartition
Changes tasks based on hash of argument modulo number of tasks in module. The same argument always hashes to the same task.- Parameters:
arg- Value, var, orExpr- See Also:
-
hashPartition
Changes tasks based on hash of argument modulo number of partitions of given depot or PState. The same argument always hashes to the same task.- Parameters:
pobjectVar- Depot or PState referencearg- Value, var, orExpr- See Also:
-
allPartition
Executes subsequent code on all tasks in module- See Also:
-
allPartition
Executes subsequent code on all partitions of given depot or PState- Parameters:
pobjectVar- Depot or PState reference- See Also:
-
globalPartition
Changes to task 0- See Also:
-
globalPartition
Changes to partition 0 of given depot or PState. For colocated depots and PStates this will be task 0.- Parameters:
pobjectVar- Depot or PState reference- See Also:
-
shufflePartition
Changes to a random task chosen uniformly.- See Also:
-
directPartition
Changes to specified task ID- Parameters:
argTaskId- Value, var, orExpr- See Also:
-
directPartition
Changes to specified partition of the given depot or PState- Parameters:
pobjectVar- Depot or PState referenceargPartitionId- Value, var, orExpr- See Also:
-
pathPartition
Changes to task for given PState containing data for givenPath- Parameters:
pstateVar- PState referencepath- Path definition- See Also:
-
originPartition
Changes back to starting task for a query topology invocation. Can only be used in query topologies and must be final partitioner used.- See Also:
-
agg
Aggregates input in abatch blockto a single value. Capture output without.- Parameters:
agg- Aggregator to use- See Also:
-
agg
Update PState partition on current task with given aggregator. Can be used in batch blocks or regular blocks.- Parameters:
pstateVar- PState referenceagg- Aggregator to use- See Also:
-
limitAgg
Limits incoming data to a fixed amount according to optional sort options. Only usable in batch blocks and operates during agg and post-agg phases.- Parameters:
limitAgg- Definition of aggregator- See Also:
-
compoundAgg
Aggregates input in abatch blockto a single value. Aggregation specified using a data structure template. Capture output without.- Parameters:
compoundAgg- Data structure template of aggregation- See Also:
-
compoundAgg
Update PState partition on current task with given aggregation template. Can be used in batch blocks or regular blocks.- Parameters:
pstateVar- PState referencecompoundAgg- Data structure template of aggregation- See Also:
-
batchBlock
Specifies a batch block. A batch block is partially declarative and supports joins, multiple step aggregation, and more. See the extended documentation for details.- Parameters:
batchBlock- Body of batch block- See Also:
-
freshBatchSource
Declares a new batch source within pre-agg portion of abatch block- See Also:
-
materialize
Produces a temporary PState of tuples within a batch block in a microbatch topology. Use subsequentoutcall to name the PState.- Parameters:
args- Values to capture into tuples- See Also:
-
explodeMaterialized
Emits all tuples across all partitions of a temporary PState created frommaterialize(java.lang.Object...). Use subsequentoutcall to assign vars to each element of materialized tuples.- Parameters:
pstateVar- Temporary PState reference- See Also:
-
explodeMicrobatch
Emits all data for this microbatch source across all partitions of depot- Parameters:
microbatchVar- Var representing microbatch coming from depot source- See Also:
-
invokeQuery
Invokes a colocated or mirror query topology- Parameters:
queryVarOrTopologyName- Either the name of a query topology in same module or var for another module's query topology assigned when callingclusterQueryargs- Arguments to query topology- See Also:
-
depotPartitionAppend
Append data to the partition of the depot represented by current task. Note that this does not use the built-in partitioning scheme of the depot. To append to a mirror depot, must partition to the mirror depot with a partitioner. -
depotPartitionAppend
Append data to the partition of the depot represented by current task. Note that this does not use the built-in partitioning scheme of the depot. To append to a mirror depot, must partition to the mirror depot with a partitioner. Defaults to AckLevel.APPEND_ACK.- Parameters:
depotVar- Depot referencearg- Value, var, orExpr- See Also:
-
subBatch
Use specified SubBatch as a batch source in abatch block. Capture output of SubBatch into vars using subsequentoutcall.- See Also:
-
macro
Inserts all code from given Block into the current callsite. This facility allows dataflow code to be broken up into reusable chunks.- Parameters:
block- Dataflow code- See Also:
-
subSource
Conditionally dispatch code based on type of input object- Parameters:
arg- Object to dispatch onsubsources- Any number of declarations specifying a matching type and dataflow code- See Also:
-
cond
Evaluates condition for eachCasein order. Stops checking on first matching condition and evaluates that case's dataflow code. If no condition matches, dataflow stops.- Parameters:
cases- Any number ofCasedeclarations
-
yieldIfOvertime
Yield the task thread if current event is using too much time. Commonly used in loop bodies.- See Also:
-
ackReturn
Accumulate value according to depot source options to return with depot appends done with AckLevel.ACK- Parameters:
arg- Value to accumulate- See Also:
-