PostgresCheckpointerConfig

org.llm4s.agent.graph.postgres.PostgresCheckpointerConfig
See thePostgresCheckpointerConfig companion object
@Experimental
final case class PostgresCheckpointerConfig

How a PostgresCheckpointer uses its database.

  • schema: the PostgreSQL schema its tables live in, llm4s by default, so the store can share a database with other tables (and two stores, in two schemas, can share one database without seeing each other). It is created if it does not exist. A lower-case SQL identifier: a letter or _, then letters, digits or _, at most 63 characters.
  • callTimeout: how long one call may hold its connection - every statement it runs, the waits for row locks another instance holds included - before it fails, changing nothing. It is set on the server as the transaction's statement_timeout, lock_timeout and idle_in_transaction_session_timeout, and enforced on the client too: a call still running when it passes has its connection aborted and discarded, so a call whose network stalls fails at the bound rather than waiting for the socket.
  • connectionTimeout: how long a call waits for a connection from the store's own pool (see PostgresCheckpointer.open); at least 250 milliseconds, HikariCP's minimum. A caller-supplied pool (PostgresCheckpointer.create) keeps its own setting, which then takes this one's place in the bound.
  • maxPoolSize: the size of the store's own pool; ignored for a caller-supplied one.

'''The bound.''' Every call returns within connectionTimeout + callTimeout, plus the time it takes to roll back or discard a connection: the bound the Checkpointer contract asks a store to document (#1919). Keep it well inside ClaimPolicy.ttl - ClaimPolicy.renewEvery (the defaults, 5 + 5 seconds, are inside 30 - 10).

Durations are rounded up to whole milliseconds and must be positive and at most Int.MaxValue milliseconds; apply and the with* setters throw IllegalArgumentException for an invalid value, and PostgresCheckpointerConfig.of returns a ValidationError.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def bound: FiniteDuration

The bound every call of a store with its own pool returns within: connectionTimeout + callTimeout.

The bound every call of a store with its own pool returns within: connectionTimeout + callTimeout.

Attributes

def withCallTimeout(timeout: FiniteDuration): PostgresCheckpointerConfig
def withConnectionTimeout(timeout: FiniteDuration): PostgresCheckpointerConfig

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product