本文整理汇总了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));
}
}
示例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;
}
示例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);
}
}
示例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;
}
示例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();
}
}
示例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;
}
示例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();
}
}
示例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()));
}
示例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);
}
示例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);
}
示例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;
}
示例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");
}
示例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;
}
示例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;
}
示例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();
}
}