public final class AggregateEventShards<Event extends AggregateEvent<Event>> extends Object implements AggregateEventTagger<Event>
PersistentEntity
events may return one of these
to make the events available for sharded read-side processing.
The tag
should be unique among the event types of the service.
The numShards
should be stable and never change.
The class name can be used as tag
, but note that it is needed
to retain the original tag when the class name is changed because
the tag is part of the store event data.
Constructor and Description |
---|
AggregateEventShards(Class<Event> eventType,
String tag,
int numShards) |
Modifier and Type | Method and Description |
---|---|
org.pcollections.PSequence<AggregateEventTag<Event>> |
allTags()
Get all the tags for this shard.
|
boolean |
equals(Object other) |
Class<Event> |
eventType() |
AggregateEventTag<Event> |
forEntityId(String entityId)
Get the tag for the given entity ID.
|
int |
hashCode() |
int |
numShards() |
String |
tag() |
String |
toString() |
public Class<Event> eventType()
eventType
in interface AggregateEventTagger<Event extends AggregateEvent<Event>>
public String tag()
public int numShards()
public AggregateEventTag<Event> forEntityId(String entityId)
entityId
- The entity ID to get the tag for.public org.pcollections.PSequence<AggregateEventTag<Event>> allTags()