Tabnine Logo
RMAppAttemptRegistrationEvent
Code IndexAdd Tabnine to your IDE (free)

How to use
RMAppAttemptRegistrationEvent
in
org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event

Best Java code snippets using org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.event.RMAppAttemptRegistrationEvent (Showing top 12 results out of 315)

origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

private void runApplicationAttempt(Container container,
  String host, 
  int rpcPort, 
  String trackingUrl, boolean unmanagedAM) {
 applicationAttempt.handle(
   new RMAppAttemptRegistrationEvent(
     applicationAttempt.getAppAttemptId(),
     host, rpcPort, trackingUrl));
 
 testAppAttemptRunningState(container, host, rpcPort, trackingUrl, 
   unmanagedAM);
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

 @Override
 public void transition(RMAppAttemptImpl appAttempt,
   RMAppAttemptEvent event) {
  long delay = System.currentTimeMillis() - appAttempt.launchAMEndTime;
  ClusterMetrics.getMetrics().addAMRegisterDelay(delay);
  RMAppAttemptRegistrationEvent registrationEvent
    = (RMAppAttemptRegistrationEvent) event;
  appAttempt.host = registrationEvent.getHost();
  appAttempt.rpcPort = registrationEvent.getRpcport();
  appAttempt.originalTrackingUrl =
    sanitizeTrackingUrl(registrationEvent.getTrackingurl());
  // Let the app know
  appAttempt.eventHandler.handle(new RMAppEvent(appAttempt
    .getAppAttemptId().getApplicationId(),
    RMAppEventType.ATTEMPT_REGISTERED));
  // TODO:FIXME: Note for future. Unfortunately we only do a state-store
  // write at AM launch time, so we don't save the AM's tracking URL anywhere
  // as that would mean an extra state-store write. For now, we hope that in
  // work-preserving restart, AMs are forced to reregister.
  appAttempt.rmContext.getRMApplicationHistoryWriter()
    .applicationAttemptStarted(appAttempt);
  appAttempt.rmContext.getSystemMetricsPublisher()
    .appAttemptRegistered(appAttempt, System.currentTimeMillis());
 }
}
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

 @Override
 public void transition(RMAppAttemptImpl appAttempt,
   RMAppAttemptEvent event) {
  long delay = System.currentTimeMillis() - appAttempt.launchAMEndTime;
  ClusterMetrics.getMetrics().addAMRegisterDelay(delay);
  RMAppAttemptRegistrationEvent registrationEvent
    = (RMAppAttemptRegistrationEvent) event;
  appAttempt.host = registrationEvent.getHost();
  appAttempt.rpcPort = registrationEvent.getRpcport();
  appAttempt.originalTrackingUrl =
    sanitizeTrackingUrl(registrationEvent.getTrackingurl());
  // Let the app know
  appAttempt.eventHandler.handle(new RMAppEvent(appAttempt
    .getAppAttemptId().getApplicationId(),
    RMAppEventType.ATTEMPT_REGISTERED));
  // TODO:FIXME: Note for future. Unfortunately we only do a state-store
  // write at AM launch time, so we don't save the AM's tracking URL anywhere
  // as that would mean an extra state-store write. For now, we hope that in
  // work-preserving restart, AMs are forced to reregister.
  appAttempt.rmContext.getRMApplicationHistoryWriter()
    .applicationAttemptStarted(appAttempt);
  appAttempt.rmContext.getSystemMetricsPublisher()
    .appAttemptRegistered(appAttempt, System.currentTimeMillis());
 }
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

