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 Summary
Modifier and TypeMethodDescriptionglobal()Configures PState to have a single partition.initialValue(Object val) Specifies starting value for PState.<T,F extends RamaFunction2<Integer, T, Integer>>
PState.DeclarationkeyPartitioner(Class<F> partitionerClass) Changes the default key partitioner to a custom one.Configures PState to only be readable within the declaring topology.
-
Method Details
-
global
PState.Declaration global()Configures PState to have a single partition. Partition will be assigned to task 0. -
initialValue
Specifies starting value for PState. This should only be used when top-level schema is declared with aClass. -
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, PState.Declaration keyPartitionerT, Integer>> (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 callsselectorselectAsync. The variants which only take aPathas input extract the partitioning key from thePath. The key partitioner is also used when callingselectin 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.
-