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>>
codecs
protected Map<Name,Integer>
concurrencies
protected Codec<Record>
defaultCodec
protected int
defaultConcurrency
protected boolean
defaultExternal
protected RecordFilterChain
defaultFilter
protected int
defaultPartitions
protected ComputationPolicy
defaultPolicy
protected Map<Name,Boolean>
externals
protected Map<Name,RecordFilterChain>
filters
protected Map<Name,Integer>
partitions
protected 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 Settings
addFilter(String streamName, RecordFilter filter)
Add a filterSettings
addFilter(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.int
getConcurrency(String computationName)
int
getConcurrency(Name computationName)
RecordFilterChain
getFilterChain(String streamName)
Gets the filter chain for a stream.RecordFilterChain
getFilterChain(Name streamName)
Gets the filter chain for a stream.int
getPartitions(String streamName)
int
getPartitions(Name streamName)
ComputationPolicy
getPolicy(String computationName)
Gets the policy for a computation.ComputationPolicy
getPolicy(Name computationName)
Gets the policy for a computation.boolean
isExternal(Name streamName)
Settings
setCodec(String streamName, Codec<Record> codec)
Sets the codec for a stream.Settings
setCodec(Name streamName, Codec<Record> codec)
Sets the codec for a stream.Settings
setConcurrency(String computationName, int concurrency)
Sets the computation thread pool size.Settings
setConcurrency(Name computationName, int concurrency)
Settings
setExternal(Name streamName, boolean external)
Settings
setPartitions(String streamName, int partitions)
Settings
setPartitions(Name streamName, int partitions)
Sets the number of partitions for a stream.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.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.
-
-
-
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
-
-