Class DynamoDbSessionStoreOptions

java.lang.Object
com.google.genkit.plugins.awsbedrock.session.DynamoDbSessionStoreOptions

public final class DynamoDbSessionStoreOptions extends Object
Configuration for DynamoDbSessionStore.

The store persists all rows in a single DynamoDB table (default "genkit-sessions") keyed by a partition key pk (the per-tenant prefix) and a sort key sk that discriminates snapshot, shard, and pointer rows. All rows for a tenant share the same pk, derived from getSnapshotPathPrefix() (default "global").

The default getShardSize() is 358400 bytes, kept safely under the DynamoDB 400 KB item-size limit; because the store forces a checkpoint whenever a diff would exceed the shard size, diff rows stay bounded too.

  • Field Details

    • DEFAULT_TABLE

      public static final String DEFAULT_TABLE
      Default table name.
      See Also:
    • DEFAULT_CHECKPOINT_INTERVAL

      public static final int DEFAULT_CHECKPOINT_INTERVAL
      Default number of turns between full checkpoints.
      See Also:
    • DEFAULT_SHARD_SIZE

      public static final int DEFAULT_SHARD_SIZE
      Default shard size in bytes for checkpoint state (350 KiB, under the 400 KB item cap).
      See Also:
    • DEFAULT_POLL_INTERVAL_MS

      public static final long DEFAULT_POLL_INTERVAL_MS
      Default subscription poll interval in milliseconds.
      See Also:
  • Method Details

    • getTableName

      public String getTableName()
      Returns the DynamoDB table name (default "genkit-sessions").
      Returns:
      the table name
    • getCheckpointInterval

      public int getCheckpointInterval()
      Returns the number of turns between full checkpoints (default 25).
      Returns:
      the checkpoint interval
    • getShardSize

      public int getShardSize()
      Returns the shard size in bytes for checkpoint state (default 358400).
      Returns:
      the shard size in bytes
    • getSnapshotPathPrefix

      public Function<SessionStoreOptions,String> getSnapshotPathPrefix()
      Returns the function that derives the per-tenant partition-key prefix from the per-request store options (default o -> "global").
      Returns:
      the prefix function
    • isCreateTableIfNotExists

      public boolean isCreateTableIfNotExists()
      Returns whether the store should create the table on first use if it does not exist (default false).
      Returns:
      true if the table should be created when missing
    • getPollIntervalMs

      public long getPollIntervalMs()
      Returns the subscription poll interval in milliseconds (default 2000L).
      Returns:
      the poll interval in milliseconds
    • defaults

      public static DynamoDbSessionStoreOptions defaults()
      Returns default options.
      Returns:
      a DynamoDbSessionStoreOptions with all defaults
    • builder

      public static DynamoDbSessionStoreOptions.Builder builder()
      Creates a new builder.
      Returns:
      a new builder