Class SpallocProperties.DBProperties

java.lang.Object
uk.ac.manchester.spinnaker.alloc.SpallocProperties.DBProperties
Enclosing class:
SpallocProperties

public static class SpallocProperties.DBProperties
extends Object
Additional database configuration.
  • Constructor Details

    • DBProperties

      public DBProperties​(@DefaultValue("1s") Duration timeout, @DefaultValue("false") boolean debugFailures, @DefaultValue("400") int analysisLimit, @DefaultValue("false") boolean performanceLog, @DefaultValue("true") boolean autoExplain, @DefaultValue("1e6") double performanceThreshold, @DefaultValue("3") int lockTries, @DefaultValue("100ms") Duration lockFailedDelay, @DefaultValue("50ms") Duration lockNoteThreshold, @DefaultValue("100ms") Duration lockWarnThreshold, @DefaultValue("false") boolean enableExpensiveTransactionDebugging)
      Parameters:
      timeout - How long to wait to get a database lock.
      debugFailures - Whether to send details of SQL-related exceptions to users.
      analysisLimit - Amount of effort to spend on DB optimisation on application close. See the SQLite documentation for meaning. Note that this is spent by every worker thread that touches the database.
      performanceLog - Whether to collect and write query performance metrics to the log on termination.
      autoExplain - If the performance log is enabled, also write the EXPLAIN of the code to the log on termination (for slow queries only).
      performanceThreshold - Performance stats not reported for queries with a max less than this (in μs).
      lockTries - Number of times to try to take the lock in a transaction.
      lockFailedDelay - Delay after transaction failure before retrying.
      lockNoteThreshold - Time delay before we issue a warning on transaction end.
      lockWarnThreshold - Time delay before we issue a warning during the execution of a transaction.
      enableExpensiveTransactionDebugging - Whether to determine the caller when doing transaction logging.
  • Method Details

    • getTimeout

      @NotNull public @NotNull Duration getTimeout()
      Returns:
      How long to wait to get a database lock.
    • isDebugFailures

      public boolean isDebugFailures()
      Returns:
      Whether to send details of SQL-related exceptions to users.
    • getAnalysisLimit

      @Min(100L) @Max(1000L) public @javax.validation.constraints.Min(100L),@javax.validation.constraints.Max(1000L) int getAnalysisLimit()
      Amount of effort to spend on DB optimisation on application close. See the SQLite documentation for meaning. Note that this is spent by every worker thread that touches the database.
      Returns:
      Amount of effort to spend on DB optimisation on application close.
      See Also:
      SQLite docs
    • isPerformanceLog

      public final boolean isPerformanceLog()
      Returns:
      Whether to collect and write query performance metrics to the log on termination. Note that this is checked both when recording performance (on each database query) and when the log writes happen (on termination).
    • isAutoExplain

      public final boolean isAutoExplain()
      Returns:
      Whether, if the performance log is enabled, to also write the EXPLAIN of the code to the log on termination (for slow queries only).
    • getPerformanceThreshold

      @Positive public final @javax.validation.constraints.Positive double getPerformanceThreshold()
      Returns:
      Performance stats are not reported for queries with a max less than this, in microseconds.
    • getLockTries

      @Positive public @javax.validation.constraints.Positive int getLockTries()
      Returns:
      Number of times to try to take the lock in a transaction.
    • getLockFailedDelay

      @NotNull public @NotNull Duration getLockFailedDelay()
      Returns:
      Delay after transaction failure before retrying.
    • getLockNoteThreshold

      @NotNull public @NotNull Duration getLockNoteThreshold()
      Returns:
      Time delay before we issue a warning on transaction end.
    • getLockWarnThreshold

      @NotNull public @NotNull Duration getLockWarnThreshold()
      Returns:
      Time delay before we issue a warning during the execution of a transaction.
    • isEnableExpensiveTransactionDebugging

      public boolean isEnableExpensiveTransactionDebugging()
      Returns:
      Whether to determine the caller when doing transaction logging.