public abstract class Executing extends Protocol
CENTRAL_EXECUTOR
Modifier and Type | Class and Description |
---|---|
static class |
Executing.ExecutorHeader |
static class |
Executing.Owner |
protected static class |
Executing.Request |
protected static class |
Executing.RequestWithThread |
protected static class |
Executing.Type |
Modifier and Type | Field and Description |
---|---|
protected java.util.Queue<java.lang.Runnable> |
_awaitingConsumer
This is a queue on the client side that holds all of the tasks that
are awaiting a consumer to pick them up
|
protected java.util.Map<Executing.Owner,java.lang.Runnable> |
_awaitingReturn
This is a map on the client side that shows for which
owner(consumer, request) the runnable they are currently using.
|
protected java.util.concurrent.ConcurrentMap<java.lang.Long,java.lang.Object> |
_consumerId
This is essentially a set on the consumer side of id's of all the threads
currently running as consumers.
|
protected java.util.concurrent.locks.Lock |
_consumerLock
This lock is to protect the incoming run requests and the incoming
consumer queues
|
protected java.util.Queue<Executing.Owner> |
_consumersAvailable
This is stored on the coordinator side.
|
protected java.util.concurrent.ConcurrentMap<java.lang.Runnable,java.lang.Long> |
_requestId
This is a map on the client side showing for all of the current pending
requests
|
protected java.util.concurrent.ConcurrentMap<java.lang.Runnable,java.lang.Thread> |
_runnableThreads
This is a server side map to show which threads are running for a
given runnable.
|
protected java.util.Map<java.lang.Runnable,Executing.Owner> |
_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
|
protected java.util.Queue<Executing.Owner> |
_runRequests
This is stored on the coordinator side.
|
protected java.util.concurrent.ConcurrentMap<java.lang.Long,java.util.concurrent.CyclicBarrier> |
_taskBarriers
This is a server side store of all the barriers for respective tasks
requests.
|
protected java.util.concurrent.ConcurrentMap<java.lang.Long,java.lang.Runnable> |
_tasks
This is a server side store of all the tasks that want to be ran on a
given thread.
|
protected boolean |
bypass_bundling |
protected static java.util.concurrent.atomic.AtomicLong |
counter
This keeps track of all the requests we send.
|
protected Address |
local_addr |
protected java.util.concurrent.ConcurrentMap<java.util.concurrent.Future<?>,ExecutorNotification> |
notifiers |
protected static java.lang.Object |
PRESENT
This is a placeholder for a key value to make a concurrent hash map
a concurrent hash set
|
protected View |
view |
after_creation_hook, down_prot, ergonomics, id, log, name, stack, stats, up_prot
Constructor and Description |
---|
Executing() |
Modifier and Type | Method and Description |
---|---|
void |
addExecutorListener(java.util.concurrent.Future<?> future,
ExecutorNotification listener) |
java.lang.Object |
down(Event evt)
An event is to be sent down the stack.
|
java.lang.String |
getAddress() |
boolean |
getBypassBundling() |
java.lang.String |
getView() |
protected void |
handleConsumerFoundResponse(long threadId,
Address address) |
protected void |
handleConsumerReadyRequest(long requestId,
Address address) |
protected void |
handleConsumerUnreadyRequest(long requestId,
Address address) |
protected void |
handleExceptionResponse(Address source,
long requestId,
java.lang.Throwable throwable) |
protected void |
handleInterruptRequest(Address source,
long requestId) |
protected void |
handleNewConsumer(Executing.Owner sender) |
protected void |
handleNewRunRequest(Executing.Owner sender) |
protected void |
handleRemoveConsumer(Executing.Owner sender) |
protected void |
handleRemoveRunRequest(Executing.Owner sender) |
protected void |
handleTaskRejectedResponse(Address source,
long requestId) |
protected void |
handleTaskRequest(long requestId,
Address address) |
protected void |
handleTaskSubmittedRequest(java.lang.Runnable runnable,
Address source,
long requestId,
long threadId) |
protected void |
handleValueResponse(Address source,
long requestId,
java.lang.Object value) |
protected void |
handleView(View view) |
protected static <V,K> V |
removeKeyForValue(java.util.Map<V,K> map,
K value) |
protected abstract void |
sendNewConsumerRequest(Executing.Owner source) |
protected abstract void |
sendNewRunRequest(Executing.Owner source) |
protected abstract void |
sendRemoveConsumerRequest(Executing.Owner source) |
protected abstract void |
sendRemoveRunRequest(Executing.Owner source) |
protected void |
sendRequest(Address dest,
Executing.Type type,
long requestId,
java.lang.Object object) |
protected void |
sendThreadRequest(Address dest,
long threadId,
Executing.Type type,
long requestId,
java.lang.Object object) |
protected abstract void |
sendToCoordinator(Executing.Type type,
long requestId,
Address address) |
void |
setBypassBundling(boolean bypass_bundling) |
java.lang.Object |
up(Event evt)
An event was received from the layer below.
|
accept, afterCreationHook, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, init, isErgonomics, level, parse, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled, stop, up
protected boolean bypass_bundling
protected Address local_addr
protected View view
protected final java.util.Queue<java.lang.Runnable> _awaitingConsumer
protected final java.util.concurrent.ConcurrentMap<java.lang.Runnable,java.lang.Long> _requestId
protected final java.util.concurrent.ConcurrentMap<java.lang.Long,java.lang.Object> _consumerId
protected final java.util.concurrent.ConcurrentMap<java.util.concurrent.Future<?>,ExecutorNotification> notifiers
protected final java.util.Map<java.lang.Runnable,Executing.Owner> _running
protected final java.util.Map<Executing.Owner,java.lang.Runnable> _awaitingReturn
protected java.util.concurrent.ConcurrentMap<java.lang.Long,java.lang.Runnable> _tasks
protected java.util.concurrent.ConcurrentMap<java.lang.Long,java.util.concurrent.CyclicBarrier> _taskBarriers
_tasks
map. A requestor
should first place in the _tasks
map and then create a latch
and notify the consumerprotected final java.util.concurrent.ConcurrentMap<java.lang.Runnable,java.lang.Thread> _runnableThreads
protected java.util.concurrent.locks.Lock _consumerLock
protected java.util.Queue<Executing.Owner> _runRequests
protected java.util.Queue<Executing.Owner> _consumersAvailable
protected static final java.util.concurrent.atomic.AtomicLong counter
protected static final java.lang.Object PRESENT
public boolean getBypassBundling()
public void setBypassBundling(boolean bypass_bundling)
public void addExecutorListener(java.util.concurrent.Future<?> future, ExecutorNotification listener)
public java.lang.String getAddress()
public java.lang.String getView()
public java.lang.Object down(Event evt)
Protocol
down_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 using up_prot.up()
.protected static <V,K> V removeKeyForValue(java.util.Map<V,K> map, K value)
public java.lang.Object up(Event evt)
Protocol
down_prot.down()
or c) the event (or another event) is sent up
the stack using up_prot.up()
.protected void handleView(View view)
protected abstract void sendToCoordinator(Executing.Type type, long requestId, Address address)
protected abstract void sendNewRunRequest(Executing.Owner source)
protected abstract void sendRemoveRunRequest(Executing.Owner source)
protected abstract void sendNewConsumerRequest(Executing.Owner source)
protected abstract void sendRemoveConsumerRequest(Executing.Owner source)
protected void handleTaskRequest(long requestId, Address address)
protected void handleConsumerReadyRequest(long requestId, Address address)
protected void handleConsumerUnreadyRequest(long requestId, Address address)
protected void handleConsumerFoundResponse(long threadId, Address address)
protected void handleTaskSubmittedRequest(java.lang.Runnable runnable, Address source, long requestId, long threadId)
protected void handleTaskRejectedResponse(Address source, long requestId)
protected void handleValueResponse(Address source, long requestId, java.lang.Object value)
protected void handleExceptionResponse(Address source, long requestId, java.lang.Throwable throwable)
protected void handleInterruptRequest(Address source, long requestId)
protected void handleNewRunRequest(Executing.Owner sender)
protected void handleRemoveRunRequest(Executing.Owner sender)
protected void handleNewConsumer(Executing.Owner sender)
protected void handleRemoveConsumer(Executing.Owner sender)
protected void sendRequest(Address dest, Executing.Type type, long requestId, java.lang.Object object)
protected void sendThreadRequest(Address dest, long threadId, Executing.Type type, long requestId, java.lang.Object object)
Copyright © 1998-2020 Red Hat. All Rights Reserved.