Package org.apache.hadoop.yarn.server.resourcemanager.recovery

Examples of org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore


          containerAllocationExpirer, amLivelinessMonitor, amFinishingMonitor,
          null, new ApplicationTokenSecretManager(conf),
          new RMContainerTokenSecretManager(conf),
          new ClientToAMTokenSecretManagerInRM());
   
    RMStateStore store = mock(RMStateStore.class);
    ((RMContextImpl) rmContext).setStateStore(store);
   
    scheduler = mock(YarnScheduler.class);
    masterService = mock(ApplicationMasterService.class);
    applicationMasterLauncher = mock(ApplicationMasterLauncher.class);
View Full Code Here


      shutdown.notifyAll();
    }*/

    DefaultMetricsSystem.shutdown();

    RMStateStore store = rmContext.getStateStore();
    try {
      store.close();
    } catch (Exception e) {
      LOG.error("Error closing store.", e);
    }
     
    super.stop();
View Full Code Here

  private static RecordFactory recordFactory = RecordFactoryProvider
      .getRecordFactory(conf);

  @BeforeClass
  public static void setup() throws InterruptedException, IOException {
    RMStateStore store = RMStateStoreFactory.getStore(conf);
    conf.setBoolean(YarnConfiguration.YARN_ACL_ENABLE, true);
    AccessControlList adminACL = new AccessControlList("");
    adminACL.addGroup(SUPER_GROUP);
    conf.set(YarnConfiguration.YARN_ADMIN_ACL, adminACL.getAclString());
    resourceManager = new MockRM(conf) {
View Full Code Here

          assert (amContainerAllocation.getContainers().size() == 0);
        }
        return RMAppAttemptState.SCHEDULED;
      } else {
        // RM not allocating container. AM is self launched.
        RMStateStore store = appAttempt.rmContext.getStateStore();
        // save state and then go to LAUNCHED state
        appAttempt.storeAttempt(store);
        return RMAppAttemptState.LAUNCHED_UNMANAGED_SAVING;
      }
    }
View Full Code Here

      // Set the masterContainer
      appAttempt.setMasterContainer(amContainerAllocation.getContainers().get(
                                                                           0));

      RMStateStore store = appAttempt.rmContext.getStateStore();
      appAttempt.storeAttempt(store);
    }
View Full Code Here

          .currentTimeMillis()));
     
      // If recovery is enabled then store the application information in a
      // blocking call so make sure that RM has stored the information needed
      // to restart the AM after RM restart without further client communication
      RMStateStore stateStore = rmContext.getStateStore();
      LOG.info("Storing Application with id " + applicationId);
      try {
        stateStore.storeApplication(rmContext.getRMApps().get(applicationId));
      } catch (Exception e) {
        // For HA this exception needs to be handled by giving up
        // master status if we got fenced
        LOG.error("Failed to store application:" + applicationId, e);
        ExitUtil.terminate(1, e);
View Full Code Here

      break;
    default:
      break;
    }

    RMStateStore rmStore = rmContext.getStateStore();
    ApplicationAttemptState attemptState =
        new ApplicationAttemptState(applicationAttemptId, getMasterContainer(),
          rmStore.getCredentialsFromAppAttempt(this), startTime,
          stateToBeStored, finalTrackingUrl, diags, finalStatus);
    LOG.info("Updating application attempt " + applicationAttemptId
        + " with final state: " + targetedFinalState);
    rmStore.updateApplicationAttemptState(attemptState);
  }
View Full Code Here

    this.setContainerTokenSecretManager(containerTokenSecretManager);
    this.setNMTokenSecretManager(nmTokenSecretManager);
    this.setClientToAMTokenSecretManager(clientToAMTokenSecretManager);
    this.setRMApplicationHistoryWriter(rmApplicationHistoryWriter);

    RMStateStore nullStore = new NullRMStateStore();
    nullStore.setRMDispatcher(rmDispatcher);
    try {
      nullStore.init(new YarnConfiguration());
      setStateStore(nullStore);
    } catch (Exception e) {
      assert false;
    }
View Full Code Here

      boolean isRecoveryEnabled = conf.getBoolean(
          YarnConfiguration.RECOVERY_ENABLED,
          YarnConfiguration.DEFAULT_RM_RECOVERY_ENABLED);

      RMStateStore rmStore = null;
      if(isRecoveryEnabled) {
        recoveryEnabled = true;
        rmStore =  RMStateStoreFactory.getStore(conf);
      } else {
        recoveryEnabled = false;
        rmStore = new NullRMStateStore();
      }

      try {
        rmStore.init(conf);
        rmStore.setRMDispatcher(rmDispatcher);
      } catch (Exception e) {
        // the Exception from stateStore.init() needs to be handled for
        // HA and we need to give up master status if we got fenced
        LOG.error("Failed to init state store", e);
        throw e;
View Full Code Here

      super.serviceInit(conf);
    }

    @Override
    protected void serviceStart() throws Exception {
      RMStateStore rmStore = rmContext.getStateStore();
      // The state store needs to start irrespective of recoveryEnabled as apps
      // need events to move to further states.
      rmStore.start();

      if(recoveryEnabled) {
        try {
          rmStore.checkVersion();
          RMState state = rmStore.loadState();
          recover(state);
        } catch (Exception e) {
          // the Exception from loadState() needs to be handled for
          // HA and we need to give up master status if we got fenced
          LOG.error("Failed to load/recover state", e);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.