Search in sources :

Example 11 with AggregateAppResourceUsage

use of org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AggregateAppResourceUsage in project hadoop by apache.

the class RMStateStore method storeNewApplicationAttempt.

@SuppressWarnings("unchecked")
public /**
   * Non-blocking API
   * ResourceManager services call this to store state on an application attempt
   * This does not block the dispatcher threads
   * RMAppAttemptStoredEvent will be sent on completion to notify the RMAppAttempt
   */
void storeNewApplicationAttempt(RMAppAttempt appAttempt) {
    Credentials credentials = getCredentialsFromAppAttempt(appAttempt);
    RMAppAttemptMetrics attempMetrics = appAttempt.getRMAppAttemptMetrics();
    AggregateAppResourceUsage resUsage = attempMetrics.getAggregateAppResourceUsage();
    ApplicationAttemptStateData attemptState = ApplicationAttemptStateData.newInstance(appAttempt.getAppAttemptId(), appAttempt.getMasterContainer(), credentials, appAttempt.getStartTime(), resUsage.getMemorySeconds(), resUsage.getVcoreSeconds(), attempMetrics.getPreemptedMemory(), attempMetrics.getPreemptedVcore());
    getRMStateStoreEventHandler().handle(new RMStateStoreAppAttemptEvent(attemptState));
}
Also used : RMAppAttemptMetrics(org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptMetrics) ApplicationAttemptStateData(org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData) Credentials(org.apache.hadoop.security.Credentials) AggregateAppResourceUsage(org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AggregateAppResourceUsage)

Aggregations

AggregateAppResourceUsage (org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.AggregateAppResourceUsage)11 RMAppAttempt (org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttempt)7 RMApp (org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMApp)5 RMAppAttemptMetrics (org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptMetrics)5 Container (org.apache.hadoop.yarn.api.records.Container)4 Resource (org.apache.hadoop.yarn.api.records.Resource)4 RMContainer (org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.RMContainer)4 ApplicationAttemptId (org.apache.hadoop.yarn.api.records.ApplicationAttemptId)3 ContainerId (org.apache.hadoop.yarn.api.records.ContainerId)3 ApplicationAttemptStateData (org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationAttemptStateData)3 RMAppMetrics (org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppMetrics)3 Test (org.junit.Test)3 ArrayList (java.util.ArrayList)2 SecretKey (javax.crypto.SecretKey)2 ApplicationSubmissionContext (org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext)2 ResourceRequest (org.apache.hadoop.yarn.api.records.ResourceRequest)2 ApplicationSubmissionContextPBImpl (org.apache.hadoop.yarn.api.records.impl.pb.ApplicationSubmissionContextPBImpl)2 ContainerPBImpl (org.apache.hadoop.yarn.api.records.impl.pb.ContainerPBImpl)2 ApplicationStateData (org.apache.hadoop.yarn.server.resourcemanager.recovery.records.ApplicationStateData)2 ClientToAMTokenSecretManagerInRM (org.apache.hadoop.yarn.server.resourcemanager.security.ClientToAMTokenSecretManagerInRM)2