public final class EngineServices extends java.lang.Object
Engine services
Provides access to engine level services. A transaction is required access this class.
| Modifier and Type | Class and Description |
|---|---|
static class |
EngineServices.ThrottleState
Throttle state
|
| Modifier and Type | Method and Description |
|---|---|
static int |
getEngineInstance()
Access engine instance
|
static java.lang.String |
getEngineName()
Get the name of this engine.
|
static java.lang.String |
getNodeName()
Node name for shared memory
|
static EngineServices.ThrottleState |
getThrottleState()
Check the state of throttling
|
static boolean |
isStopping()
Determine if engine is shutting down
|
static void |
stop(int returnCode)
Schedule the current engine to exit
|
static EngineServices.ThrottleState |
throttle()
Throttle incoming work if necessary
|
public static final boolean isStopping()
Determine if engine is shutting down
This operation can be used to determine if the engine is currently being shut down. When an engine is being shutdown, this operation will return true to indicate that a spawned thread or dispatched operation should stop execution. If a thread does not use this operation to determine when it should exit, the engine will hang and eventually it will be killed by the coordinator causing a non-recoverable node failure.
public static final void stop(int returnCode)
Schedule the current engine to exit
returnCode - Return value for engine
This operation is used to schedule the exit of an engine. This operation only schedules the engine to exit at some later time. It returns to the caller immediately.
A non-zero returnCode value will cause the coordinator to mark node as failed and remove the node's shared memory upon restart.
The node is marked failed if the engine does not exit within the configured engine abort timer after calling stop.
public static final java.lang.String getEngineName()
Get the name of this engine.
public static final java.lang.String getNodeName()
Node name for shared memory
Get the node name associated with the shared memory that this engine is running against.
public static final int getEngineInstance()
Access engine instance
Get the engine instance for the engine. All engines on a node have a unique engine instance number.
public static final EngineServices.ThrottleState throttle()
Throttle incoming work if necessary
If the percentage of shared memory in use exceeds the configured throttle threshold (50% by default), the throttle operation will block a little to slow down incoming work. Throttled is returned from the operation when in this state. When shared memory utilization becomes critical (80% by default) Stall is returned from the throttle operation after blocking for a longer period of time. The application should stop accepting incoming work at this point and attempt to complete processing already accepted work to clear shared memory space.
public static final EngineServices.ThrottleState getThrottleState()
Check the state of throttling
Get the current throttle state.