|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.oracle.coherence.patterns.command.internal.CommandExecutor
public class CommandExecutor
An CommandExecutor is responsible for coordinating and
executing Commands (represented as CommandExecutionRequests)
for a single a Context.
Included in this responsibility is the recovery and potential
re-execution of CommandExecutionRequests
(in-the-originally-submitted-order). Such recovery may be due
to Coherence load-balancing or recovering cache partitions.
Internally CommandExecutors operate as a simple
finite-state-machine (see CommandExecutor.State for details on states).
CommandExecutors state transitions are typically controlled
via 'events' delivered a ContextBackingMapListener or through the
SubmitCommandExecutionRequestProcessor.
All CommandExecutors are monitorable through JMX. They are
automatically registered and de-registered when they created and stopped
(respectively).
Use a ContextsManager register and manage Contexts.
Copyright (c) 2008. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
CommandExecutionRequest,
CommandSubmitter,
CommandExecutorMBean,
SubmitCommandExecutionRequestProcessor| Nested Class Summary | |
|---|---|
static class |
CommandExecutor.State
The set of possible CommandExecutor.States for a CommandExecutor. |
| Constructor Summary | |
|---|---|
CommandExecutor(Identifier contextIdentifier,
com.tangosol.net.BackingMapManagerContext backingMapManagerContext)
Internal Constructor. |
|
| Method Summary | |
|---|---|
SubmissionOutcome |
acceptCommandExecutionRequest(CommandExecutionRequest commandExecutionRequest)
Accepts the specified CommandExecutionRequest for execution by this CommandExecutor. |
void |
execute()
The method is used to asynchronously execute queued CommandExecutionRequests. |
Identifier |
getContextIdentifier()
Returns the Identifier of the Context for which
this CommandExecutor is coordinating CommandExecutionRequest execution. |
String |
getContextIdentity()
Returns the Context Identifier as a string. |
long |
getContextVersion()
Returns the version number of the Context that the CommandExecutor
is managing. |
double |
getLocalAverageCommandExecutionDuration()
Returns the average execution time (in milliseconds) for the Commands executed locally by the current owner of the Context
(ie: local CommandExecutor). |
double |
getLocalCommandExecutionServiceDuration()
Returns the local command execution service duration (in milliseconds). |
long |
getLocalCommandsExecuted()
Returns the number of Commands that have been executed locally by the
current owner of the Context (ie: local CommandExecutor). |
long |
getLocalCommandsSubmitted()
Returns the number of Commands that have been submitted locally to the
current owner of the Context (ie: local CommandExecutor). |
double |
getLocalLastCommandExecutionDuration()
Returns the execution time (in milliseconds) for the last Command executed
locally by the current owner of the Context (ie: the local CommandExecutor) |
double |
getLocalMaximumCommandExecutionDuration()
Returns the maximum time (in milliseconds) that a Command has taken
to execute locally by the current owner of the Context (ie: the local CommandExecutor) |
double |
getLocalMinimumCommandExecutionDuration()
Returns the minimum time (in milliseconds) that a Command has taken
to execute locally by the current owner of the Context (ie: the local CommandExecutor) |
String |
getMBeanName()
Returns the cluster-wide uniquely generated JMX bean name for the CommandExecutor. |
CommandExecutor.State |
getState()
Returns the current CommandExecutor.State of the CommandExecutor. |
String |
getStatus()
Returns the current CommandExecutor.State of the CommandExecutor. |
long |
getTicketIssuerId()
Returns the current id that is being used to issue Tickets. |
long |
getTotalCommandExecutionDuration()
Returns the total time (in milliseconds) that the Commands executed thus far have taken to execute. |
long |
getTotalCommandExecutionWaitingDuration()
Returns the total time (in milliseconds) that the Commands executed thus far have waited to execute (ie: the queuing time). |
long |
getTotalCommandsExecuted()
Returns the total number of Commands for the Context
that have been executed (regardless of the owner) |
long |
getTotalCommandsPendingExecution()
Returns the total number of Commands that are yet to be executed |
void |
setState(CommandExecutor.State state)
Sets the CommandExecutor.State of the CommandExecutor. |
void |
start()
Starts up, initializes, recovers and schedules the CommandExecutor
to start processing CommandExecutionRequests. |
void |
stop()
Immediately stops the CommandExecutor from executing
any further CommandExecutionRequests. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CommandExecutor(Identifier contextIdentifier,
com.tangosol.net.BackingMapManagerContext backingMapManagerContext)
CommandExecutor for your application,
you should use a ContextsManager.
contextIdentifier - backingMapManagerContext - | Method Detail |
|---|
public Identifier getContextIdentifier()
Identifier of the Context for which
this CommandExecutor is coordinating CommandExecutionRequest execution.
Context Identifiers are unique across a cluster.
public void setState(CommandExecutor.State state)
CommandExecutor.State of the CommandExecutor.
state - public CommandExecutor.State getState()
CommandExecutor.State of the CommandExecutor.
public String getMBeanName()
CommandExecutor.
public String getContextIdentity()
Context Identifier as a string.
getContextIdentity in interface CommandExecutorMBeanpublic long getContextVersion()
Context that the CommandExecutor
is managing.
getContextVersion in interface CommandExecutorMBeanpublic String getStatus()
CommandExecutor.State of the CommandExecutor.
getStatus in interface CommandExecutorMBeanpublic long getTicketIssuerId()
Tickets.
NOTE: If another CommandExecutor is created for same
Context with the same Identifier in the cluster (due
to recovery / load-balancing of Contexts), a new Ticket
issuer id will be allocated to the new CommandExecutor.
This ensures that for each instance of a CommandExecutor, the
Ticket issuer id will be different, thus allowing us to "order"
Commands send to particular CommandExecutors.
getTicketIssuerId in interface CommandExecutorMBeanpublic long getTotalCommandsPendingExecution()
Commands that are yet to be executed
getTotalCommandsPendingExecution in interface CommandExecutorMBeanpublic long getLocalCommandsSubmitted()
Commands that have been submitted locally to the
current owner of the Context (ie: local CommandExecutor).
getLocalCommandsSubmitted in interface CommandExecutorMBeanpublic long getLocalCommandsExecuted()
Commands that have been executed locally by the
current owner of the Context (ie: local CommandExecutor).
getLocalCommandsExecuted in interface CommandExecutorMBeanpublic double getLocalAverageCommandExecutionDuration()
Commands executed locally by the current owner of the Context
(ie: local CommandExecutor).
getLocalAverageCommandExecutionDuration in interface CommandExecutorMBeanpublic double getLocalLastCommandExecutionDuration()
Command executed
locally by the current owner of the Context (ie: the local CommandExecutor)
getLocalLastCommandExecutionDuration in interface CommandExecutorMBeanpublic double getLocalCommandExecutionServiceDuration()
getLocalCommandExecutionServiceDuration in interface CommandExecutorMBeanpublic double getLocalMinimumCommandExecutionDuration()
Command has taken
to execute locally by the current owner of the Context (ie: the local CommandExecutor)
getLocalMinimumCommandExecutionDuration in interface CommandExecutorMBeanpublic double getLocalMaximumCommandExecutionDuration()
Command has taken
to execute locally by the current owner of the Context (ie: the local CommandExecutor)
getLocalMaximumCommandExecutionDuration in interface CommandExecutorMBeanpublic long getTotalCommandsExecuted()
Commands for the Context
that have been executed (regardless of the owner)
getTotalCommandsExecuted in interface CommandExecutorMBeanpublic long getTotalCommandExecutionDuration()
Commands executed thus far have taken to execute.
getTotalCommandExecutionDuration in interface CommandExecutorMBeanpublic long getTotalCommandExecutionWaitingDuration()
Commands executed thus far have waited to execute (ie: the queuing time).
getTotalCommandExecutionWaitingDuration in interface CommandExecutorMBeanpublic void start()
CommandExecutor
to start processing CommandExecutionRequests.
public void stop()
CommandExecutor from executing
any further CommandExecutionRequests.
public SubmissionOutcome acceptCommandExecutionRequest(CommandExecutionRequest commandExecutionRequest)
CommandExecutionRequest for execution by this CommandExecutor.
As part of this process, the CommandExecutionRequest is issued with a Ticket, has
the instant in time the CommandExecutionRequest was accepted (queued), places the
CommandExecutionRequest into the CommandExecutionRequests cache and queues
the CommandExecutionRequest for execution.
If the Member in which this CommandExecutor is running no longer owns the Context
to which the CommandExecutionRequest has been submitted (or ownership is in doubt), a Ticket.NONE
is returned.
commandExecutionRequest - The CommandExecutionRequest to be acceptedpublic void execute()
CommandExecutionRequests.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||