List of usage examples for org.apache.hadoop.yarn.api.records QueueInfo getQueueState
@Public @Stable public abstract QueueState getQueueState();
QueueState of the queue. From source file:co.cask.cdap.operations.yarn.YarnQueues.java
License:Apache License
@Override public synchronized void collect() throws Exception { reset();/*from w w w .j a va2s .c o m*/ List<QueueInfo> queues; YarnClient yarnClient = createYARNClient(); try { queues = yarnClient.getAllQueues(); } finally { yarnClient.stop(); } for (QueueInfo queue : queues) { switch (queue.getQueueState()) { case RUNNING: running++; break; case STOPPED: stopped++; break; } } }