public abstract class JobClientActor extends FlinkUntypedActor implements LeaderRetrievalListener
Modifier and Type | Field and Description |
---|---|
protected akka.actor.ActorRef |
client
The client which the actor is responsible for
|
protected akka.actor.ActorRef |
jobManager
ActorRef to the current leader
|
protected UUID |
leaderSessionID
leader session ID of the JobManager when this actor was created
|
protected scala.concurrent.duration.FiniteDuration |
timeout
timeout for futures
|
LOG
Constructor and Description |
---|
JobClientActor(LeaderRetrievalService leaderRetrievalService,
scala.concurrent.duration.FiniteDuration timeout,
boolean sysoutUpdates) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
connectedToJobManager()
Hook to be called once a connection has been established with the JobManager.
|
protected abstract Class |
getClientMessageClass()
Hook to let the client know about messages that should start a timer for a timeout
|
protected UUID |
getLeaderSessionID()
Returns the current leader session ID associated with this actor.
|
protected abstract void |
handleCustomMessage(Object message)
Hook to handle custom client message which are not handled by the base class.
|
void |
handleError(Exception exception)
This method is called by the
LeaderRetrievalService in case of an exception. |
protected void |
handleMessage(Object message)
This method contains the actor logic which defines how to react to incoming messages.
|
protected boolean |
isClientConnected() |
protected void |
logAndPrintMessage(String message) |
void |
notifyLeaderAddress(String leaderAddress,
UUID leaderSessionID)
This method is called by the
LeaderRetrievalService when a new leader is elected. |
void |
postStop() |
void |
preStart() |
protected void |
terminate() |
decorateMessage, onReceive
akka$actor$Actor$_setter_$context_$eq, akka$actor$Actor$_setter_$self_$eq, aroundPostRestart, aroundPostStop, aroundPreRestart, aroundPreStart, aroundReceive, context, getContext, getSelf, getSender, postRestart, preRestart, receive, self, sender, supervisorStrategy, unhandled
protected final scala.concurrent.duration.FiniteDuration timeout
protected akka.actor.ActorRef jobManager
protected UUID leaderSessionID
protected akka.actor.ActorRef client
public JobClientActor(LeaderRetrievalService leaderRetrievalService, scala.concurrent.duration.FiniteDuration timeout, boolean sysoutUpdates)
public void preStart()
preStart
in interface akka.actor.Actor
preStart
in class akka.actor.UntypedActor
public void postStop()
postStop
in interface akka.actor.Actor
postStop
in class akka.actor.UntypedActor
protected abstract void connectedToJobManager()
protected abstract void handleCustomMessage(Object message)
message
- The message to be handledprotected abstract Class getClientMessageClass()
protected void handleMessage(Object message)
FlinkUntypedActor
handleMessage
in class FlinkUntypedActor
message
- Incoming messageprotected UUID getLeaderSessionID()
FlinkUntypedActor
getLeaderSessionID
in class FlinkUntypedActor
protected void logAndPrintMessage(String message)
public void notifyLeaderAddress(String leaderAddress, UUID leaderSessionID)
LeaderRetrievalListener
LeaderRetrievalService
when a new leader is elected.notifyLeaderAddress
in interface LeaderRetrievalListener
leaderAddress
- The address of the new leaderleaderSessionID
- The new leader session IDpublic void handleError(Exception exception)
LeaderRetrievalListener
LeaderRetrievalService
in case of an exception. This
assures that the LeaderRetrievalListener
is aware of any problems occurring in the
LeaderRetrievalService
thread.handleError
in interface LeaderRetrievalListener
protected void terminate()
protected boolean isClientConnected()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.