public class CommonUtils extends Object
| Constructor and Description |
|---|
CommonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addMonitortoQueue(BlockingQueue<UserMonitorData> queue,
MonitorID monitorID,
JobExecutionContext jobExecutionContext) |
static String |
getChannelID(MonitorID monitorID) |
static String |
getChannelID(String userName,
String hostAddress) |
static String |
getJobCountUpdatePath(MonitorID monitorID)
Construct and return the path for a given MonitorID , eg: /stat/{username}/{resourceName}/job
|
static String |
getRoutingKey(MonitorID monitorID) |
static String |
getRoutingKey(String userName,
String hostAddress) |
static void |
increaseZkJobCount(MonitorID monitorID)
Increase job count by one and update the zookeeper
|
static void |
invokeOutFlowHandlers(JobExecutionContext jobExecutionContext) |
static boolean |
isTheLastJobInQueue(BlockingQueue<MonitorID> queue,
MonitorID monitorID) |
static void |
removeMonitorFromQueue(UserMonitorData userMonitorData,
MonitorID monitorID)
This method doesn't have to be synchronized because it will be invoked by HPCPullMonitor which already synchronized
|
static void |
updateZkWithJobCount(org.apache.zookeeper.ZooKeeper zk,
Map<String,Integer> changeCountMap,
boolean isAdd)
Update job count for a given set of paths.
|
public static void addMonitortoQueue(BlockingQueue<UserMonitorData> queue, MonitorID monitorID, JobExecutionContext jobExecutionContext) throws AiravataMonitorException
AiravataMonitorExceptionpublic static boolean isTheLastJobInQueue(BlockingQueue<MonitorID> queue, MonitorID monitorID)
public static void removeMonitorFromQueue(UserMonitorData userMonitorData, MonitorID monitorID) throws AiravataMonitorException
monitorID - AiravataMonitorExceptionpublic static void invokeOutFlowHandlers(JobExecutionContext jobExecutionContext) throws GFacException
GFacExceptionpublic static void updateZkWithJobCount(org.apache.zookeeper.ZooKeeper zk,
Map<String,Integer> changeCountMap,
boolean isAdd)
zk - - zookeeper instancechangeCountMap - - map of change job count with relevant pathisAdd - - Should add or reduce existing job count by the given job count.public static void increaseZkJobCount(MonitorID monitorID)
monitorID - - Job monitorIdCopyright © 2011–2014 The Apache Software Foundation. All rights reserved.