Class PeriodicUpdateGraph.Builder
java.lang.Object
io.deephaven.engine.updategraph.impl.PeriodicUpdateGraph.Builder
- Enclosing class:
- PeriodicUpdateGraph
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Constructs and returns a PeriodicUpdateGraph.Returns an existing PeriodicUpdateGraph with the name provided to this Builder, if one exists, else returns a new PeriodicUpdateGraph.minimumCycleDurationToLogNanos
(long minimumCycleDurationToLogNanos) Set the minimum duration of an update cycle that should be logged at the INFO level.numUpdateThreads
(int numUpdateThreads) Sets the number of threads to use in the update graph processor.operationInitializer
(OperationInitializer operationInitializer) Sets theOperationInitializer
to use for threads started by this UpdateGraph.targetCycleDurationMillis
(long targetCycleDurationMillis) Set the target duration of an update cycle, including the updating phase and the idle phase.threadInitializationFactory
(ThreadInitializationFactory threadInitializationFactory) Sets a functional interface that adds custom initialization for threads started by this UpdateGraph.
-
Constructor Details
-
Builder
-
-
Method Details
-
targetCycleDurationMillis
Set the target duration of an update cycle, including the updating phase and the idle phase. This is also the target interval between the start of one cycle and the start of the next.- Parameters:
targetCycleDurationMillis
- The target duration for update cycles in milliseconds- Returns:
- this builder
- ImplNote:
- Any target cycle duration
< 0
will be clamped to 0.
-
minimumCycleDurationToLogNanos
public PeriodicUpdateGraph.Builder minimumCycleDurationToLogNanos(long minimumCycleDurationToLogNanos) Set the minimum duration of an update cycle that should be logged at the INFO level.- Parameters:
minimumCycleDurationToLogNanos
- threshold to log a slow cycle- Returns:
- this builder
-
numUpdateThreads
Sets the number of threads to use in the update graph processor. Values < 0 indicate to use one thread per available processor.- Parameters:
numUpdateThreads
- number of threads to use in update processing- Returns:
- this builder
-
threadInitializationFactory
public PeriodicUpdateGraph.Builder threadInitializationFactory(ThreadInitializationFactory threadInitializationFactory) Sets a functional interface that adds custom initialization for threads started by this UpdateGraph.- Parameters:
threadInitializationFactory
- the function to invoke on any runnables that will be used to start threads- Returns:
- this builder
-
operationInitializer
Sets theOperationInitializer
to use for threads started by this UpdateGraph.- Parameters:
operationInitializer
- the operation initializer to use- Returns:
- this builder
-
build
Constructs and returns a PeriodicUpdateGraph. It is an error to do so an instance already exists with the name provided to this builder.- Returns:
- the new PeriodicUpdateGraph
- Throws:
IllegalStateException
- if an UpdateGraph with the provided name already exists
-
existingOrBuild
Returns an existing PeriodicUpdateGraph with the name provided to this Builder, if one exists, else returns a new PeriodicUpdateGraph.- Returns:
- the PeriodicUpdateGraph
- Throws:
ClassCastException
- if the existing graph is not a PeriodicUpdateGraph
-