public final class Worker extends Object implements ProjectionSerializable
key
) and both the requested and the observed status.
Both the requested and observed status are eventually consistent since this metadata is being replicated across the cluster and may have been edited in other nodes when being read in the local node.
param: tagName the tag in the event journal this worker will read. This value is
part of the WorkerCoordinates
.
param: key a unique identifier for this worker. Note the key
is produced from
the WorkerCoordinates
param: requestedStatus the user-demanded state of the worker. This value is eventually
consistent as it's only an in-memory, replicated value (not read
from a durable storage)
param: observedStatus the status of the actual worker as observed by the ProjectionRegistry
.
A node in the cluster hosts an actor (the actual Worker actor) which
may be Stopped
or Started
. As that actor spawns or dies, the local
instance of the ProjectionRegistry
will observe the actor and share
the information with the rest of the ProjectionRegistry
instances
across the cluster.
Constructor and Description |
---|
Worker() |
Modifier and Type | Method and Description |
---|---|
static Worker |
apply(String tagName,
String key,
Status requestedStatus,
Status observedStatus) |
boolean |
equals(Object other) |
String |
getKey() |
Status |
getObservedStatus() |
Status |
getRequestedStatus() |
String |
getTagName() |
int |
hashCode() |
String |
key() |
Status |
observedStatus() |
Status |
requestedStatus() |
String |
tagName() |
String |
toString() |
public static Worker apply(String tagName, String key, Status requestedStatus, Status observedStatus)
public String tagName()
public String key()
public Status requestedStatus()
public Status observedStatus()
public String getKey()
public Status getObservedStatus()
public Status getRequestedStatus()
public String getTagName()