Java Code Examples for org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryStore

The following examples show how to use org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryStore. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: hadoop   Source File: RMApplicationHistoryWriter.java    License: Apache License 2.0 6 votes vote down vote up
protected ApplicationHistoryStore createApplicationHistoryStore(
    Configuration conf) {
  try {
    Class<? extends ApplicationHistoryStore> storeClass =
        conf.getClass(YarnConfiguration.APPLICATION_HISTORY_STORE,
            NullApplicationHistoryStore.class,
            ApplicationHistoryStore.class);
    return storeClass.newInstance();
  } catch (Exception e) {
    String msg =
        "Could not instantiate ApplicationHistoryWriter: "
            + conf.get(YarnConfiguration.APPLICATION_HISTORY_STORE,
                NullApplicationHistoryStore.class.getName());
    LOG.error(msg, e);
    throw new YarnRuntimeException(msg, e);
  }
}
 
Example 2
Source Project: big-c   Source File: RMApplicationHistoryWriter.java    License: Apache License 2.0 6 votes vote down vote up
protected ApplicationHistoryStore createApplicationHistoryStore(
    Configuration conf) {
  try {
    Class<? extends ApplicationHistoryStore> storeClass =
        conf.getClass(YarnConfiguration.APPLICATION_HISTORY_STORE,
            NullApplicationHistoryStore.class,
            ApplicationHistoryStore.class);
    return storeClass.newInstance();
  } catch (Exception e) {
    String msg =
        "Could not instantiate ApplicationHistoryWriter: "
            + conf.get(YarnConfiguration.APPLICATION_HISTORY_STORE,
                NullApplicationHistoryStore.class.getName());
    LOG.error(msg, e);
    throw new YarnRuntimeException(msg, e);
  }
}
 
Example 3
Source Project: hadoop   Source File: MiniYARNCluster.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected synchronized void serviceInit(Configuration conf)
    throws Exception {
  appHistoryServer = new ApplicationHistoryServer();
  conf.setClass(YarnConfiguration.APPLICATION_HISTORY_STORE,
      MemoryApplicationHistoryStore.class, ApplicationHistoryStore.class);
  conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STORE,
      MemoryTimelineStore.class, TimelineStore.class);
  conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STATE_STORE_CLASS,
      MemoryTimelineStateStore.class, TimelineStateStore.class);
  appHistoryServer.init(conf);
  super.serviceInit(conf);
}
 
Example 4
Source Project: big-c   Source File: MiniYARNCluster.java    License: Apache License 2.0 5 votes vote down vote up
@Override
protected synchronized void serviceInit(Configuration conf)
    throws Exception {
  appHistoryServer = new ApplicationHistoryServer();
  conf.setClass(YarnConfiguration.APPLICATION_HISTORY_STORE,
      MemoryApplicationHistoryStore.class, ApplicationHistoryStore.class);
  conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STORE,
      MemoryTimelineStore.class, TimelineStore.class);
  conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STATE_STORE_CLASS,
      MemoryTimelineStateStore.class, TimelineStateStore.class);
  appHistoryServer.init(conf);
  super.serviceInit(conf);
}
 
Example 5
@Override
protected synchronized void serviceInit(Configuration conf)
    throws Exception {
    appHistoryServer = new ApplicationHistoryServer();
    conf.setClass(YarnConfiguration.APPLICATION_HISTORY_STORE,
                  MemoryApplicationHistoryStore.class, ApplicationHistoryStore.class);
    conf.setClass(YarnConfiguration.TIMELINE_SERVICE_STORE,
                  MemoryTimelineStore.class, TimelineStore.class);
    appHistoryServer.init(conf);
    super.serviceInit(conf);
}
 
