Package org.jgroups.protocols
Class Executing
java.lang.Object
org.jgroups.stack.Protocol
org.jgroups.protocols.Executing
- Direct Known Subclasses:
CENTRAL_EXECUTOR
This is the base protocol used for executions.
- Author:
- wburns
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classprotected static classprotected static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionThis is a queue on the client side that holds all of the tasks that are awaiting a consumer to pick them upprotected final Map<Executing.Owner, Runnable> This is a map on the client side that shows for which owner(consumer, request) the runnable they are currently using.protected LockThis lock is to protect the incoming run requests and the incoming consumer queuesThis is stored on the coordinator side.protected final ConcurrentMap<Runnable, Thread> This is a server side map to show which threads are running for a given runnable.protected final Map<Runnable, Executing.Owner> This is a map on the server side that shows which owner is currently tied to the runnable so we can return to them the resultsThis is stored on the coordinator side.protected BlockingQueue<Runnable> This is a server side queue of all the tasks to pass off.protected booleanprotected static final AtomicIntegerThis keeps track of all the requests we send.protected Addressprotected final ConcurrentMap<Future<?>, ExecutorNotification> protected View -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExecutorListener(Future<?> future, ExecutorNotification listener) An event is to be sent down the stack.booleangetView()protected voidhandleConsumerFoundResponse(Address consumer) protected voidhandleConsumerReadyRequest(Address source) protected voidhandleExceptionResponse(Address source, Executing.Request req) protected voidhandleInterruptRequest(Address source, short requestId) protected voidhandleNewConsumer(Address sender) protected voidhandleNewRunRequest(Address sender) protected voidhandleRemoveConsumer(Address sender) protected voidhandleRemoveRunRequest(Address sender) protected voidhandleTaskRejectedResponse(Address source, short requestId) protected voidhandleTaskRequest(Address source) protected voidhandleTaskSubmittedRequest(Runnable runnable, Address source, short requestId) protected voidhandleValueResponse(Address source, Executing.Request req) protected voidhandleView(View view) protected abstract voidsendNewConsumerRequest(Address source) protected abstract voidsendNewRunRequest(Address source) protected abstract voidsendRemoveConsumerRequest(Address source) protected abstract voidsendRemoveRunRequest(Address source) protected voidsendRequest(Address dest, Executing.Type type, short requestId, Object object) protected abstract voidsendToCoordinator(Executing.Type type, Object obj) voidsetBypassBundling(boolean bypass_bundling) An event was received from the layer below.Methods inherited from class org.jgroups.stack.Protocol
destroy, downThreadEnabled, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getId, getLevel, getName, getProperties, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getValue, init, isErgonomics, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProperties, setPropertiesInternal, setProperty, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled, stop, upThreadEnabled
-
Field Details
-
bypass_bundling
protected boolean bypass_bundling -
local_addr
-
view
-
_awaitingConsumer
This is a queue on the client side that holds all of the tasks that are awaiting a consumer to pick them up -
notifiers
-
_running
This is a map on the server side that shows which owner is currently tied to the runnable so we can return to them the results -
_awaitingReturn
This is a map on the client side that shows for which owner(consumer, request) the runnable they are currently using. This also allows us to set the values on a future when finished. -
_tasks
This is a server side queue of all the tasks to pass off. Currently there will never be tasks waiting to put in. If a task is put in and doesn't have a respective take at the same time that task is rejected. -
_runnableThreads
This is a server side map to show which threads are running for a given runnable. This is used to interrupt those threads if needed. -
_consumerLock
This lock is to protect the incoming run requests and the incoming consumer queues -
_runRequests
This is stored on the coordinator side. This queue holds all of the addresses that currently want to run something. If this queue has elements the consumer queue must be empty. -
_consumersAvailable
This is stored on the coordinator side. This queue holds all of the addresses that currently are able to run something. If this queue has elements the run request queue must be empty. -
counter
This keeps track of all the requests we send. This is used so that the response doesn't have to send back the future but instead the counter We just let this roll over
-
-
Constructor Details
-
Executing
public Executing()
-
-
Method Details
-
getBypassBundling
public boolean getBypassBundling() -
setBypassBundling
public void setBypassBundling(boolean bypass_bundling) -
addExecutorListener
-
getAddress
-
getView
-
down
Description copied from class:ProtocolAn event is to be sent down the stack. The layer may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the layer may need to add a header to it (or do nothing at all) before sending it down the stack usingdown_prot.down(). In case of a GET_ADDRESS event (which tries to retrieve the stack's address from one of the bottom layers), the layer may need to send a new response event back up the stack usingup_prot.up(). -
up
Description copied from class:ProtocolAn event was received from the layer below. Usually the current layer will want to examine the event type and - depending on its type - perform some computation (e.g. removing headers from a MSG event type, or updating the internal membership list when receiving a VIEW_CHANGE event). Finally the event is either a) discarded, or b) an event is sent down the stack usingdown_prot.down()or c) the event (or another event) is sent up the stack usingup_prot.up(). -
handleView
-
sendToCoordinator
-
sendNewRunRequest
-
sendRemoveRunRequest
-
sendNewConsumerRequest
-
sendRemoveConsumerRequest
-
handleTaskRequest
-
handleConsumerReadyRequest
-
handleConsumerFoundResponse
-
handleTaskSubmittedRequest
-
handleTaskRejectedResponse
-
handleValueResponse
-
handleExceptionResponse
-
handleInterruptRequest
-
handleNewRunRequest
-
handleRemoveRunRequest
-
handleNewConsumer
-
handleRemoveConsumer
-
sendRequest
-