当前位置: 首页>>代码示例>>Java>>正文


Java QueueInfo类代码示例

本文整理汇总了Java中org.apache.hadoop.mapreduce.QueueInfo的典型用法代码示例。如果您正苦于以下问题:Java QueueInfo类的具体用法?Java QueueInfo怎么用?Java QueueInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


QueueInfo类属于org.apache.hadoop.mapreduce包,在下文中一共展示了QueueInfo类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getJobsFromQueue

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
/**
 * Gets all the jobs which were added to particular Job Queue
 * 
 * @param queueName name of the Job Queue
 * @return Array of jobs present in the job queue
 * @throws IOException
 */

public JobStatus[] getJobsFromQueue(final String queueName) throws IOException {
  try {
    QueueInfo queue = clientUgi.doAs(new PrivilegedExceptionAction<QueueInfo>() {
      @Override
      public QueueInfo run() throws IOException, InterruptedException {
        return cluster.getQueue(queueName);
      }
    });
    if (queue == null) {
      return null;
    }
    org.apache.hadoop.mapreduce.JobStatus[] stats = 
      queue.getJobStatuses();
    JobStatus[] ret = new JobStatus[stats.length];
    for (int i = 0 ; i < stats.length; i++ ) {
      ret[i] = JobStatus.downgrade(stats[i]);
    }
    return ret;
  } catch (InterruptedException ie) {
    throw new IOException(ie);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:31,代码来源:JobClient.java

示例2: getQueueInfo

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
/**
 * Gets the queue information associated to a particular Job Queue
 * 
 * @param queueName name of the job queue.
 * @return Queue information associated to particular queue.
 * @throws IOException
 */
public JobQueueInfo getQueueInfo(final String queueName) throws IOException {
  try {
    QueueInfo queueInfo = clientUgi.doAs(new 
        PrivilegedExceptionAction<QueueInfo>() {
      public QueueInfo run() throws IOException, InterruptedException {
        return cluster.getQueue(queueName);
      }
    });
    if (queueInfo != null) {
      return new JobQueueInfo(queueInfo);
    }
    return null;
  } catch (InterruptedException ie) {
    throw new IOException(ie);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:JobClient.java

示例3: getQueue

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
public QueueInfo getQueue(String queueName) throws IOException,
InterruptedException {
  try {
    org.apache.hadoop.yarn.api.records.QueueInfo queueInfo =
        client.getQueueInfo(queueName);
    return (queueInfo == null) ? null : TypeConverter.fromYarn(queueInfo,
        conf);
  } catch (YarnException e) {
    throw new IOException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:12,代码来源:ResourceMgrDelegate.java

示例4: getQueues

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
public QueueInfo[] getQueues() throws IOException, InterruptedException {
  try {
    return TypeConverter.fromYarnQueueInfo(client.getAllQueues(), this.conf);
  } catch (YarnException e) {
    throw new IOException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:ResourceMgrDelegate.java

示例5: getRootQueues

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
public QueueInfo[] getRootQueues() throws IOException, InterruptedException {
  try {
    return TypeConverter.fromYarnQueueInfo(client.getRootQueueInfos(),
        this.conf);
  } catch (YarnException e) {
    throw new IOException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:ResourceMgrDelegate.java

示例6: getChildQueues

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
public QueueInfo[] getChildQueues(String parent) throws IOException,
    InterruptedException {
  try {
    return TypeConverter.fromYarnQueueInfo(client.getChildQueueInfos(parent),
      this.conf);
  } catch (YarnException e) {
    throw new IOException(e);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:ResourceMgrDelegate.java

示例7: getJobQueueInfo

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
private JobQueueInfo getJobQueueInfo(QueueInfo queue) {
  JobQueueInfo ret = new JobQueueInfo(queue);
  // make sure to convert any children
  if (queue.getQueueChildren().size() > 0) {
    List<JobQueueInfo> childQueues = new ArrayList<JobQueueInfo>(queue
        .getQueueChildren().size());
    for (QueueInfo child : queue.getQueueChildren()) {
      childQueues.add(getJobQueueInfo(child));
    }
    ret.setChildren(childQueues);
  }
  return ret;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:JobClient.java

示例8: getJobQueueInfoArray

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
private JobQueueInfo[] getJobQueueInfoArray(QueueInfo[] queues)
    throws IOException {
  JobQueueInfo[] ret = new JobQueueInfo[queues.length];
  for (int i = 0; i < queues.length; i++) {
    ret[i] = getJobQueueInfo(queues[i]);
  }
  return ret;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:JobClient.java

示例9: JobQueueInfo

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
JobQueueInfo(QueueInfo queue) {
  this(queue.getQueueName(), queue.getSchedulingInfo());
  setQueueState(queue.getState().getStateName());
  setQueueChildren(queue.getQueueChildren());
  setProperties(queue.getProperties());
  setJobStatuses(queue.getJobStatuses());
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:JobQueueInfo.java

示例10: setChildren

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
@InterfaceAudience.Private
public void setChildren(List<JobQueueInfo> children) {
  List<QueueInfo> list = new ArrayList<QueueInfo>();
  for (JobQueueInfo q : children) {
    list.add(q);
  }
  super.setQueueChildren(list);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:JobQueueInfo.java

示例11: getChildren

import org.apache.hadoop.mapreduce.QueueInfo; //导入依赖的package包/类
public List<JobQueueInfo> getChildren() {
  List<JobQueueInfo> list = new ArrayList<JobQueueInfo>();
  for (QueueInfo q : super.getQueueChildren()) {
    list.add((JobQueueInfo)q);
  }
  return list;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:JobQueueInfo.java


注:本文中的org.apache.hadoop.mapreduce.QueueInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。