Example 6
Source Project: hadoop   Source File: TestRMApplicationHistoryWriter.java    License: Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
  store = new MemoryApplicationHistoryStore();
  Configuration conf = new Configuration();
  conf.setBoolean(YarnConfiguration.APPLICATION_HISTORY_ENABLED, true);
  conf.setClass(YarnConfiguration.APPLICATION_HISTORY_STORE,
      MemoryApplicationHistoryStore.class, ApplicationHistoryStore.class);
  writer = new RMApplicationHistoryWriter() {

    @Override
    protected ApplicationHistoryStore createApplicationHistoryStore(
        Configuration conf) {
      return store;
    }

    @Override
    protected Dispatcher createDispatcher(Configuration conf) {
      MultiThreadedDispatcher dispatcher =
          new MultiThreadedDispatcher(
            conf
              .getInt(
                YarnConfiguration.RM_HISTORY_WRITER_MULTI_THREADED_DISPATCHER_POOL_SIZE,
                YarnConfiguration.DEFAULT_RM_HISTORY_WRITER_MULTI_THREADED_DISPATCHER_POOL_SIZE));
      dispatcher.setDrainEventsOnStop();
      return dispatcher;
    }

    class MultiThreadedDispatcher extends
        RMApplicationHistoryWriter.MultiThreadedDispatcher {

      public MultiThreadedDispatcher(int num) {
        super(num);
      }

      @Override
      protected AsyncDispatcher createDispatcher() {
        CounterDispatcher dispatcher = new CounterDispatcher();
        dispatchers.add(dispatcher);
        return dispatcher;
      }

    }
  };
  writer.init(conf);
  writer.start();
}
 
Example 7
Source Project: hadoop   Source File: TestAHSWebApp.java    License: Apache License 2.0 4 votes vote down vote up
public void setApplicationHistoryStore(ApplicationHistoryStore store) {
  this.store = store;
}
 
Example 8
Source Project: hadoop   Source File: TestAHSWebApp.java    License: Apache License 2.0 4 votes vote down vote up
public MockApplicationHistoryManagerImpl(ApplicationHistoryStore store) {
  super();
  init(new YarnConfiguration());
  start();
}
 
Example 9
Source Project: hadoop   Source File: TestAHSWebApp.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ApplicationHistoryStore createApplicationHistoryStore(
    Configuration conf) {
  return store;
}
 
Example 10
Source Project: big-c   Source File: TestRMApplicationHistoryWriter.java    License: Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
  store = new MemoryApplicationHistoryStore();
  Configuration conf = new Configuration();
  conf.setBoolean(YarnConfiguration.APPLICATION_HISTORY_ENABLED, true);
  conf.setClass(YarnConfiguration.APPLICATION_HISTORY_STORE,
      MemoryApplicationHistoryStore.class, ApplicationHistoryStore.class);
  writer = new RMApplicationHistoryWriter() {

    @Override
    protected ApplicationHistoryStore createApplicationHistoryStore(
        Configuration conf) {
      return store;
    }

    @Override
    protected Dispatcher createDispatcher(Configuration conf) {
      MultiThreadedDispatcher dispatcher =
          new MultiThreadedDispatcher(
            conf
              .getInt(
                YarnConfiguration.RM_HISTORY_WRITER_MULTI_THREADED_DISPATCHER_POOL_SIZE,
                YarnConfiguration.DEFAULT_RM_HISTORY_WRITER_MULTI_THREADED_DISPATCHER_POOL_SIZE));
      dispatcher.setDrainEventsOnStop();
      return dispatcher;
    }

    class MultiThreadedDispatcher extends
        RMApplicationHistoryWriter.MultiThreadedDispatcher {

      public MultiThreadedDispatcher(int num) {
        super(num);
      }

      @Override
      protected AsyncDispatcher createDispatcher() {
        CounterDispatcher dispatcher = new CounterDispatcher();
        dispatchers.add(dispatcher);
        return dispatcher;
      }

    }
  };
  writer.init(conf);
  writer.start();
}
 
Example 11
Source Project: big-c   Source File: TestAHSWebApp.java    License: Apache License 2.0 4 votes vote down vote up
public void setApplicationHistoryStore(ApplicationHistoryStore store) {
  this.store = store;
}
 
Example 12
Source Project: big-c   Source File: TestAHSWebApp.java    License: Apache License 2.0 4 votes vote down vote up
public MockApplicationHistoryManagerImpl(ApplicationHistoryStore store) {
  super();
  init(new YarnConfiguration());
  start();
}
 
Example 13
Source Project: big-c   Source File: TestAHSWebApp.java    License: Apache License 2.0 4 votes vote down vote up
@Override
protected ApplicationHistoryStore createApplicationHistoryStore(
    Configuration conf) {
  return store;
}