ShardCoordinatorOptionsBuilder
Este conteúdo não está disponível em sua língua ainda.
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:103
Fluent builder for ShardCoordinatorOptionsType. Consumed by
ClusterSharding when it spawns the per-type coordinator; the
cluster / localResolver wiring fields are supplied by the
extension, the rest surface the user-tunable coordinator options.
The polymorphic fields — allocationStrategy (AllocationStrategy),
lease (Lease), rememberEntitiesStore, coordinatorStateStore,
and the cluster / localResolver wiring — are passed whole via a
single withX(value).
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ShardCoordinatorOptionsBuilder():
ShardCoordinatorOptionsBuilder
Returns
Section titled “Returns”ShardCoordinatorOptionsBuilder
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”build()
Section titled “build()”build():
Partial<T>
Defined in: src/util/OptionsBuilder.ts:51
Snapshot the set fields as an independent Partial<T> (own props only).
Returns
Section titled “Returns”Partial<T>
Inherited from
Section titled “Inherited from”withAcquireRetryIntervalMs()
Section titled “withAcquireRetryIntervalMs()”withAcquireRetryIntervalMs(
acquireRetryIntervalMs):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:160
Retry interval for lease.acquire() after a failed attempt. Default: 5 s.
Parameters
Section titled “Parameters”acquireRetryIntervalMs
Section titled “acquireRetryIntervalMs”number
Returns
Section titled “Returns”this
withAllocationStrategy()
Section titled “withAllocationStrategy()”withAllocationStrategy(
allocationStrategy):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:120
Strategy used to allocate and rebalance shards across regions.
Parameters
Section titled “Parameters”allocationStrategy
Section titled “allocationStrategy”Returns
Section titled “Returns”this
withCluster()
Section titled “withCluster()”withCluster(
cluster):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:115
The cluster this coordinator observes for leader/membership changes.
Parameters
Section titled “Parameters”cluster
Section titled “cluster”Returns
Section titled “Returns”this
withCoordinatorStateStore()
Section titled “withCoordinatorStateStore()”withCoordinatorStateStore(
coordinatorStateStore):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:170
Persistence backend for the allocation state (regions + shardHome).
Parameters
Section titled “Parameters”coordinatorStateStore
Section titled “coordinatorStateStore”CoordinatorStateStore
Returns
Section titled “Returns”this
withHandOffTimeoutMs()
Section titled “withHandOffTimeoutMs()”withHandOffTimeoutMs(
handOffTimeoutMs):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:140
Time to wait for HandOffComplete before force-reallocating. Default: 10 s.
Parameters
Section titled “Parameters”handOffTimeoutMs
Section titled “handOffTimeoutMs”number
Returns
Section titled “Returns”this
withLease()
Section titled “withLease()”withLease(
lease):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:155
Optional split-brain protection — coordinator must hold the lease before acting.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”this
withLocalResolver()
Section titled “withLocalResolver()”withLocalResolver(
localResolver):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:150
Resolver for local actor paths — used when coordinator and region share a node.
Parameters
Section titled “Parameters”localResolver
Section titled “localResolver”(path) => ActorRef<unknown> | null
Returns
Section titled “Returns”this
withNumShards()
Section titled “withNumShards()”withNumShards(
numShards):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:125
Shard count for this entity type — the bound a GetShardHome must fall inside.
Parameters
Section titled “Parameters”numShards
Section titled “numShards”number
Returns
Section titled “Returns”this
withRebalanceIntervalMs()
Section titled “withRebalanceIntervalMs()”withRebalanceIntervalMs(
rebalanceIntervalMs):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:135
Gap between coordinator-driven rebalance passes. Default: 2 s.
Parameters
Section titled “Parameters”rebalanceIntervalMs
Section titled “rebalanceIntervalMs”number
Returns
Section titled “Returns”this
withRememberEntities()
Section titled “withRememberEntities()”withRememberEntities(
rememberEntities?):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:145
Track entity lifecycle so entities can be re-created on the new owner.
Parameters
Section titled “Parameters”rememberEntities?
Section titled “rememberEntities?”boolean = true
Returns
Section titled “Returns”this
withRememberEntitiesStore()
Section titled “withRememberEntitiesStore()”withRememberEntitiesStore(
rememberEntitiesStore):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:165
Persistence backend for the entity registry (only used when rememberEntities).
Parameters
Section titled “Parameters”rememberEntitiesStore
Section titled “rememberEntitiesStore”Returns
Section titled “Returns”this
withRole()
Section titled “withRole()”withRole(
role):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:130
Only members carrying this role are candidates for hosting shards.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”this
withTypeName()
Section titled “withTypeName()”withTypeName(
typeName):this
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:110
Logical name of the sharded type this coordinator governs.
Parameters
Section titled “Parameters”typeName
Section titled “typeName”string
Returns
Section titled “Returns”this
create()
Section titled “create()”
staticcreate():ShardCoordinatorOptionsBuilder
Defined in: src/cluster/sharding/ShardCoordinatorOptions.ts:105
Start a fresh builder. Equivalent to new ShardCoordinatorOptionsBuilder().
Returns
Section titled “Returns”ShardCoordinatorOptionsBuilder
