Class Ops

java.lang.Object
com.rpl.rama.ops.Ops

public class Ops extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.rpl.rama.impl.NativeAnyArityRamaOperation
    "and" operator based on values being "truthy" (not null or false).
    static final com.rpl.rama.impl.NativeRamaFunction1<Object,Class>
    Emits Class of argument.
    static final com.rpl.rama.impl.NativeRamaFunction2<Collection,Object,Boolean>
    Arguments are a collection and an object and returns boolean true or false if the object is contained in the collection.
    static final com.rpl.rama.impl.NativeRamaFunction0<Long>
    Returns ID of current microbatch attempt.
    static final com.rpl.rama.impl.NativeRamaFunction0<Integer>
    Emits task ID where event is running
    static final com.rpl.rama.impl.NativeRamaFunction0<String>
    Returns the type of the current topology ("stream", "microbatch", or "query"), or else null.
    static final com.rpl.rama.impl.NativeRamaFunction1<Number,Integer>
    Emits one less than input value as an Integer
    static final com.rpl.rama.impl.NativeRamaFunction1<Number,Long>
    Emits one less than input value as a Long
    static final com.rpl.rama.impl.NativeRamaFunction2<Number,Number,Double>
    Divides first argument by second argument and emits a Double
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Tests whether all arguments are equal and emits boolean true or false.
    static final com.rpl.rama.impl.NativeRamaOperation1<List<Object>>
    Emits every element of input list as a separate field.
    static final com.rpl.rama.impl.NativeRamaOperation1<Object>
    Emits every element of input list individually.
    static final com.rpl.rama.impl.NativeRamaOperation1<Object>
    Emits every element of input list individually along with index of emit.
    static final com.rpl.rama.impl.NativeRamaOperation1<Object>
    Emits every key/value pair of input map individually.
    static final com.rpl.rama.impl.NativeRamaFunction1<Object,Object>
    Extracts contents of a PState as a value.
    static final com.rpl.rama.impl.NativeRamaFunction1<Object,Object>
    Emits first element of input collection or null if it is empty.
    static final com.rpl.rama.impl.NativeRamaFunction2<Object,Object,Object>
    Arguments are a collection and a key and emits the value for the key in the collection.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits boolean true or false on if each argument is greater than the next argument.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits boolean true or false on if each argument is greater than or equal to the next argument.
    static final com.rpl.rama.impl.NativeRamaFunction1<Object,Object>
    Emits input argument
    static final com.rpl.rama.impl.NativeRamaFunction1<Number,Integer>
    Emits one more than input value as an Integer
    static final com.rpl.rama.impl.NativeRamaFunction1<Number,Long>
    Emits one more than input value as a Long
    static final com.rpl.rama.impl.NativeRamaFunction1<Number,Boolean>
    Emits boolean true or false on whether input argument is an even number
    static final com.rpl.rama.impl.NativeRamaFunction2<Class,Object,Boolean>
    Arguments are a Class and object and emits boolean true or false on whether the second argument is an instance of the first argument
    static final com.rpl.rama.impl.NativeRamaFunction1<Number,Boolean>
    Emits boolean true or false on whether input argument is a negative number
    static final com.rpl.rama.impl.NativeRamaFunction1<Object,Boolean>
    Emits boolean true or false on whether input argument is not null
    static final com.rpl.rama.impl.NativeRamaFunction1<Object,Boolean>
    Emits boolean true or false on whether input argument is null
    static final com.rpl.rama.impl.NativeRamaFunction1<Object,Boolean>
    Emits boolean true or false on whether input argument is a number
    static final com.rpl.rama.impl.NativeRamaFunction1<Number,Boolean>
    Emits boolean true or false on whether input argument is an odd number
    static final com.rpl.rama.impl.NativeRamaFunction1<Number,Boolean>
    Emits boolean true or false on whether input argument is a positive number
    static final com.rpl.rama.impl.NativeRamaFunction1<Object,Object>
    Emits last element of input collection or null if it is empty.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits boolean true or false on if each argument is less than the next argument.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits boolean true or false on if each argument is less than or equal to the next argument.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Logs at debug level using slf4j Logger.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Logs at error level using slf4j Logger.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Logs at info level using slf4j Logger.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Logs at trace level using slf4j Logger.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Logs at warn level using slf4j Logger.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits maximum value of all input arguments
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits minimum value of all input arguments
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits result of subtracting all arguments after the first argument from the first argument as an Integer.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits result of subtracting all arguments after the first argument from the first argument as a Long.
    static final com.rpl.rama.impl.NativeRamaFunction0<ModuleInstanceInfo>
    Emits ModuleInstanceInfo for module and worker of running event
    static final com.rpl.rama.impl.NativeRamaFunction2<Number,Number,Integer>
    Emits first argument modulo the second argument as an Integer
    static final com.rpl.rama.impl.NativeRamaFunction2<Number,Number,Long>
    Emits first argument modulo the second argument as a Long
    static final com.rpl.rama.impl.NativeRamaFunction1<Object,Boolean>
    "not" operator based on whether input is "truthy" (not null or false).
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Tests whether any arguments are not equal and emits boolean true or false.
    static final com.rpl.rama.impl.NativeAnyArityRamaOperation
    "or" operator based on values being "truthy" (not null or false).
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits result of adding all input numbers together as an Integer.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits result of adding all input numbers together as a Long.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Prints all input arguments to stdout
    static final com.rpl.rama.impl.NativeRamaOperation2<Number,Number>
    Arguments are a starting integer (inclusive) and an end integer (exclusive) and emits each integer between than range individually Example: Block.each(Ops.RANGE, 10, 20).out("*i")
    static final com.rpl.rama.impl.NativeRamaFunction1<Collection,Integer>
    Emits size of input collection as an Integer
    static final com.rpl.rama.impl.NativeRamaFunction1<Collection,Integer>
    Emits sum of all numbers in input list as an Integer.
    static final com.rpl.rama.impl.NativeRamaFunction1<Collection,Long>
    Emits sum of all numbers in input list as a Long.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits result of multiplying all input numbers together as an Integer.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits result of multiplying all input numbers together as a Long.
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Emits result of converting all input arguments to strings and concatenating them together
    static final com.rpl.rama.impl.NativeAnyArityRamaFunction
    Combines all input arguments into a List Example: Block.each(Ops.TUPLE, 1, 2, 3).out("*tuple")
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ops()
     
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • AND

      public static final com.rpl.rama.impl.NativeAnyArityRamaOperation AND
      "and" operator based on values being "truthy" (not null or false). Emits last truthy value or first non-truthy value. Short-circuits computation by not evaluating Expr arguments after a non-truthy value.

      AND with zero arguments emits boolean true.
    • CLASS

      public static final com.rpl.rama.impl.NativeRamaFunction1<Object,Class> CLASS
      Emits Class of argument. CLASS on null emits null.
    • CONTAINS

      public static final com.rpl.rama.impl.NativeRamaFunction2<Collection,Object,Boolean> CONTAINS
      Arguments are a collection and an object and returns boolean true or false if the object is contained in the collection. null is considered an empty collection.
    • CURRENT_MICROBATCH_ID

      public static final com.rpl.rama.impl.NativeRamaFunction0<Long> CURRENT_MICROBATCH_ID
      Returns ID of current microbatch attempt. Can only be called within a microbatch topology. This can be used to achieve fault-tolerant exactly-once update semantics when updating external systems with Rama's integration API.
      See Also:
    • CURRENT_TOPOLOGY_TYPE

      public static final com.rpl.rama.impl.NativeRamaFunction0<String> CURRENT_TOPOLOGY_TYPE
      Returns the type of the current topology ("stream", "microbatch", or "query"), or else null.
    • CURRENT_TASK_ID

      public static final com.rpl.rama.impl.NativeRamaFunction0<Integer> CURRENT_TASK_ID
      Emits task ID where event is running
      See Also:
    • DEC

      public static final com.rpl.rama.impl.NativeRamaFunction1<Number,Integer> DEC
      Emits one less than input value as an Integer
    • DEC_LONG

      public static final com.rpl.rama.impl.NativeRamaFunction1<Number,Long> DEC_LONG
      Emits one less than input value as a Long
    • DIV

      public static final com.rpl.rama.impl.NativeRamaFunction2<Number,Number,Double> DIV
      Divides first argument by second argument and emits a Double
    • EQUAL

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction EQUAL
      Tests whether all arguments are equal and emits boolean true or false. Uses Object.equals(Object).
    • EXPAND

      public static final com.rpl.rama.impl.NativeRamaOperation1<List<Object>> EXPAND
      Emits every element of input list as a separate field. Useful for processing elements of fixed-size lists.

      Example: Block.each(Ops.EXPAND, Arrays.asList(1, 2, 3)).out("*a", "*b", "*c")
    • EXPLODE

      public static final com.rpl.rama.impl.NativeRamaOperation1<Object> EXPLODE
      Emits every element of input list individually. Number of emits is equal to size of input list.
    • EXPLODE_INDEXED

      public static final com.rpl.rama.impl.NativeRamaOperation1<Object> EXPLODE_INDEXED
      Emits every element of input list individually along with index of emit. Number of emits is equal to size of input list.

      Example: Block.each(Ops.EXPLODE_INDEXED, Arrays.asList(1, 2, 3)).out("*index", "*val")
    • EXPLODE_MAP

      public static final com.rpl.rama.impl.NativeRamaOperation1<Object> EXPLODE_MAP
      Emits every key/value pair of input map individually. Key and value are emitted as separate fields. Number of emits is equal to size of input map.

      Example: Block.each(Ops.EXPLODE_MAP, m).out("*key", "*val")
    • FIRST

      public static final com.rpl.rama.impl.NativeRamaFunction1<Object,Object> FIRST
      Emits first element of input collection or null if it is empty. null is considered an empty collection.
    • GET

      public static final com.rpl.rama.impl.NativeRamaFunction2<Object,Object,Object> GET
      Arguments are a collection and a key and emits the value for the key in the collection. Collection can be a map or a list. For lists, the key is an index. Emits null for non-existing keys. null is considered an empty collection.
    • GREATER_THAN

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction GREATER_THAN
      Emits boolean true or false on if each argument is greater than the next argument. Emits boolean true with one argument.
    • GREATER_THAN_OR_EQUAL

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction GREATER_THAN_OR_EQUAL
      Emits boolean true or false on if each argument is greater than or equal to the next argument. Emits boolean true with one argument.
    • IDENTITY

      public static final com.rpl.rama.impl.NativeRamaFunction1<Object,Object> IDENTITY
      Emits input argument
    • INC

      public static final com.rpl.rama.impl.NativeRamaFunction1<Number,Integer> INC
      Emits one more than input value as an Integer
    • INC_LONG

      public static final com.rpl.rama.impl.NativeRamaFunction1<Number,Long> INC_LONG
      Emits one more than input value as a Long
    • IS_EVEN

      public static final com.rpl.rama.impl.NativeRamaFunction1<Number,Boolean> IS_EVEN
      Emits boolean true or false on whether input argument is an even number
    • IS_INSTANCE_OF

      public static final com.rpl.rama.impl.NativeRamaFunction2<Class,Object,Boolean> IS_INSTANCE_OF
      Arguments are a Class and object and emits boolean true or false on whether the second argument is an instance of the first argument
    • IS_NEGATIVE

      public static final com.rpl.rama.impl.NativeRamaFunction1<Number,Boolean> IS_NEGATIVE
      Emits boolean true or false on whether input argument is a negative number
    • IS_NOT_NULL

      public static final com.rpl.rama.impl.NativeRamaFunction1<Object,Boolean> IS_NOT_NULL
      Emits boolean true or false on whether input argument is not null
    • IS_NULL

      public static final com.rpl.rama.impl.NativeRamaFunction1<Object,Boolean> IS_NULL
      Emits boolean true or false on whether input argument is null
    • IS_NUMBER

      public static final com.rpl.rama.impl.NativeRamaFunction1<Object,Boolean> IS_NUMBER
      Emits boolean true or false on whether input argument is a number
    • IS_ODD

      public static final com.rpl.rama.impl.NativeRamaFunction1<Number,Boolean> IS_ODD
      Emits boolean true or false on whether input argument is an odd number
    • IS_POSITIVE

      public static final com.rpl.rama.impl.NativeRamaFunction1<Number,Boolean> IS_POSITIVE
      Emits boolean true or false on whether input argument is a positive number
    • LAST

      public static final com.rpl.rama.impl.NativeRamaFunction1<Object,Object> LAST
      Emits last element of input collection or null if it is empty. null is considered an empty collection.
    • LESS_THAN

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction LESS_THAN
      Emits boolean true or false on if each argument is less than the next argument. Emits boolean true with one argument.
    • LESS_THAN_OR_EQUAL

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction LESS_THAN_OR_EQUAL
      Emits boolean true or false on if each argument is less than or equal to the next argument. Emits boolean true with one argument.
    • LOG_DEBUG

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction LOG_DEBUG
      Logs at debug level using slf4j Logger. First argument is instance of Logger class, and rest of arguments correspond to that interface.
    • LOG_ERROR

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction LOG_ERROR
      Logs at error level using slf4j Logger. First argument is instance of Logger class, and rest of arguments correspond to that interface.
    • LOG_INFO

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction LOG_INFO
      Logs at info level using slf4j Logger. First argument is instance of Logger class, and rest of arguments correspond to that interface.
    • LOG_TRACE

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction LOG_TRACE
      Logs at trace level using slf4j Logger. First argument is instance of Logger class, and rest of arguments correspond to that interface.
    • LOG_WARN

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction LOG_WARN
      Logs at warn level using slf4j Logger. First argument is instance of Logger class, and rest of arguments correspond to that interface.
    • MAX

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction MAX
      Emits maximum value of all input arguments
    • MIN

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction MIN
      Emits minimum value of all input arguments
    • MINUS

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction MINUS
      Emits result of subtracting all arguments after the first argument from the first argument as an Integer. If called with only one argument, emits negative of that value.
    • MINUS_LONG

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction MINUS_LONG
      Emits result of subtracting all arguments after the first argument from the first argument as a Long. If called with only one argument, emits negative of that value.
    • MODULE_INSTANCE_INFO

      public static final com.rpl.rama.impl.NativeRamaFunction0<ModuleInstanceInfo> MODULE_INSTANCE_INFO
      Emits ModuleInstanceInfo for module and worker of running event
    • MODULO

      public static final com.rpl.rama.impl.NativeRamaFunction2<Number,Number,Integer> MODULO
      Emits first argument modulo the second argument as an Integer
    • MODULO_LONG

      public static final com.rpl.rama.impl.NativeRamaFunction2<Number,Number,Long> MODULO_LONG
      Emits first argument modulo the second argument as a Long
    • NOT

      public static final com.rpl.rama.impl.NativeRamaFunction1<Object,Boolean> NOT
      "not" operator based on whether input is "truthy" (not null or false). Emits boolean false for truthy input and boolean true for non-truthy input.
    • NOT_EQUAL

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction NOT_EQUAL
      Tests whether any arguments are not equal and emits boolean true or false. Uses Object.equals(Object).
    • OR

      public static final com.rpl.rama.impl.NativeAnyArityRamaOperation OR
      "or" operator based on values being "truthy" (not null or false). Emits first truthy value or last non-truthy value. Short-circuits computation by not evaluating Expr arguments after a truthy value.

      OR with zero arguments emits null
    • PLUS

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction PLUS
      Emits result of adding all input numbers together as an Integer. If no arguments, emits zero.
    • PLUS_LONG

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction PLUS_LONG
      Emits result of adding all input numbers together as a Long. If no arguments, emits zero.
    • PRINTLN

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction PRINTLN
      Prints all input arguments to stdout
    • RANGE

      public static final com.rpl.rama.impl.NativeRamaOperation2<Number,Number> RANGE
      Arguments are a starting integer (inclusive) and an end integer (exclusive) and emits each integer between than range individually Example: Block.each(Ops.RANGE, 10, 20).out("*i")
    • SIZE

      public static final com.rpl.rama.impl.NativeRamaFunction1<Collection,Integer> SIZE
      Emits size of input collection as an Integer
    • SUM

      public static final com.rpl.rama.impl.NativeRamaFunction1<Collection,Integer> SUM
      Emits sum of all numbers in input list as an Integer. Emits zero for empty list.
    • SUM_LONG

      public static final com.rpl.rama.impl.NativeRamaFunction1<Collection,Long> SUM_LONG
      Emits sum of all numbers in input list as a Long. Emits zero for empty list.
    • TIMES

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction TIMES
      Emits result of multiplying all input numbers together as an Integer. If no arguments, emits one.
    • TIMES_LONG

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction TIMES_LONG
      Emits result of multiplying all input numbers together as a Long. If no arguments, emits one.
    • TO_STRING

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction TO_STRING
      Emits result of converting all input arguments to strings and concatenating them together
    • TUPLE

      public static final com.rpl.rama.impl.NativeAnyArityRamaFunction TUPLE
      Combines all input arguments into a List Example: Block.each(Ops.TUPLE, 1, 2, 3).out("*tuple")
    • EXTRACT_VALUE

      public static final com.rpl.rama.impl.NativeRamaFunction1<Object,Object> EXTRACT_VALUE
      Extracts contents of a PState as a value. Should only be called on PStates with a top-level Class schema.
      See Also:
  • Constructor Details

    • Ops

      public Ops()