Class PeriodicUpdateGraph.Builder

java.lang.Object
io.deephaven.engine.updategraph.impl.PeriodicUpdateGraph.Builder
Enclosing class:
PeriodicUpdateGraph

public static final class PeriodicUpdateGraph.Builder extends Object
  • Constructor Details

    • Builder

      public Builder(String name)
  • Method Details

    • targetCycleDurationMillis

      public PeriodicUpdateGraph.Builder targetCycleDurationMillis(long 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

      public PeriodicUpdateGraph.Builder numUpdateThreads(int 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

      public PeriodicUpdateGraph.Builder operationInitializer(OperationInitializer operationInitializer)
      Sets the OperationInitializer to use for threads started by this UpdateGraph.
      Parameters:
      operationInitializer - the operation initializer to use
      Returns:
      this builder
    • build

      public PeriodicUpdateGraph 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

      public PeriodicUpdateGraph 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