On initial client login, the {@link ClientSessionService} will get anode assignment via {@link #assignNode assignNode}. If the assigned node is the current node (as determined by the nodeId), the client will proceed with the login protocol. Otherwise, the client will get a login response indicating a redirection, and the client code should attempt to log in at the redirected node.
Mappings will be removed when the system believes an identity has become quiescent, for example when a client logs out and there are no more durable tasks to be run for that client's identity. In order to determine whether an identity is quiescent, services which manage resources being used on an identity's behalf inform this mapping service when the identity is active or inactive on a node by calling {@link #setStatus setStatus}. The node mapping service will use this information for a simple reference counting garbage collection scheme within the map. Status is tracked per node, so services should consider only their local node state when calling setStatus.
TODO We might want a transactional method that returns true if an identity is both assigned to the local node and the local node is alive, as a convenience to other services.
TODO A variation of "assignNode" which adds hints for identities the input might want to colocate with will probably be added later.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|