use of org.apache.hadoop.classification.InterfaceAudience.Private in project hadoop by apache.
the class AMLauncher method setupTokens.
@Private
@VisibleForTesting
protected void setupTokens(ContainerLaunchContext container, ContainerId containerID) throws IOException {
Map<String, String> environment = container.getEnvironment();
environment.put(ApplicationConstants.APPLICATION_WEB_PROXY_BASE_ENV, application.getWebProxyBase());
// Set AppSubmitTime to be consumable by the AM.
ApplicationId applicationId = application.getAppAttemptId().getApplicationId();
environment.put(ApplicationConstants.APP_SUBMIT_TIME_ENV, String.valueOf(rmContext.getRMApps().get(applicationId).getSubmitTime()));
Credentials credentials = new Credentials();
DataInputByteBuffer dibb = new DataInputByteBuffer();
ByteBuffer tokens = container.getTokens();
if (tokens != null) {
// TODO: Don't do this kind of checks everywhere.
dibb.reset(tokens);
credentials.readTokenStorageStream(dibb);
tokens.rewind();
}
// Add AMRMToken
Token<AMRMTokenIdentifier> amrmToken = createAndSetAMRMToken();
if (amrmToken != null) {
credentials.addToken(amrmToken.getService(), amrmToken);
}
DataOutputBuffer dob = new DataOutputBuffer();
credentials.writeTokenStorageToStream(dob);
container.setTokens(ByteBuffer.wrap(dob.getData(), 0, dob.getLength()));
}
use of org.apache.hadoop.classification.InterfaceAudience.Private in project hadoop by apache.
the class DefaultWrapperServlet method doGet.
@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);
}
use of org.apache.hadoop.classification.InterfaceAudience.Private in project hadoop by apache.
the class AMRMProxyApplicationContextImpl method getLocalAMRMTokenKeyId.
@Private
public synchronized int getLocalAMRMTokenKeyId() {
Integer keyId = this.localTokenKeyId;
if (keyId == null) {
try {
if (this.localToken == null) {
throw new YarnRuntimeException("Missing AMRM token for " + this.applicationAttemptId);
}
keyId = this.localToken.decodeIdentifier().getKeyId();
this.localTokenKeyId = keyId;
} catch (IOException e) {
throw new YarnRuntimeException("AMRM token decode error for " + this.applicationAttemptId, e);
}
}
return keyId;
}
use of org.apache.hadoop.classification.InterfaceAudience.Private in project hadoop by apache.
the class LeafQueue method getNumActiveApplications.
@Private
public int getNumActiveApplications(String user) {
try {
readLock.lock();
User u = getUser(user);
if (null == u) {
return 0;
}
return u.getActiveApplications();
} finally {
readLock.unlock();
}
}
use of org.apache.hadoop.classification.InterfaceAudience.Private in project hadoop by apache.
the class CapacitySchedulerConfiguration method getQueuePriority.
@Private
public Priority getQueuePriority(String queue) {
String queuePolicyPrefix = getQueuePrefix(queue);
Priority pri = Priority.newInstance(getInt(queuePolicyPrefix + "priority", 0));
return pri;
}
Aggregations