Package com.rpl.rama

Interface PState.Declaration

Enclosing interface:
PState

public static interface PState.Declaration
Builder-style interface for specifying options when declaring a PState in a module
  • Method Details

    • global

      Configures PState to have a single partition. Partition will be assigned to task 0.
    • initialValue

      PState.Declaration initialValue(Object val)
      Specifies starting value for PState. This should only be used when top-level schema is declared with a Class.
    • makePrivate

      PState.Declaration makePrivate()
      Configures PState to only be readable within the declaring topology. Clients will not be able to retrieve this PState.
    • keyPartitioner

      <T, F extends RamaFunction2<Integer, T, Integer>> PState.Declaration keyPartitioner(Class<F> partitionerClass)
      Changes the default key partitioner to a custom one. A key partitioner determines to which task to send a query request. It is used when a client calls select or selectAsync. The variants which only take a Path as input extract the partitioning key from the Path. The key partitioner is also used when calling select in ETL code.

      The default key partitioner does hash-based partitioning.
      Parameters:
      partitionerClass - Function implementation which takes as input the number of partitions in the PState and the partitioning key. Returns the partition number to send the query request.