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


Java Private类代码示例

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


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

示例1: getRMDefaultPortNumber

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
public static int getRMDefaultPortNumber(String addressPrefix,
    Configuration conf) {
  if (addressPrefix.equals(YarnConfiguration.RM_ADDRESS)) {
    return YarnConfiguration.DEFAULT_RM_PORT;
  } else if (addressPrefix.equals(YarnConfiguration.RM_SCHEDULER_ADDRESS)) {
    return YarnConfiguration.DEFAULT_RM_SCHEDULER_PORT;
  } else if (addressPrefix.equals(YarnConfiguration.RM_WEBAPP_ADDRESS)) {
    return YarnConfiguration.DEFAULT_RM_WEBAPP_PORT;
  } else if (addressPrefix.equals(YarnConfiguration.RM_WEBAPP_HTTPS_ADDRESS)) {
    return YarnConfiguration.DEFAULT_RM_WEBAPP_HTTPS_PORT;
  } else if (addressPrefix
      .equals(YarnConfiguration.RM_RESOURCE_TRACKER_ADDRESS)) {
    return YarnConfiguration.DEFAULT_RM_RESOURCE_TRACKER_PORT;
  } else if (addressPrefix.equals(YarnConfiguration.RM_ADMIN_ADDRESS)) {
    return YarnConfiguration.DEFAULT_RM_ADMIN_PORT;
  } else {
    throw new HadoopIllegalArgumentException(
        "Invalid RM RPC address Prefix: " + addressPrefix
            + ". The valid value should be one of "
            + getServiceAddressConfKeys(conf));
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:YarnConfiguration.java

示例2: newInstance

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
@Unstable
public static RegisterApplicationMasterResponse newInstance(
    Resource minCapability, Resource maxCapability,
    Map<ApplicationAccessType, String> acls, ByteBuffer key,
    List<Container> containersFromPreviousAttempt, String queue,
    List<NMToken> nmTokensFromPreviousAttempts) {
  RegisterApplicationMasterResponse response =
      Records.newRecord(RegisterApplicationMasterResponse.class);
  response.setMaximumResourceCapability(maxCapability);
  response.setApplicationACLs(acls);
  response.setClientToAMTokenMasterKey(key);
  response.setContainersFromPreviousAttempts(containersFromPreviousAttempt);
  response.setNMTokensFromPreviousAttempts(nmTokensFromPreviousAttempts);
  response.setQueue(queue);
  return response;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:18,代码来源:RegisterApplicationMasterResponse.java

示例3: killTask

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
/**
 * Kill indicated task attempt.
 * @param taskId the id of the task to kill.
 * @param shouldFail if <code>true</code> the task is failed and added
 *                   to failed tasks list, otherwise it is just killed,
 *                   w/o affecting job failure status.
 */
@Private
public boolean killTask(final TaskAttemptID taskId,
                        final boolean shouldFail) throws IOException {
  ensureState(JobState.RUNNING);
  try {
    return ugi.doAs(new PrivilegedExceptionAction<Boolean>() {
      public Boolean run() throws IOException, InterruptedException {
        return cluster.getClient().killTask(taskId, shouldFail);
      }
    });
  }
  catch (InterruptedException ie) {
    throw new IOException(ie);
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:23,代码来源:Job.java

示例4: newInstance

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
@Unstable
public static NodeReport newInstance(NodeId nodeId, NodeState nodeState,
    String httpAddress, String rackName, Resource used, Resource capability,
    int numContainers, String healthReport, long lastHealthReportTime,
    Set<String> nodeLabels) {
  NodeReport nodeReport = Records.newRecord(NodeReport.class);
  nodeReport.setNodeId(nodeId);
  nodeReport.setNodeState(nodeState);
  nodeReport.setHttpAddress(httpAddress);
  nodeReport.setRackName(rackName);
  nodeReport.setUsed(used);
  nodeReport.setCapability(capability);
  nodeReport.setNumContainers(numContainers);
  nodeReport.setHealthReport(healthReport);
  nodeReport.setLastHealthReportTime(lastHealthReportTime);
  nodeReport.setNodeLabels(nodeLabels);
  return nodeReport;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:20,代码来源:NodeReport.java

示例5: rollMasterKey

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
/**
 * Creates a new master-key and sets it as the primary.
 */
@Private
public void rollMasterKey() {
  super.writeLock.lock();
  try {
    LOG.info("Rolling master-key for nm-tokens");
    if (this.currentMasterKey == null) { // Setting up for the first time.
      this.currentMasterKey = createNewMasterKey();
    } else {
      this.nextMasterKey = createNewMasterKey();
      LOG.info("Going to activate master-key with key-id "
          + this.nextMasterKey.getMasterKey().getKeyId() + " in "
          + this.activationDelay + "ms");
      this.timer.schedule(new NextKeyActivator(), this.activationDelay);
    }
  } finally {
    super.writeLock.unlock();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:22,代码来源:NMTokenSecretManagerInRM.java

示例6: newInstance

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
@Unstable
public static GetApplicationReportResponse newInstance(
    ApplicationReport ApplicationReport) {
  GetApplicationReportResponse response =
      Records.newRecord(GetApplicationReportResponse.class);
  response.setApplicationReport(ApplicationReport);
  return response;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:GetApplicationReportResponse.java

示例7: readFileToSetWithFileInputStream

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
public static void readFileToSetWithFileInputStream(String type,
    String filename, InputStream fileInputStream, Set<String> set)
    throws IOException {
  BufferedReader reader = null;
  try {
    reader = new BufferedReader(
        new InputStreamReader(fileInputStream, Charsets.UTF_8));
    String line;
    while ((line = reader.readLine()) != null) {
      String[] nodes = line.split("[ \t\n\f\r]+");
      if (nodes != null) {
        for (int i = 0; i < nodes.length; i++) {
          nodes[i] = nodes[i].trim();
          if (nodes[i].startsWith("#")) {
            // Everything from now on is a comment
            break;
          }
          if (!nodes[i].isEmpty()) {
            LOG.info("Adding a node \"" + nodes[i] + "\" to the list of "
                + type + " hosts from " + filename);
            set.add(nodes[i]);
          }
        }
      }
    }
  } finally {
    if (reader != null) {
      reader.close();
    }
    fileInputStream.close();
  }
}
 
开发者ID:nucypher,项目名称:hadoop-oss,代码行数:34,代码来源:HostsFileReader.java

示例8: createPassword

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
@Override
public synchronized byte[] createPassword(
    ClientToAMTokenIdentifier identifier) {
  return createPassword(identifier.getBytes(),
    getMasterKey(identifier.getApplicationAttemptID()));
}
 
开发者ID:naver,项目名称:hadoop,代码行数:8,代码来源:BaseClientToAMTokenSecretManager.java

示例9: retrievePassword

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
@Override
public byte[] retrievePassword(ClientToAMTokenIdentifier identifier)
    throws SecretManager.InvalidToken {
  SecretKey masterKey = getMasterKey(identifier.getApplicationAttemptID());
  if (masterKey == null) {
    throw new SecretManager.InvalidToken("Illegal client-token!");
  }
  return createPassword(identifier.getBytes(), masterKey);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:BaseClientToAMTokenSecretManager.java

示例10: doGet

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException {
  RequestDispatcher rd = getServletContext().getNamedDispatcher("default");

  HttpServletRequest wrapped = new HttpServletRequestWrapper(req) {
    public String getServletPath() {
    return "";
    }
  };

  rd.forward(wrapped, resp);
  }
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:DefaultWrapperServlet.java

示例11: newInstance

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
@Unstable
public static GetQueueUserAclsInfoResponse newInstance(
    List<QueueUserACLInfo> queueUserAclsList) {
  GetQueueUserAclsInfoResponse response =
      Records.newRecord(GetQueueUserAclsInfoResponse.class);
  response.setUserAclsInfoList(queueUserAclsList);
  return response;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:GetQueueUserAclsInfoResponse.java

示例12: getRMAddress

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
/**
 * Get the ResourceManager address from the provided Configuration for the
 * given protocol.
 */
@Private
protected InetSocketAddress getRMAddress(
    YarnConfiguration conf, Class<?> protocol) throws IOException {
  throw new UnsupportedOperationException("This method should be invoked " +
      "from an instance of ClientRMProxy or ServerRMProxy");
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:RMProxy.java

示例13: setResourceMgrDelegate

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
/**
 * Used for testing mostly.
 * @param resMgrDelegate the resource manager delegate to set to.
 */
public void setResourceMgrDelegate(ResourceMgrDelegate resMgrDelegate) {
  this.resMgrDelegate = resMgrDelegate;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:9,代码来源:YARNRunner.java

示例14: getNewZooKeeper

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@VisibleForTesting
@Private
@Unstable
protected synchronized ZooKeeper getNewZooKeeper()
    throws IOException, InterruptedException {
  ZooKeeper zk = new ZooKeeper(zkHostPort, zkSessionTimeout, null);
  zk.register(new ForwardingWatcher(zk));
  return zk;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:ZKRMStateStore.java

示例15: getCurrentKey

import org.apache.hadoop.classification.InterfaceAudience.Private; //导入依赖的package包/类
@Private
public MasterKey getCurrentKey() {
  this.readLock.lock();
  try {
    return this.currentMasterKey.getMasterKey();
  } finally {
    this.readLock.unlock();
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:10,代码来源:BaseNMTokenSecretManager.java


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