Package org.nuxeo.lib.stream.computation
Class Settings
- java.lang.Object
-
- org.nuxeo.lib.stream.computation.Settings
-
public class Settings extends Object
Settings defines stream's partitions and computation's concurrency and policy.- Since:
- 9.3
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Name,Codec<Record>>codecsprotected Map<Name,Integer>concurrenciesprotected Codec<Record>defaultCodecprotected intdefaultConcurrencyprotected booleandefaultExternalprotected RecordFilterChaindefaultFilterprotected intdefaultPartitionsprotected ComputationPolicydefaultPolicyprotected Map<Name,Boolean>externalsprotected Map<Name,RecordFilterChain>filtersprotected Map<Name,Integer>partitionsprotected Map<Name,ComputationPolicy>policies
-
Constructor Summary
Constructors Constructor Description Settings(int defaultConcurrency, int defaultPartitions)Default concurrency and partition to use if not specified explicitly.Settings(int defaultConcurrency, int defaultPartitions, Codec<Record> defaultCodec)Default concurrency and partition to use if not specified explicitly.Settings(int defaultConcurrency, int defaultPartitions, Codec<Record> defaultCodec, ComputationPolicy defaultPolicy)Settings(int defaultConcurrency, int defaultPartitions, Codec<Record> defaultCodec, ComputationPolicy defaultPolicy, RecordFilterChain defaultFilter)Settings(int defaultConcurrency, int defaultPartitions, Codec<Record> defaultCodec, ComputationPolicy defaultPolicy, RecordFilterChain defaultFilter, boolean defaultExternal)Settings(int defaultConcurrency, int defaultPartitions, ComputationPolicy defaultPolicy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SettingsaddFilter(String streamName, RecordFilter filter)Add a filterSettingsaddFilter(Name streamName, RecordFilter filter)Add a filterCodec<Record>getCodec(String streamName)Gets the codec for a stream.Codec<Record>getCodec(Name streamName)Gets the codec for a stream.intgetConcurrency(String computationName)intgetConcurrency(Name computationName)RecordFilterChaingetFilterChain(String streamName)Gets the filter chain for a stream.RecordFilterChaingetFilterChain(Name streamName)Gets the filter chain for a stream.intgetPartitions(String streamName)intgetPartitions(Name streamName)ComputationPolicygetPolicy(String computationName)Gets the policy for a computation.ComputationPolicygetPolicy(Name computationName)Gets the policy for a computation.booleanisExternal(Name streamName)SettingssetCodec(String streamName, Codec<Record> codec)Sets the codec for a stream.SettingssetCodec(Name streamName, Codec<Record> codec)Sets the codec for a stream.SettingssetConcurrency(String computationName, int concurrency)Sets the computation thread pool size.SettingssetConcurrency(Name computationName, int concurrency)SettingssetExternal(Name streamName, boolean external)SettingssetPartitions(String streamName, int partitions)SettingssetPartitions(Name streamName, int partitions)Sets the number of partitions for a stream.SettingssetPolicy(String computationName, ComputationPolicy policy)Sets the policy for a computation, when using default as computationName this sets the default policy for all computations in the processor.SettingssetPolicy(Name computationName, ComputationPolicy policy)Sets the policy for a computation, when using default as computationName this sets the default policy for all computations in the processor.
-
-
-
Field Detail
-
defaultPartitions
protected final int defaultPartitions
-
defaultFilter
protected final RecordFilterChain defaultFilter
-
filters
protected final Map<Name,RecordFilterChain> filters
-
defaultExternal
protected final boolean defaultExternal
-
defaultConcurrency
protected final int defaultConcurrency
-
defaultPolicy
protected final ComputationPolicy defaultPolicy
-
policies
protected final Map<Name,ComputationPolicy> policies
-
-
Constructor Detail
-
Settings
public Settings(int defaultConcurrency, int defaultPartitions)Default concurrency and partition to use if not specified explicitly.
-
Settings
public Settings(int defaultConcurrency, int defaultPartitions, Codec<Record> defaultCodec)Default concurrency and partition to use if not specified explicitly.
-
Settings
public Settings(int defaultConcurrency, int defaultPartitions, ComputationPolicy defaultPolicy)
-
Settings
public Settings(int defaultConcurrency, int defaultPartitions, Codec<Record> defaultCodec, ComputationPolicy defaultPolicy)
-
Settings
public Settings(int defaultConcurrency, int defaultPartitions, Codec<Record> defaultCodec, ComputationPolicy defaultPolicy, RecordFilterChain defaultFilter)
-
Settings
public Settings(int defaultConcurrency, int defaultPartitions, Codec<Record> defaultCodec, ComputationPolicy defaultPolicy, RecordFilterChain defaultFilter, boolean defaultExternal)
-
-
Method Detail
-
setConcurrency
public Settings setConcurrency(String computationName, int concurrency)
Sets the computation thread pool size.
-
getConcurrency
public int getConcurrency(String computationName)
-
getConcurrency
public int getConcurrency(Name computationName)
-
setPartitions
public Settings setPartitions(Name streamName, int partitions)
Sets the number of partitions for a stream.
-
getPartitions
public int getPartitions(Name streamName)
-
getPartitions
public int getPartitions(String streamName)
-
isExternal
public boolean isExternal(Name streamName)
-
setCodec
public Settings setCodec(Name streamName, Codec<Record> codec)
Sets the codec for a stream.- Since:
- 11.1
-
setCodec
public Settings setCodec(String streamName, Codec<Record> codec)
Sets the codec for a stream.- Since:
- 10.2
-
setPolicy
public Settings setPolicy(Name computationName, ComputationPolicy policy)
Sets the policy for a computation, when using default as computationName this sets the default policy for all computations in the processor.- Since:
- 11.1
-
setPolicy
public Settings setPolicy(String computationName, ComputationPolicy policy)
Sets the policy for a computation, when using default as computationName this sets the default policy for all computations in the processor.- Since:
- 10.3
-
getPolicy
public ComputationPolicy getPolicy(Name computationName)
Gets the policy for a computation.- Since:
- 11.1
-
getPolicy
public ComputationPolicy getPolicy(String computationName)
Gets the policy for a computation.- Since:
- 10.3
-
addFilter
public Settings addFilter(Name streamName, RecordFilter filter)
Add a filter- Since:
- 11.1
-
addFilter
public Settings addFilter(String streamName, RecordFilter filter)
Add a filter- Since:
- 11.1
-
getFilterChain
public RecordFilterChain getFilterChain(Name streamName)
Gets the filter chain for a stream.- Since:
- 11.1
-
getFilterChain
public RecordFilterChain getFilterChain(String streamName)
Gets the filter chain for a stream.- Since:
- 11.1
-
-