public abstract class DeliveryStrategy
extends java.lang.Object
The idea is to avoid the concurrent modification of the same Entity
instance
on several app nodes. Therefore an entity is put into a shard, which in turn is designed to
process all the shard-incoming messages on a single application node at a time.
Constructor and Description |
---|
DeliveryStrategy() |
Modifier and Type | Method and Description |
---|---|
io.spine.server.delivery.ShardIndex |
determineIndex(java.lang.Object entityId,
io.spine.type.TypeUrl entityStateType) |
protected abstract io.spine.server.delivery.ShardIndex |
indexFor(java.lang.Object entityId,
io.spine.type.TypeUrl entityStateType)
Determines the shard index for the messages heading to the entity with the specified target
identifier.
|
protected abstract int |
shardCount()
Tells how many shards there are according to this strategy.
|
protected abstract io.spine.server.delivery.ShardIndex indexFor(java.lang.Object entityId, io.spine.type.TypeUrl entityStateType)
entityId
- the identifier of the entity, to which the messages are dispatchedentityStateType
- the type URL of the entity, to which the messages are dispatchedprotected abstract int shardCount()
public final io.spine.server.delivery.ShardIndex determineIndex(java.lang.Object entityId, io.spine.type.TypeUrl entityStateType)