public class NodeAgent extends org.apache.uima.ducc.common.component.AbstractDuccComponent implements Agent, ProcessLifecycleObserver
| Modifier and Type | Class and Description |
|---|---|
class |
NodeAgent.ProcessMemoryUsageRoute
Process resident memory collector routes.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
cgroupFailureReason |
CGroupsManager |
cgroupsManager |
AgentConfiguration |
configurationFactory |
int |
cpuClockRate |
boolean |
excludeAPs |
static AtomicLong |
logCounter |
static org.apache.uima.ducc.common.utils.DuccLogger |
logger |
org.apache.uima.ducc.common.Node |
node |
int |
numProcessors |
int |
pageSize |
boolean |
pageSizeFetched |
static String |
ProcessStateUpdatePort |
boolean |
receivedDuccState |
int |
shareQuantum |
static int |
SIGKILL |
static int |
SIGTERM |
boolean |
useCgroups |
boolean |
virtualAgent |
COMPONENT_NAME, DUCC_NODE_METRICS_ENDPOINT| Constructor and Description |
|---|
NodeAgent()
Ctor used exclusively for black-box testing of this class.
|
NodeAgent(org.apache.uima.ducc.common.NodeIdentity ni) |
NodeAgent(org.apache.uima.ducc.common.NodeIdentity nodeIdentity,
Launcher launcher,
org.apache.camel.CamelContext context,
AgentConfiguration factory)
C'tor for dependecy injection
|
| Modifier and Type | Method and Description |
|---|---|
void |
copyAllUserReservations(TreeMap<String,org.apache.uima.ducc.common.node.metrics.NodeUsersInfo> map) |
Object |
deepCopy(Object original) |
void |
doStartProcess(org.apache.uima.ducc.transport.event.common.IDuccProcess process,
org.apache.uima.ducc.transport.cmdline.ICommandLine commandLine,
org.apache.uima.ducc.transport.event.common.IDuccStandardInfo info,
org.apache.uima.ducc.common.utils.id.DuccId workDuccId) |
void |
doStopProcess(org.apache.uima.ducc.transport.event.common.IDuccProcess process) |
boolean |
duccLingExists() |
void |
duccLingExists(boolean duccLingExists) |
Future<?> |
getDeployedJPFuture(org.apache.uima.ducc.common.utils.id.IDuccId duccId) |
org.apache.uima.ducc.transport.dispatcher.DuccEventDispatcher |
getEventDispatcherForRemoteProcess() |
AgentEventListener |
getEventListener() |
org.apache.uima.ducc.common.NodeIdentity |
getIdentity() |
HashMap<org.apache.uima.ducc.common.utils.id.DuccId,org.apache.uima.ducc.transport.event.common.IDuccProcess> |
getInventoryCopy()
Returns deep copy (by way of java serialization) of the Agents inventory.
|
HashMap<org.apache.uima.ducc.common.utils.id.DuccId,org.apache.uima.ducc.transport.event.common.IDuccProcess> |
getInventoryRef()
Returns shallow copy of the Agent's inventory
|
long |
getLastORSequence() |
org.apache.uima.ducc.common.utils.DuccLogger |
getLogger() |
org.apache.uima.ducc.common.Node |
getNodeInfo() |
int |
getNodeProcessors() |
int |
getNodeTotalNumberOfShares() |
int |
getOSClockRate() |
int |
getOSPageSize() |
RogueProcessReaper |
getRogueProcessReaper() |
List<org.apache.uima.ducc.common.utils.id.DuccId> |
getUserReservations(String uid) |
void |
handleAdminEvent(org.apache.uima.ducc.common.admin.event.DuccAdminEvent event) |
void |
interruptThreadInWaitFor(String pid) |
boolean |
isManagedProcess(Set<NodeUsersCollector.ProcessInfo> processList,
NodeUsersCollector.ProcessInfo cpi) |
boolean |
isRogueProcess(String uid,
Set<NodeUsersCollector.ProcessInfo> processList,
NodeUsersCollector.ProcessInfo cpi) |
void |
killProcessDueToLowSwapSpace(long minSwapThreshold)
Called when swap space on a node reached minimum as defined by ducc.node.min.swap.threshold in
ducc.properties.
|
static void |
lock() |
static void |
main(String[] args)
Called when an Agent receives self dispatched Ping message.
|
void |
onJPInitTimeout(org.apache.uima.ducc.transport.event.common.IDuccProcess process,
long timeout) |
void |
onProcessExit(org.apache.uima.ducc.transport.event.common.IDuccProcess process)
Called when a process exits.
|
void |
purgeProcess(org.apache.uima.ducc.transport.event.common.IDuccProcess process)
Remove given process from Agent's inventory
|
void |
reconcileProcessStateAndTakeAction(ProcessLifecycleController lifecycleController,
org.apache.uima.ducc.transport.event.common.IDuccProcess process,
org.apache.uima.ducc.transport.cmdline.ICommandLine commandLine,
org.apache.uima.ducc.transport.event.common.IDuccStandardInfo info,
org.apache.uima.ducc.transport.event.common.ProcessMemoryAssignment processMemoryAssignment,
org.apache.uima.ducc.common.utils.id.DuccId workDuccId)
Reconciles agent inventory with job processes sent by PM
|
boolean |
runWithDuccLing() |
void |
runWithDuccLing(boolean runWithDuccLing) |
void |
setAgentEventListener(AgentEventListener listener) |
void |
setNodeInfo(org.apache.uima.ducc.common.Node node) |
void |
setReservations(List<org.apache.uima.ducc.transport.event.common.DuccUserReservation> reserves)
Copies reservations sent by the PM.
|
void |
shutdown(String reason) |
void |
start(org.apache.uima.ducc.common.main.DuccService service) |
void |
startProcess(org.apache.uima.ducc.transport.event.common.IDuccProcess process,
org.apache.uima.ducc.transport.cmdline.ICommandLine commandLine,
org.apache.uima.ducc.transport.event.common.IDuccStandardInfo info,
org.apache.uima.ducc.common.utils.id.DuccId workDuccId,
org.apache.uima.ducc.transport.event.common.ProcessMemoryAssignment processMemoryAssignment)
Called when Agent receives request to start a process.
|
void |
stop() |
void |
stopProcess(org.apache.uima.ducc.transport.event.common.IDuccProcess process)
Called when Agent receives request to stop a process.
|
void |
takeDownProcessWithNoJob(ProcessLifecycleController lifecycleController,
List<org.apache.uima.ducc.transport.event.common.IDuccJobDeployment> jobDeploymentList)
Stops any process that is in agent's inventory but not in provided job list sent by the PM.
|
static void |
unlock() |
void |
updateProcessStatus(org.apache.uima.ducc.transport.event.ProcessStateUpdateDuccEvent duccEvent)
Called when UIMA AS service wrapper sends an update when a process status changes.
|
boolean |
userHasReservation(String uid) |
adjustTransportEndpoint, cleanup, getContext, getLogLevel, getProcessJmxUrl, handleUncaughtException, handleUncaughtException, isStopping, loadProperties, onDuccAdminKillEvent, reloadProperties, setContext, setLogLevel, setLogLevel, start, startJmxAgent, uncaughtException, validateAdministratorpublic static org.apache.uima.ducc.common.utils.DuccLogger logger
public static final String ProcessStateUpdatePort
public static int SIGKILL
public static int SIGTERM
public static AtomicLong logCounter
public static String cgroupFailureReason
public AgentConfiguration configurationFactory
public volatile boolean useCgroups
public CGroupsManager cgroupsManager
public org.apache.uima.ducc.common.Node node
public volatile boolean excludeAPs
public int shareQuantum
public boolean virtualAgent
public boolean pageSizeFetched
public int pageSize
public int cpuClockRate
public int numProcessors
public volatile boolean receivedDuccState
public NodeAgent()
public NodeAgent(org.apache.uima.ducc.common.NodeIdentity ni)
public NodeAgent(org.apache.uima.ducc.common.NodeIdentity nodeIdentity,
Launcher launcher,
org.apache.camel.CamelContext context,
AgentConfiguration factory)
throws Exception
nodeIdentity - - this Agent's identitylauncher - - component to launch processescontext - - camel contextExceptionpublic long getLastORSequence()
public AgentEventListener getEventListener()
public void setAgentEventListener(AgentEventListener listener)
public int getNodeProcessors()
public int getOSPageSize()
getOSPageSize in interface Agentpublic int getOSClockRate()
public void setNodeInfo(org.apache.uima.ducc.common.Node node)
public org.apache.uima.ducc.common.Node getNodeInfo()
public int getNodeTotalNumberOfShares()
public void start(org.apache.uima.ducc.common.main.DuccService service)
throws Exception
start in interface org.apache.uima.ducc.common.component.DuccLifecyclestart in class org.apache.uima.ducc.common.component.AbstractDuccComponentExceptionpublic org.apache.uima.ducc.transport.dispatcher.DuccEventDispatcher getEventDispatcherForRemoteProcess()
public boolean duccLingExists()
public void duccLingExists(boolean duccLingExists)
public boolean runWithDuccLing()
public void runWithDuccLing(boolean runWithDuccLing)
public HashMap<org.apache.uima.ducc.common.utils.id.DuccId,org.apache.uima.ducc.transport.event.common.IDuccProcess> getInventoryCopy()
getInventoryCopy in interface Agentpublic HashMap<org.apache.uima.ducc.common.utils.id.DuccId,org.apache.uima.ducc.transport.event.common.IDuccProcess> getInventoryRef()
getInventoryRef in interface Agentpublic void takeDownProcessWithNoJob(ProcessLifecycleController lifecycleController, List<org.apache.uima.ducc.transport.event.common.IDuccJobDeployment> jobDeploymentList)
lifecycleController - - instance implementing stopProcess() methodjobDeploymentList - - all DUCC jobs sent by PMpublic void reconcileProcessStateAndTakeAction(ProcessLifecycleController lifecycleController, org.apache.uima.ducc.transport.event.common.IDuccProcess process, org.apache.uima.ducc.transport.cmdline.ICommandLine commandLine, org.apache.uima.ducc.transport.event.common.IDuccStandardInfo info, org.apache.uima.ducc.transport.event.common.ProcessMemoryAssignment processMemoryAssignment, org.apache.uima.ducc.common.utils.id.DuccId workDuccId)
lifecycleController - - instance implementing stopProcess and startProcessprocess - - job process from a Job ListcommandLine - - in case this process is not in agents inventory we need cmd line to start itinfo - - DUCC common info including user log dir, user name, etcworkDuccId - - job idpublic void doStartProcess(org.apache.uima.ducc.transport.event.common.IDuccProcess process,
org.apache.uima.ducc.transport.cmdline.ICommandLine commandLine,
org.apache.uima.ducc.transport.event.common.IDuccStandardInfo info,
org.apache.uima.ducc.common.utils.id.DuccId workDuccId)
public void killProcessDueToLowSwapSpace(long minSwapThreshold)
public void interruptThreadInWaitFor(String pid) throws Exception
Exceptionpublic void startProcess(org.apache.uima.ducc.transport.event.common.IDuccProcess process,
org.apache.uima.ducc.transport.cmdline.ICommandLine commandLine,
org.apache.uima.ducc.transport.event.common.IDuccStandardInfo info,
org.apache.uima.ducc.common.utils.id.DuccId workDuccId,
org.apache.uima.ducc.transport.event.common.ProcessMemoryAssignment processMemoryAssignment)
startProcess in interface ProcessLifecycleControllerprocess - - IDuccProcess instance with identity (DuccId)commandLine - - fully defined command line that will be used to exec the process.public void doStopProcess(org.apache.uima.ducc.transport.event.common.IDuccProcess process)
public void stopProcess(org.apache.uima.ducc.transport.event.common.IDuccProcess process)
stopProcess in interface ProcessLifecycleControllerprocess - - IDuccProcess instance with identity (DuccId)public void purgeProcess(org.apache.uima.ducc.transport.event.common.IDuccProcess process)
throws Exception
process - - process to purge from inventoryExceptionpublic void updateProcessStatus(org.apache.uima.ducc.transport.event.ProcessStateUpdateDuccEvent duccEvent)
throws Exception
duccEvent - - Ducc event objectExceptionpublic org.apache.uima.ducc.common.NodeIdentity getIdentity()
getIdentity in interface Agentpublic void onProcessExit(org.apache.uima.ducc.transport.event.common.IDuccProcess process)
onProcessExit in interface ProcessLifecycleObserverpublic void onJPInitTimeout(org.apache.uima.ducc.transport.event.common.IDuccProcess process,
long timeout)
onJPInitTimeout in interface ProcessLifecycleObserverpublic void shutdown(String reason)
public boolean isManagedProcess(Set<NodeUsersCollector.ProcessInfo> processList, NodeUsersCollector.ProcessInfo cpi)
isManagedProcess in interface Agentpublic boolean isRogueProcess(String uid, Set<NodeUsersCollector.ProcessInfo> processList, NodeUsersCollector.ProcessInfo cpi) throws Exception
isRogueProcess in interface AgentExceptionpublic void stop()
throws Exception
stop in interface org.apache.uima.ducc.common.component.DuccLifecyclestop in class org.apache.uima.ducc.common.component.AbstractDuccComponentExceptionpublic Future<?> getDeployedJPFuture(org.apache.uima.ducc.common.utils.id.IDuccId duccId)
public void setReservations(List<org.apache.uima.ducc.transport.event.common.DuccUserReservation> reserves) throws Exception
reserves - - list of ALL reservationsExceptionpublic List<org.apache.uima.ducc.common.utils.id.DuccId> getUserReservations(String uid)
public void copyAllUserReservations(TreeMap<String,org.apache.uima.ducc.common.node.metrics.NodeUsersInfo> map)
copyAllUserReservations in interface Agentpublic RogueProcessReaper getRogueProcessReaper()
getRogueProcessReaper in interface Agentpublic static void main(String[] args)
public org.apache.uima.ducc.common.utils.DuccLogger getLogger()
getLogger in interface org.apache.uima.ducc.common.component.DuccComponentpublic void handleAdminEvent(org.apache.uima.ducc.common.admin.event.DuccAdminEvent event)
throws Exception
handleAdminEvent in interface org.apache.uima.ducc.common.component.DuccLifecyclehandleAdminEvent in class org.apache.uima.ducc.common.component.AbstractDuccComponentExceptionCopyright © 2012–2017 The Apache Software Foundation. All rights reserved.