• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java JobSchedulingInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: CapacitySchedulerQueue

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
public CapacitySchedulerQueue(String queueName, CapacitySchedulerConf conf) {
  this.queueName = queueName;

  // Do not allow changes to 'supportsPriorities'
  supportsPriorities = conf.isPrioritySupported(queueName);

  initializeQueue(conf);

  if (supportsPriorities) {
    // use the default priority-aware comparator
    comparator = JobQueueJobInProgressListener.FIFO_JOB_QUEUE_COMPARATOR;
  }
  else {
    comparator = STARTTIME_JOB_COMPARATOR;
  }
  this.waitingJobs = 
    new TreeMap<JobSchedulingInfo, JobInProgress>(comparator);
  this.initializingJobs =
    new TreeMap<JobSchedulingInfo, JobInProgress>(comparator);
  this.runningJobs = 
    new TreeMap<JobSchedulingInfo, JobInProgress>(comparator);

  this.mapSlots = new SlotsUsage();
  this.reduceSlots = new SlotsUsage();    
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:26,代码来源:CapacitySchedulerQueue.java


示例2: jobCompleted

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
private void jobCompleted(JobInProgress job, JobSchedulingInfo oldInfo, 
    CapacitySchedulerQueue queue, int runState) {
  LOG.info("Job " + job.getJobID().toString() + " submitted to queue " 
      + job.getProfile().getQueueName() + " has completed");
  //remove jobs from both queue's a job can be in
  //running and waiting queue at the same time.
  JobInProgress waitingJob = queue.removeWaitingJob(oldInfo, runState);
  JobInProgress initializingJob = 
    queue.removeInitializingJob(oldInfo, runState);
  JobInProgress runningJob = queue.removeRunningJob(oldInfo, runState);
  
  // let scheduler know if necessary
  // sometimes this isn't necessary if the job was rejected during submission
  if (runningJob != null || initializingJob != null || waitingJob != null) {
    scheduler.jobCompleted(job);
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:18,代码来源:JobQueuesManager.java


示例3: reorderJobs

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
private void reorderJobs(JobInProgress job, JobSchedulingInfo oldInfo, 
    CapacitySchedulerQueue queue, int runState) {
  if(queue.removeWaitingJob(oldInfo, runState) != null) {
    try {
      queue.addWaitingJob(job);
    } catch (IOException ioe) {
      // Ignore, cannot happen
      LOG.warn("Couldn't change priority!");
      return;
    }
  }
  if (queue.removeInitializingJob(oldInfo, runState) != null) {
    queue.addInitializingJob(job);
  }
  if(queue.removeRunningJob(oldInfo, runState) != null) {
    queue.addRunningJob(job);
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:19,代码来源:JobQueuesManager.java


示例4: jobStateChanged

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
private void jobStateChanged(JobStatusChangeEvent event, QueueInfo qi) {
  JobInProgress job = event.getJobInProgress();
  JobSchedulingInfo oldJobStateInfo = 
    new JobSchedulingInfo(event.getOldStatus());
  // Check if the ordering of the job has changed
  // For now priority and start-time can change the job ordering
  if (event.getEventType() == EventType.PRIORITY_CHANGED 
      || event.getEventType() == EventType.START_TIME_CHANGED) {
    // Make a priority change
    reorderJobs(job, oldJobStateInfo, qi);
  } else if (event.getEventType() == EventType.RUN_STATE_CHANGED) {
    // Check if the job is complete
    int runState = job.getStatus().getRunState();
    if (runState == JobStatus.SUCCEEDED
        || runState == JobStatus.FAILED
        || runState == JobStatus.KILLED) {
      jobCompleted(job, oldJobStateInfo, qi);
    } else if (runState == JobStatus.RUNNING) {
      makeJobRunning(job, oldJobStateInfo, qi);
    }
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:23,代码来源:JobQueuesManager.java


示例5: getFirstJobInQueue

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
/**
 * This method returns the first job in the queue and removes the same.
 * 
 * @param queue
 *          queue name
 * @return First job in the queue and removes it.
 */
private JobInProgress getFirstJobInQueue(String queue) {
  Map<JobSchedulingInfo, JobInProgress> jobsList = jobsPerQueue.get(queue);
  synchronized (jobsList) {
    if (jobsList.isEmpty()) {
      return null;
    }
    Iterator<JobInProgress> jobIterator = jobsList.values().iterator();
    JobInProgress job = jobIterator.next();
    jobIterator.remove();
    currentJobCount.getAndDecrement();
    return job;
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:21,代码来源:JobInitializationPoller.java


示例6: addJobsToQueue

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
void addJobsToQueue(String queue, JobInProgress job) {
  Map<JobSchedulingInfo, JobInProgress> jobs = jobsPerQueue.get(queue);
  if (jobs == null) {
    LOG.error("Invalid queue passed to the thread : " + queue
        + " For job :: " + job.getJobID());
  }
  synchronized (jobs) {
    JobSchedulingInfo schedInfo = new JobSchedulingInfo(job);
    jobs.put(schedInfo, job);
    currentJobCount.getAndIncrement();
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:13,代码来源:JobInitializationPoller.java


示例7: addQueue

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
void addQueue(String queueName) {
  CapacitySchedulerQueue queue = jobQueueManager.getQueue(queueName);

  TreeMap<JobSchedulingInfo, JobInProgress> jobs = 
    new TreeMap<JobSchedulingInfo, JobInProgress>(queue.getComparator());
  jobsPerQueue.put(queueName, jobs);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:8,代码来源:JobInitializationPoller.java


示例8: compare

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
public int compare(JobSchedulingInfo o1, JobSchedulingInfo o2) {
  // the job that started earlier wins
  if (o1.getStartTime() < o2.getStartTime()) {
    return -1;
  } else {
    return (o1.getStartTime() == o2.getStartTime() 
            ? o1.getJobID().compareTo(o2.getJobID()) 
            : 1);
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:11,代码来源:CapacitySchedulerQueue.java


示例9: jobInitializing

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
public void jobInitializing(JobSchedulingInfo jobSchedInfo, 
    JobInProgress job) {
  if (!initializingJobs.containsKey(jobSchedInfo)) {
    initializingJobs.put(jobSchedInfo, job);
    activeTasks += job.desiredTasks();
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:8,代码来源:CapacitySchedulerQueue.java


示例10: removeInitializingJob

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
synchronized JobInProgress removeInitializingJob(
    JobSchedulingInfo jobSchedInfo, int runState) {
  JobInProgress job = initializingJobs.remove(jobSchedInfo);
  
  if (job != null) {
    String user = job.getProfile().getUser();
    UserInfo userInfo = users.get(user);
    userInfo.removeInitializingJob(jobSchedInfo);
    
    // Decrement counts if the job is killed _while_ it was selected for
    // initialization, but aborted
    // NOTE: addRunningJob calls removeInitializingJob with runState==RUNNING
    if (runState != JobStatus.RUNNING) {
      finishJob(jobSchedInfo, job);
    }
    
    if (LOG.isDebugEnabled()) {
      LOG.debug("removeInitializingJob:" +
          " job=" + job.getJobID() +
          " user=" + user + 
          " queue=" + queueName +
          " qWaitJobs=" +  getNumWaitingJobs() +
          " qInitJobs=" +  getNumInitializingJobs()+
          " qRunJobs=" +  getNumRunningJobs() +
          " qActiveTasks=" +  getNumActiveTasks() +
          " uWaitJobs=" +  getNumWaitingJobsByUser(user) +
          " uInitJobs=" +  getNumInitializingJobsByUser(user) +
          " uRunJobs=" +  getNumRunningJobsByUser(user) +
          " uActiveTasks=" +  getNumActiveTasksByUser(user)
      );
    }
  }
  
  return job;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:36,代码来源:CapacitySchedulerQueue.java


示例11: addRunningJob

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
synchronized void addRunningJob(JobInProgress job) {
  JobSchedulingInfo jobSchedInfo = new JobSchedulingInfo(job);

  if (runningJobs.containsKey(jobSchedInfo)) {
    LOG.info("job " + job.getJobID() + " already running in queue'" +
        queueName + "'!");
    return;
  }

  // Mark the job as running
  runningJobs.put(jobSchedInfo,job);

  // Update user stats
  String user = job.getProfile().getUser();
  UserInfo userInfo = users.get(user);
  userInfo.jobInitialized(jobSchedInfo, job);
  
  if (LOG.isDebugEnabled()) {
    LOG.debug("addRunningJob:" +
        " job=" + job.getJobID() +
        " user=" + user + 
        " queue=" + queueName +
        " qWaitJobs=" +  getNumWaitingJobs() +
        " qInitJobs=" +  getNumInitializingJobs()+
        " qRunJobs=" +  getNumRunningJobs() +
        " qActiveTasks=" +  getNumActiveTasks() +
        " uWaitJobs=" +  getNumWaitingJobsByUser(user) +
        " uInitJobs=" +  getNumInitializingJobsByUser(user) +
        " uRunJobs=" +  getNumRunningJobsByUser(user) +
        " uActiveTasks=" +  getNumActiveTasksByUser(user)
    );
  }

  // Remove from 'initializing' list
  // Note that at this point job.status.state != RUNNING, 
  // however, logically it is a reasonable state to pass in to ensure
  // that removeInitializingJob doesn't double-decrement  
  // the relevant queue/user counters
  removeInitializingJob(jobSchedInfo, JobStatus.RUNNING);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:41,代码来源:CapacitySchedulerQueue.java


示例12: addJob

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
synchronized private void addJob(JobSchedulingInfo jobSchedInfo,
    JobInProgress job) {
  // Update queue stats
  activeTasks += job.desiredTasks();
  
  // Update user stats
  String user = job.getProfile().getUser();
  UserInfo userInfo = users.get(user);
  userInfo.jobInitializing(jobSchedInfo, job);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:11,代码来源:CapacitySchedulerQueue.java


示例13: finishJob

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
synchronized private void finishJob(JobSchedulingInfo jobSchedInfo,
    JobInProgress job) {
  // Update user stats
  String user = job.getProfile().getUser();
  UserInfo userInfo = users.get(user);
  userInfo.jobCompleted(jobSchedInfo, job);
  
  if (userInfo.isInactive()) {
    users.remove(userInfo);
  }

  // Update queue stats
  activeTasks -= job.desiredTasks();
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:15,代码来源:CapacitySchedulerQueue.java


示例14: removeRunningJob

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
synchronized JobInProgress removeRunningJob(JobSchedulingInfo jobSchedInfo, 
    int runState) {
  JobInProgress job = runningJobs.remove(jobSchedInfo); 

  // We have to be careful, we might be trying to remove a job  
  // which might not have been initialized
  if (job != null) {
    String user = job.getProfile().getUser();
    finishJob(jobSchedInfo, job);
    
    if (LOG.isDebugEnabled()) {
      LOG.debug("removeRunningJob:" +
          " job=" + job.getJobID() +
          " user=" + user + 
          " queue=" + queueName +
          " qWaitJobs=" +  getNumWaitingJobs() +
          " qInitJobs=" +  getNumInitializingJobs()+
          " qRunJobs=" +  getNumRunningJobs() +
          " qActiveTasks=" +  getNumActiveTasks() +
          " uWaitJobs=" +  getNumWaitingJobsByUser(user) +
          " uInitJobs=" +  getNumInitializingJobsByUser(user) +
          " uRunJobs=" +  getNumRunningJobsByUser(user) +
          " uActiveTasks=" +  getNumActiveTasksByUser(user)
      );
    }
  }

  return job;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:30,代码来源:CapacitySchedulerQueue.java


示例15: addWaitingJob

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
synchronized void addWaitingJob(JobInProgress job) throws IOException {
  JobSchedulingInfo jobSchedInfo = new JobSchedulingInfo(job);
  if (waitingJobs.containsKey(jobSchedInfo)) {
    LOG.info("job " + job.getJobID() + " already waiting in queue '" + 
        queueName + "'!");
    return;
  }
  
  String user = job.getProfile().getUser();

  // Check acceptance limits
  checkJobSubmissionLimits(job, user);
  
  waitingJobs.put(jobSchedInfo, job);
  
  // Update user stats
  UserInfo userInfo = users.get(user);
  if (userInfo == null) {
    userInfo = new UserInfo(comparator);
    users.put(user, userInfo);
  }
  userInfo.jobAdded(jobSchedInfo, job);
  
  if (LOG.isDebugEnabled()) {
    LOG.debug("addWaitingJob:" +
        " job=" + job.getJobID() +
        " user=" + user + 
        " queue=" + queueName +
        " qWaitJobs=" +  getNumWaitingJobs() +
        " qInitJobs=" +  getNumInitializingJobs()+
        " qRunJobs=" +  getNumRunningJobs() +
        " qActiveTasks=" +  getNumActiveTasks() +
        " uWaitJobs=" +  getNumWaitingJobsByUser(user) +
        " uInitJobs=" +  getNumInitializingJobsByUser(user) +
        " uRunJobs=" +  getNumRunningJobsByUser(user) +
        " uActiveTasks=" +  getNumActiveTasksByUser(user)
    );
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:40,代码来源:CapacitySchedulerQueue.java


示例16: removeWaitingJob

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
synchronized JobInProgress removeWaitingJob(JobSchedulingInfo jobSchedInfo, 
    int unused) {
  JobInProgress job = waitingJobs.remove(jobSchedInfo);
  if (job != null) {
    String user = job.getProfile().getUser();
    UserInfo userInfo = users.get(user);
    userInfo.removeWaitingJob(jobSchedInfo);

    if (LOG.isDebugEnabled()) {
      LOG.debug("removeWaitingJob:" +
          " job=" + job.getJobID() +
          " user=" + user + 
          " queue=" + queueName +
          " qWaitJobs=" +  getNumWaitingJobs() +
          " qInitJobs=" +  getNumInitializingJobs()+
          " qRunJobs=" +  getNumRunningJobs() +
          " qActiveTasks=" +  getNumActiveTasks() +
          " uWaitJobs=" +  getNumWaitingJobsByUser(user) +
          " uInitJobs=" +  getNumInitializingJobsByUser(user) +
          " uRunJobs=" +  getNumRunningJobsByUser(user) +
          " uActiveTasks=" +  getNumActiveTasksByUser(user)
      );
    }
  }
  
  return job;
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:28,代码来源:CapacitySchedulerQueue.java


示例17: makeJobRunning

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
private void makeJobRunning(JobInProgress job, JobSchedulingInfo oldInfo, 
                            CapacitySchedulerQueue queue) {
  // Removing of the job from job list is responsibility of the
  //initialization poller.
  // Add the job to the running queue
  queue.addRunningJob(job);
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:8,代码来源:JobQueuesManager.java


示例18: getFirstJobInQueue

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
/**
 * This method returns the first job in the queue and removes the same.
 * 
 * @param queue
 *          queue name
 * @return First job in the queue and removes it.
 */
private JobInProgress getFirstJobInQueue(String queue) {
  TreeMap<JobSchedulingInfo, JobInProgress> jobsList = jobsPerQueue
      .get(queue);
  synchronized (jobsList) {
    if (jobsList.isEmpty()) {
      return null;
    }
    Iterator<JobInProgress> jobIterator = jobsList.values().iterator();
    JobInProgress job = jobIterator.next();
    jobIterator.remove();
    currentJobCount.getAndDecrement();
    return job;
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:22,代码来源:JobInitializationPoller.java


示例19: addJobsToQueue

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
void addJobsToQueue(String queue, JobInProgress job) {
  TreeMap<JobSchedulingInfo, JobInProgress> jobs = jobsPerQueue
      .get(queue);
  if (jobs == null) {
    LOG.error("Invalid queue passed to the thread : " + queue
        + " For job :: " + job.getJobID());
  }
  synchronized (jobs) {
    JobSchedulingInfo schedInfo = new JobSchedulingInfo(job);
    jobs.put(schedInfo, job);
    currentJobCount.getAndIncrement();
  }
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:14,代码来源:JobInitializationPoller.java


示例20: QueueInfo

import org.apache.hadoop.mapred.JobQueueJobInProgressListener.JobSchedulingInfo; //导入依赖的package包/类
QueueInfo(boolean prio) {
  this.supportsPriorities = prio;
  if (supportsPriorities) {
    // use the default priority-aware comparator
    comparator = JobQueueJobInProgressListener.FIFO_JOB_QUEUE_COMPARATOR;
  }
  else {
    comparator = STARTTIME_JOB_COMPARATOR;
  }
  waitingJobs = new TreeMap<JobSchedulingInfo, JobInProgress>(comparator);
  runningJobs = new TreeMap<JobSchedulingInfo, JobInProgress>(comparator);
}
 
开发者ID:rhli,项目名称:hadoop-EAR,代码行数:13,代码来源:JobQueuesManager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Key类代码示例发布时间:2022-05-22
下一篇:
Java AddPaintingPacket类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap