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


Java DelegationTokenRenewal类代码示例

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


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

示例1: deletePath

import org.apache.hadoop.mapreduce.security.token.DelegationTokenRenewal; //导入依赖的package包/类
/**
 * Deletes the path (and its subdirectories recursively)
 * @throws IOException, InterruptedException 
 */
protected void deletePath() throws IOException, InterruptedException {
  final Path p = getPathForCleanup();
  (ugi == null ? UserGroupInformation.getLoginUser() : ugi).doAs(
      new PrivilegedExceptionAction<Object>() {
        public Object run() throws IOException {
          fs = (fs == null ?  p.getFileSystem(conf) : fs);
          try {
            fs.delete(p, true);
            return null;
          } finally {
            // So that we don't leave an entry in the FileSystem cache for
            // every UGI that a job is submitted with.
            if (ugi != null) {
              fs.close();
            }
          }
        }
      });
  
  // Cancel renewal of job-delegation token if necessary
  if (jobIdTokenRenewalToCancel != null && 
      conf.getBoolean(JobContext.JOB_CANCEL_DELEGATION_TOKEN, true)) {
    DelegationTokenRenewal.removeDelegationTokenRenewalForJob(
        jobIdTokenRenewalToCancel);
  }
}
 
开发者ID:Nextzero,项目名称:hadoop-2.6.0-cdh5.4.3,代码行数:31,代码来源:CleanupQueue.java

示例2: deletePath

import org.apache.hadoop.mapreduce.security.token.DelegationTokenRenewal; //导入依赖的package包/类
/**
 * Deletes the path (and its subdirectories recursively)
 * @throws IOException, InterruptedException 
 */
protected void deletePath() throws IOException, InterruptedException {
  final Path p = getPathForCleanup();
  (ugi == null ? UserGroupInformation.getLoginUser() : ugi).doAs(
      new PrivilegedExceptionAction<Object>() {
        public Object run() throws IOException {
          FileSystem fs = p.getFileSystem(conf);
          try {
            fs.delete(p, true);
            return null;
          } finally {
            // So that we don't leave an entry in the FileSystem cache for
            // every UGI that a job is submitted with.
            if (ugi != null) {
              fs.close();
            }
          }
        }
      });
  
  // Cancel renewal of job-delegation token if necessary
  if (jobIdTokenRenewalToCancel != null && 
      conf.getBoolean(JobContext.JOB_CANCEL_DELEGATION_TOKEN, true)) {
    DelegationTokenRenewal.removeDelegationTokenRenewalForJob(
        jobIdTokenRenewalToCancel);
  }
}
 
开发者ID:karahiyo,项目名称:hanoi-hadoop-2.0.0-cdh,代码行数:31,代码来源:CleanupQueue.java

示例3: garbageCollect

import org.apache.hadoop.mapreduce.security.token.DelegationTokenRenewal; //导入依赖的package包/类
/**
* The job is dead.  We're now GC'ing it, getting rid of the job
* from all tables.  Be sure to remove all of this job's tasks
* from the various tables.
*/
void garbageCollect() {
  synchronized(this) {
    // Cancel task tracker reservation
    cancelReservedSlots();


    // Let the JobTracker know that a job is complete
    jobtracker.getInstrumentation().decWaitingMaps(getJobID(), pendingMaps());
    jobtracker.getInstrumentation().decWaitingReduces(getJobID(), pendingReduces());
    jobtracker.storeCompletedJob(this);
    jobtracker.finalizeJob(this);

    try {
      // Definitely remove the local-disk copy of the job file
      if (localJobFile != null) {
        localFs.delete(localJobFile, true);
        localJobFile = null;
      }

      Path tempDir = jobtracker.getSystemDirectoryForJob(getJobID());
      new CleanupQueue().addToQueue(new PathDeletionContext(
          jobtracker.getFileSystem(), tempDir.toUri().getPath())); 
    } catch (IOException e) {
      LOG.warn("Error cleaning up "+profile.getJobID()+": "+e);
    }

    // free up the memory used by the data structures
    this.nonRunningMapCache = null;
    this.runningMapCache = null;
    this.nonRunningReduces = null;
    this.runningReduces = null;

  }
  // remove jobs delegation tokens
  if(conf.getBoolean(MRJobConfig.JOB_CANCEL_DELEGATION_TOKEN, true)) {
    DelegationTokenRenewal.removeDelegationTokenRenewalForJob(jobId);
  } // else don't remove it.May be used by spawned tasks
}
 
开发者ID:rekhajoshm,项目名称:mapreduce-fork,代码行数:44,代码来源:JobInProgress.java

示例4: garbageCollect

