Packages

final case class DbParametersConfig(maxConnections: Option[PositiveInt] = None, connectionAllocation: ConnectionAllocation = ConnectionAllocation(), failFastOnStartup: Boolean = true, migrationsPaths: Seq[String] = Seq.empty, connectionTimeout: NonNegativeFiniteDuration = DbConfig.defaultConnectionTimeout, failedToFatalDelay: NonNegativeFiniteDuration = DbConfig.defaultFailedToFatalDelay, warnOnSlowQuery: Option[PositiveFiniteDuration] = None, warnOnSlowQueryInterval: PositiveFiniteDuration = DbParametersConfig.defaultWarnOnSlowQueryInterval, unsafeCleanOnValidationError: Boolean = false, unsafeBaselineOnMigrate: Boolean = false, migrateAndStart: Boolean = false) extends PrettyPrinting with UniformCantonConfigValidation with Product with Serializable

Various database related settings

maxConnections

Allows for setting the maximum number of db connections used by Canton and the ledger API server. If None, the value will be auto-detected from the number of processors. Has no effect, if the number of connections is already set via slick options (i.e., config.numThreads).

connectionAllocation

Overrides for the sizes of the connection pools managed by a canton node.

failFastOnStartup

If true, the node will fail-fast when the database cannot be connected to If false, the node will wait indefinitely for the database to come up

migrationsPaths

Where should database migrations be read from. Enables specialized DDL for different database servers (e.g. Postgres).

connectionTimeout

How long to wait for acquiring a database connection

failedToFatalDelay

Delay after which, if the storage is continuously in a Failed state, it will escalate to Fatal. The default value is 5 minutes. Components that use the storage as a health dependency can then determine how to react. Currently, the sequencer declares it as a fatal dependency for its liveness health, which means it will transition to NOT_SERVING if this delay is exceeded, allowing a monitoring infrastructure to restart it. **NOTE**: Currently this only applies to com.digitalasset.canton.resource.DbStorageSingle, which is only used by the sequencer. TODO(i24240): Apply the same behavior to DbStorageMulti

warnOnSlowQuery

Optional time when we start logging a query as slow.

warnOnSlowQueryInterval

How often to repeat the logging statement for slow queries.

unsafeCleanOnValidationError

TO BE USED ONLY FOR TESTING! Clean the database if validation during DB migration fails.

unsafeBaselineOnMigrate

TO BE USED ONLY FOR TESTING! Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table. This schema will then be baselined with the baselineVersion before executing the migrations. Only migrations above baselineVersion will then be applied. This is useful for databases projects where the initial vendor schema is not empty If baseline should be called on migrate for non-empty schemas, { @code false} if not. (default: { @code false})

migrateAndStart

if true, db migrations will be applied to the database (default is to abort start if db migrates are pending to force an explicit upgrade)

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DbParametersConfig
  2. Serializable
  3. Product
  4. Equals
  5. UniformCantonConfigValidation
  6. CustomCantonConfigValidation
  7. CantonConfigValidation
  8. PrettyPrinting
  9. PrettyUtil
  10. ShowUtil
  11. ShowSyntax
  12. ToShowOps
  13. AnyRef
  14. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new DbParametersConfig(maxConnections: Option[PositiveInt] = None, connectionAllocation: ConnectionAllocation = ConnectionAllocation(), failFastOnStartup: Boolean = true, migrationsPaths: Seq[String] = Seq.empty, connectionTimeout: NonNegativeFiniteDuration = DbConfig.defaultConnectionTimeout, failedToFatalDelay: NonNegativeFiniteDuration = DbConfig.defaultFailedToFatalDelay, warnOnSlowQuery: Option[PositiveFiniteDuration] = None, warnOnSlowQueryInterval: PositiveFiniteDuration = DbParametersConfig.defaultWarnOnSlowQueryInterval, unsafeCleanOnValidationError: Boolean = false, unsafeBaselineOnMigrate: Boolean = false, migrateAndStart: Boolean = false)

    maxConnections

    Allows for setting the maximum number of db connections used by Canton and the ledger API server. If None, the value will be auto-detected from the number of processors. Has no effect, if the number of connections is already set via slick options (i.e., config.numThreads).

    connectionAllocation

    Overrides for the sizes of the connection pools managed by a canton node.

    failFastOnStartup

    If true, the node will fail-fast when the database cannot be connected to If false, the node will wait indefinitely for the database to come up

    migrationsPaths

    Where should database migrations be read from. Enables specialized DDL for different database servers (e.g. Postgres).

    connectionTimeout

    How long to wait for acquiring a database connection

    failedToFatalDelay

    Delay after which, if the storage is continuously in a Failed state, it will escalate to Fatal. The default value is 5 minutes. Components that use the storage as a health dependency can then determine how to react. Currently, the sequencer declares it as a fatal dependency for its liveness health, which means it will transition to NOT_SERVING if this delay is exceeded, allowing a monitoring infrastructure to restart it. **NOTE**: Currently this only applies to com.digitalasset.canton.resource.DbStorageSingle, which is only used by the sequencer. TODO(i24240): Apply the same behavior to DbStorageMulti

    warnOnSlowQuery

    Optional time when we start logging a query as slow.

    warnOnSlowQueryInterval

    How often to repeat the logging statement for slow queries.

    unsafeCleanOnValidationError

    TO BE USED ONLY FOR TESTING! Clean the database if validation during DB migration fails.

    unsafeBaselineOnMigrate

    TO BE USED ONLY FOR TESTING! Whether to automatically call baseline when migrate is executed against a non-empty schema with no schema history table. This schema will then be baselined with the baselineVersion before executing the migrations. Only migrations above baselineVersion will then be applied. This is useful for databases projects where the initial vendor schema is not empty If baseline should be called on migrate for non-empty schemas, { @code false} if not. (default: { @code false})

    migrateAndStart

    if true, db migrations will be applied to the database (default is to abort start if db migrates are pending to force an explicit upgrade)

Type Members

  1. implicit class ShowAnyRefSyntax extends AnyRef
    Definition Classes
    ShowUtil
  2. implicit class ShowEitherSyntax[L, R] extends AnyRef

    Enables the syntax show"${myEither.showMerged}".

    Enables the syntax show"${myEither.showMerged}".

    Definition Classes
    ShowUtil
  3. implicit class ShowLengthLimitedStringSyntax extends StringOperators
    Definition Classes
    ShowUtil
  4. implicit class ShowLengthLimitedStringWrapperSyntax extends StringOperators
    Definition Classes
    ShowUtil
  5. implicit class ShowOptionSyntax[T] extends AnyRef
    Definition Classes
    ShowUtil
  6. implicit class ShowProductSyntax extends AnyRef
    Definition Classes
    ShowUtil
    Annotations
    @SuppressWarnings()
  7. implicit class ShowStringSyntax extends StringOperators
    Definition Classes
    ShowUtil
  8. implicit class ShowTraversableSyntax[T] extends AnyRef

    Enables syntax like show"Found several elements: ${myCollection.mkShow()}".

    Enables syntax like show"Found several elements: ${myCollection.mkShow()}".

    Definition Classes
    ShowUtil
  9. abstract class StringOperators extends AnyRef

    Enables syntax like:

    Enables syntax like:

    show"This is a string: ${myString.doubleQuoted}"

    and:

    show"This is a hash: ${myHash.readableHash}"
    Definition Classes
    ShowUtil

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def adHocPrettyInstance[T <: Product](implicit c: ClassTag[T]): Pretty[T]

    Use this as a temporary solution, to make the code compile during an ongoing migration.

    Use this as a temporary solution, to make the code compile during an ongoing migration. Drawbacks:

    • Instances of Pretty[T] are ignored.
    • No parameter names
    Definition Classes
    PrettyUtil
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
  7. val connectionAllocation: ConnectionAllocation
  8. val connectionTimeout: NonNegativeFiniteDuration
  9. def customParam[T](getValue: (T) => String, cond: (T) => Boolean = (_: T) => true): (T) => Option[Tree]

    Use this if you need a custom representation of a parameter.

    Use this if you need a custom representation of a parameter. Do not use this to create lengthy strings, as line wrapping is not supported.

    Definition Classes
    PrettyUtil
  10. final def doValidate(edition: CantonEdition): Seq[CantonConfigValidationError]

    Returns all validation errors that are specific to this Canton configuration class.

    Returns all validation errors that are specific to this Canton configuration class. Successful validation should return an empty sequence.

    Validation errors of subconfigurations should not be reported by this method, but via the type class derivation.

    Attributes
    protected
    Definition Classes
    UniformCantonConfigValidationCustomCantonConfigValidation
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. val failFastOnStartup: Boolean
  13. val failedToFatalDelay: NonNegativeFiniteDuration
  14. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @IntrinsicCandidate() @native()
  15. def indicateOmittedFields[T]: (T) => Option[Tree]

    Use this to indicate that you've omitted fields from pretty printing

    Use this to indicate that you've omitted fields from pretty printing

    Definition Classes
    PrettyUtil
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. val maxConnections: Option[PositiveInt]
  18. val migrateAndStart: Boolean
  19. val migrationsPaths: Seq[String]
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @IntrinsicCandidate() @native()
  23. def param[T, V](name: String, getValue: (T) => V, cond: (T) => Boolean = (_: T) => true)(implicit arg0: Pretty[V]): (T) => Option[Tree]

    A tree representing both parameter name and value.

    A tree representing both parameter name and value.

    Definition Classes
    PrettyUtil
  24. def paramIfDefined[T, V](name: String, getValue: (T) => Option[V])(implicit arg0: Pretty[V]): (T) => Option[Tree]
    Definition Classes
    PrettyUtil
  25. def paramIfNonEmpty[T, V <: IterableOnce[_]](name: String, getValue: (T) => V)(implicit arg0: Pretty[V]): (T) => Option[Tree]
    Definition Classes
    PrettyUtil
  26. def paramIfNotDefault[T, V](name: String, getValue: (T) => V, default: V)(implicit arg0: Pretty[V]): (T) => Option[Tree]

    A tree only written if not matching the default value

    A tree only written if not matching the default value

    Definition Classes
    PrettyUtil
  27. def paramIfTrue[T](label: String, getValue: (T) => Boolean): (T) => Option[Tree]
    Definition Classes
    PrettyUtil
  28. def paramWithoutValue[T](name: String, cond: (T) => Boolean = (_: T) => true): (T) => Option[Tree]

    A tree representing a parameter name without a parameter value.

    A tree representing a parameter name without a parameter value. Use this for parameters storing confidential or binary data.

    Definition Classes
    PrettyUtil
  29. def pretty: Pretty[DbParametersConfig]

    Indicates how to pretty print this instance.

    Indicates how to pretty print this instance. See PrettyPrintingTest for examples on how to implement this method.

    Attributes
    protected
    Definition Classes
    DbParametersConfigPrettyPrinting
  30. def prettyInfix[T]: PrettyInfixPartiallyApplied[T]
    Definition Classes
    PrettyUtil
  31. def prettyNode[T](label: String, children: (T) => Option[Tree]*): Pretty[T]

    A tree consisting of a labelled node with the given children.

    A tree consisting of a labelled node with the given children.

    Definition Classes
    PrettyUtil
  32. def prettyOfClass[T](getParamTrees: (T) => Option[Tree]*): Pretty[T]

    A tree representing the type name and parameter trees.

    A tree representing the type name and parameter trees.

    Definition Classes
    PrettyUtil
  33. def prettyOfClassWithName[T](name: String)(getParamTrees: (T) => Option[Tree]*): Pretty[T]

    Like prettyOfClass, except takes an explicit name for the class.

    Like prettyOfClass, except takes an explicit name for the class.

    Definition Classes
    PrettyUtil
  34. def prettyOfObject[T <: Product]: Pretty[T]

    A tree presenting the type name only.

    A tree presenting the type name only. (E.g., for case objects.)

    Definition Classes
    PrettyUtil
  35. def prettyOfParam[T, V](getValue: (T) => V)(implicit arg0: Pretty[V]): Pretty[T]

    Use this to give a class with a singleton parameter the same pretty representation as the parameter.

    Use this to give a class with a singleton parameter the same pretty representation as the parameter.

    Definition Classes
    PrettyUtil
  36. def prettyOfString[T](toString: (T) => String): Pretty[T]

    Creates a pretty instance from a string function.

    Creates a pretty instance from a string function. Do not use this with lengthy strings, as line wrapping is not supported.

    Definition Classes
    PrettyUtil
  37. def productElementNames: Iterator[String]
    Definition Classes
    Product
  38. implicit final def showInterpolator(sc: StringContext): ShowInterpolator
    Definition Classes
    ShowSyntax
  39. implicit def showPretty[T](implicit arg0: Pretty[T]): Show[T]

    Enables the syntax show"This object is pretty: $myPrettyType".

    Enables the syntax show"This object is pretty: $myPrettyType".

    Definition Classes
    ShowUtil
  40. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  41. implicit def toShow[A](target: A)(implicit tc: Show[A]): Ops[A]
    Definition Classes
    ToShowOps
  42. final def toString(): String

    Yields a readable string representation based on com.digitalasset.canton.logging.pretty.Pretty.DefaultPprinter.

    Yields a readable string representation based on com.digitalasset.canton.logging.pretty.Pretty.DefaultPprinter. Final to avoid accidental overwriting.

    Definition Classes
    PrettyPrinting → AnyRef → Any
  43. def unnamedParam[T, V](getValue: (T) => V, cond: (T) => Boolean = (_: T) => true)(implicit arg0: Pretty[V]): (T) => Option[Tree]

    A tree representing a parameter value without a parameter name.

    A tree representing a parameter value without a parameter name.

    Definition Classes
    PrettyUtil
  44. def unnamedParamIfDefined[T, V](getValue: (T) => Option[V])(implicit arg0: Pretty[V]): (T) => Option[Tree]
    Definition Classes
    PrettyUtil
  45. def unnamedParamIfNonEmpty[T, V <: IterableOnce[_]](getValue: (T) => V)(implicit arg0: Pretty[V]): (T) => Option[Tree]
    Definition Classes
    PrettyUtil
  46. val unsafeBaselineOnMigrate: Boolean
  47. val unsafeCleanOnValidationError: Boolean
  48. final def validate[T >: DbParametersConfig.this.type](edition: CantonEdition)(implicit validator: CantonConfigValidator[T]): Either[NonEmpty[Seq[CantonConfigValidationError]], Unit]
    Definition Classes
    CantonConfigValidation
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  51. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  52. val warnOnSlowQuery: Option[PositiveFiniteDuration]
  53. val warnOnSlowQueryInterval: PositiveFiniteDuration

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from CantonConfigValidation

Inherited from PrettyPrinting

Inherited from PrettyUtil

Inherited from ShowUtil

Inherited from ShowSyntax

Inherited from ToShowOps

Inherited from AnyRef

Inherited from Any

Ungrouped