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

The following examples show how to use org.apache.hadoop.yarn.server.applicationhistoryservice.MemoryApplicationHistoryStore. 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: 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 2
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 3
@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 4
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 5
Source Project: hadoop   Source File: TestAHSWebApp.java    License: Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
  store = new MemoryApplicationHistoryStore();
}
 
Example 6
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 7
Source Project: big-c   Source File: TestAHSWebApp.java    License: Apache License 2.0 4 votes vote down vote up
@Before
public void setup() {
  store = new MemoryApplicationHistoryStore();
}