import org.apache.hadoop.mapreduce.security.token.DelegationTokenRenewal; //导入依赖的package包/类
/**
 * The job is dead.  We're now GC'ing it, getting rid of the job
 * from all tables.  Be sure to remove all of this job's tasks
 * from the various tables.
 */
void garbageCollect() {
  synchronized(this) {
    // Cancel task tracker reservation
    cancelReservedSlots();

    //  Waiting metrics are incremented in JobInProgress.initTasks()
    //  If a job gets an exception before that, we do not want to
    //  incorrectly decrement.
    if (tasksInited) {
      jobtracker.getInstrumentation().decWaitingMaps(getJobID(), pendingMaps());
      jobtracker.getInstrumentation().decWaitingReduces(getJobID(), pendingReduces());
      this.queueMetrics.decWaitingMaps(getJobID(), pendingMaps());
      this.queueMetrics.decWaitingReduces(getJobID(), pendingReduces());
    }
    // Let the JobTracker know that a job is complete
    jobtracker.storeCompletedJob(this);
    jobtracker.finalizeJob(this);

    try {
      // Definitely remove the local-disk copy of the job file
      if (localJobFile != null) {
        localFs.delete(localJobFile, true);
        localJobFile = null;
      }

      Path tempDir = jobtracker.getSystemDirectoryForJob(getJobID());
      CleanupQueue.getInstance().addToQueue(
          new PathDeletionContext(tempDir, conf)); 
    } catch (IOException e) {
      LOG.warn("Error cleaning up "+profile.getJobID()+": "+e);
    }

    cleanUpMetrics();
    // free up the memory used by the data structures
    this.failedMaps.clear();
    this.nonRunningMapCache = null;
    this.runningMapCache = null;
    this.nonRunningReduces = null;
    this.runningReduces = null;
  }
  
  // remove jobs delegation tokens
  if(conf.getBoolean(JobContext.JOB_CANCEL_DELEGATION_TOKEN, true)) {
    DelegationTokenRenewal.removeDelegationTokenRenewalForJob(jobId);
  } // else don't remove it.May be used by spawned tasks

  //close the user's FS
  try {
    fs.close();
  } catch (IOException ie) {
    LOG.warn("Ignoring exception " + StringUtils.stringifyException(ie) + 
        " while closing FileSystem for " + userUGI);
  }
}
 
开发者ID:Seagate,项目名称:hadoop-on-lustre,代码行数:60,代码来源:JobInProgress.java

示例5: garbageCollect

import org.apache.hadoop.mapreduce.security.token.DelegationTokenRenewal; //导入依赖的package包/类
/**
 * The job is dead.  We're now GC'ing it, getting rid of the job
 * from all tables.  Be sure to remove all of this job's tasks
 * from the various tables.
 */
void garbageCollect() {
  synchronized(this) {
    // Cancel task tracker reservation
    cancelReservedSlots();

    // Let the JobTracker know that a job is complete
    jobtracker.getInstrumentation().decWaitingMaps(getJobID(), pendingMaps());
    jobtracker.getInstrumentation().decWaitingReduces(getJobID(), pendingReduces());
    this.queueMetrics.decWaitingMaps(getJobID(), pendingMaps());
    this.queueMetrics.decWaitingReduces(getJobID(), pendingReduces());
    jobtracker.storeCompletedJob(this);
    jobtracker.finalizeJob(this);

    try {
      // Definitely remove the local-disk copy of the job file
      if (localJobFile != null) {
        localFs.delete(localJobFile, true);
        localJobFile = null;
      }

      Path tempDir = jobtracker.getSystemDirectoryForJob(getJobID());
      CleanupQueue.getInstance().addToQueue(
          new PathDeletionContext(tempDir, conf)); 
    } catch (IOException e) {
      LOG.warn("Error cleaning up "+profile.getJobID()+": "+e);
    }

    cleanUpMetrics();
    // free up the memory used by the data structures
    this.failedMaps.clear();
    this.nonRunningMapCache = null;
    this.runningMapCache = null;
    this.nonRunningReduces = null;
    this.runningReduces = null;
  }
  
  // remove jobs delegation tokens
  if(conf.getBoolean(JobContext.JOB_CANCEL_DELEGATION_TOKEN, true)) {
    DelegationTokenRenewal.removeDelegationTokenRenewalForJob(jobId);
  } // else don't remove it.May be used by spawned tasks

  //close the user's FS
  try {
    fs.close();
  } catch (IOException ie) {
    LOG.warn("Ignoring exception " + StringUtils.stringifyException(ie) + 
        " while closing FileSystem for " + userUGI);
  }
}
 
开发者ID:mammothcm,项目名称:mammoth,代码行数:55,代码来源:JobInProgress.java


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