Class FirestoreSessionStoreOptions

java.lang.Object
com.google.genkit.plugins.firebase.session.FirestoreSessionStoreOptions

public final class FirestoreSessionStoreOptions extends Object
Configuration for FirestoreSessionStore.

Mirrors the upstream Go/JS Firestore session store options. The store derives three Firestore collection roots from getCollection():

  • <collection> — one document per snapshot (checkpoint or diff metadata).
  • <collection>-shards — sharded checkpoint state JSON.
  • <collection>-pointers — per-session pointer to the current leaf snapshot.

All three are namespaced under a per-tenant prefix derived from getSnapshotPathPrefix() (default "global").

  • Field Details

    • DEFAULT_COLLECTION

      public static final String DEFAULT_COLLECTION
      Default top-level collection 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 (512 KiB).
      See Also:
  • Method Details

    • getCollection

      public String getCollection()
      Returns the top-level collection name (default "genkit-sessions").
      Returns:
      the collection 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 524288).
      Returns:
      the shard size in bytes
    • getSnapshotPathPrefix

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

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

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