private void runApplicationAttempt(Container container,
  String host, 
  int rpcPort, 
  String trackingUrl, boolean unmanagedAM) {
 applicationAttempt.handle(
   new RMAppAttemptRegistrationEvent(
     applicationAttempt.getAppAttemptId(),
     host, rpcPort, trackingUrl));
 
 testAppAttemptRunningState(container, host, rpcPort, trackingUrl, 
   unmanagedAM);
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

RMAppAttemptRegistrationEvent registrationEvent
  = (RMAppAttemptRegistrationEvent) event;
appAttempt.host = StringInterner.weakIntern(registrationEvent.getHost());
appAttempt.rpcPort = registrationEvent.getRpcport();
appAttempt.originalTrackingUrl =
  sanitizeTrackingUrl(registrationEvent.getTrackingurl());
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testUnmanagedAMContainersCleanup() {
 unmanagedAM = true;
 when(submissionContext.getUnmanagedAM()).thenReturn(true);
 when(submissionContext.getKeepContainersAcrossApplicationAttempts())
  .thenReturn(true);
 // submit AM and check it goes to SUBMITTED state
 submitApplicationAttempt();
 // launch AM and verify attempt failed
 applicationAttempt.handle(new RMAppAttemptRegistrationEvent(
  applicationAttempt.getAppAttemptId(), "host", 8042, "oldtrackingurl"));
 assertEquals(YarnApplicationAttemptState.SUBMITTED,
   applicationAttempt.createApplicationAttemptState());
 sendAttemptUpdateSavedEvent(applicationAttempt);
 assertFalse(transferStateFromPreviousAttempt);
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testUnmanagedAMContainersCleanup() {
 unmanagedAM = true;
 when(submissionContext.getUnmanagedAM()).thenReturn(true);
 when(submissionContext.getKeepContainersAcrossApplicationAttempts())
  .thenReturn(true);
 // submit AM and check it goes to SUBMITTED state
 submitApplicationAttempt();
 // launch AM and verify attempt failed
 applicationAttempt.handle(new RMAppAttemptRegistrationEvent(
  applicationAttempt.getAppAttemptId(), "host", 8042, "oldtrackingurl"));
 assertEquals(YarnApplicationAttemptState.SUBMITTED,
   applicationAttempt.createApplicationAttemptState());
 sendAttemptUpdateSavedEvent(applicationAttempt);
 assertFalse(transferStateFromPreviousAttempt);
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testUnmanagedAMUnexpectedRegistration() {
 unmanagedAM = true;
 when(submissionContext.getUnmanagedAM()).thenReturn(true);
 // submit AM and check it goes to SUBMITTED state
 submitApplicationAttempt();
 assertEquals(RMAppAttemptState.SUBMITTED,
   applicationAttempt.getAppAttemptState());
 // launch AM and verify attempt failed
 applicationAttempt.handle(new RMAppAttemptRegistrationEvent(
   applicationAttempt.getAppAttemptId(), "host", 8042, "oldtrackingurl"));
 assertEquals(YarnApplicationAttemptState.SUBMITTED,
   applicationAttempt.createApplicationAttemptState());
 testAppAttemptSubmittedToFailedState(
   "Unmanaged AM must register after AM attempt reaches LAUNCHED state.");
}
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

@Test
public void testUnmanagedAMUnexpectedRegistration() {
 unmanagedAM = true;
 when(submissionContext.getUnmanagedAM()).thenReturn(true);
 // submit AM and check it goes to SUBMITTED state
 submitApplicationAttempt();
 assertEquals(RMAppAttemptState.SUBMITTED,
   applicationAttempt.getAppAttemptState());
 // launch AM and verify attempt failed
 applicationAttempt.handle(new RMAppAttemptRegistrationEvent(
   applicationAttempt.getAppAttemptId(), "host", 8042, "oldtrackingurl"));
 assertEquals(YarnApplicationAttemptState.SUBMITTED,
   applicationAttempt.createApplicationAttemptState());
 testAppAttemptSubmittedToFailedState(
   "Unmanaged AM must register after AM attempt reaches LAUNCHED state.");
}
origin: ch.cern.hadoop/hadoop-yarn-server-resourcemanager

 .getEventHandler()
 .handle(
  new RMAppAttemptRegistrationEvent(applicationAttemptId, request
   .getHost(), request.getRpcPort(), request.getTrackingUrl()));
RMAuditLogger.logSuccess(app.getUser(), AuditConstants.REGISTER_AM,
origin: com.github.jiayuhan-it/hadoop-yarn-server-resourcemanager

 .getEventHandler()
 .handle(
  new RMAppAttemptRegistrationEvent(applicationAttemptId, request
   .getHost(), request.getRpcPort(), request.getTrackingUrl()));
RMAuditLogger.logSuccess(app.getUser(), AuditConstants.REGISTER_AM,
origin: org.apache.hadoop/hadoop-yarn-server-resourcemanager

getRmContext().getDispatcher().getEventHandler()
  .handle(
    new RMAppAttemptRegistrationEvent(applicationAttemptId, request
      .getHost(), request.getRpcPort(), request.getTrackingUrl()));
RMAuditLogger.logSuccess(app.getUser(),
org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.eventRMAppAttemptRegistrationEvent

Most used methods

  • <init>
  • getHost
  • getRpcport
  • getTrackingurl

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • getContentResolver (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • JButton (javax.swing)
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Table (org.hibernate.mapping)
    A relational table
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now