Package org.springframework.yarn.listener

Examples of org.springframework.yarn.listener.ContainerStateListener


    }

    // use latch if container wants to be long running
    if (bean instanceof LongRunningYarnContainer && ((LongRunningYarnContainer)bean).isWaitCompleteState()) {
      latch = new CountDownLatch(1);
      ((LongRunningYarnContainer)bean).addContainerStateListener(new ContainerStateListener() {
        @Override
        public void state(ContainerState state, Object exit) {
          stateWrapper.state = state;
          // TODO: should handle exit value
          latch.countDown();
View Full Code Here


    // use latch if container wants to be long running
    if (container instanceof LongRunningYarnContainer && ((LongRunningYarnContainer)container).isWaitCompleteState()) {
      log.info("Container requested that we wait state, setting up latch");
      latch = new CountDownLatch(1);
      ((LongRunningYarnContainer)container).addContainerStateListener(new ContainerStateListener() {
        @Override
        public void state(ContainerState state, Object exit) {
          if (log.isDebugEnabled()) {
            log.debug("Got state ContainerState=" + state + " and exit=" + exit);
          }
View Full Code Here

    @SuppressWarnings("resource")
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(BaseConfig.class, TestBean1Config.class);
    DefaultYarnContainer container = context.getBean(DefaultYarnContainer.class);
    final StateWrapper stateWrapper = new StateWrapper();

    container.addContainerStateListener(new ContainerStateListener() {
      @Override
      public void state(ContainerState state, Object exit) {
        stateWrapper.state = state;
        stateWrapper.exit = exit;
      }
View Full Code Here

    @SuppressWarnings("resource")
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(BaseConfig.class, TestBean2Config.class);
    DefaultYarnContainer container = context.getBean(DefaultYarnContainer.class);
    final StateWrapper stateWrapper = new StateWrapper();

    container.addContainerStateListener(new ContainerStateListener() {
      @Override
      public void state(ContainerState state, Object exit) {
        stateWrapper.state = state;
        stateWrapper.exit = exit;
      }
View Full Code Here

    @SuppressWarnings("resource")
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(BaseConfig.class, TestBean3Config.class);
    DefaultYarnContainer container = context.getBean(DefaultYarnContainer.class);
    final StateWrapper stateWrapper = new StateWrapper();

    container.addContainerStateListener(new ContainerStateListener() {
      @Override
      public void state(ContainerState state, Object exit) {
        stateWrapper.state = state;
        stateWrapper.exit = exit;
      }
View Full Code Here

    @SuppressWarnings("resource")
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(BaseConfig.class, TestBean4Config.class);
    DefaultYarnContainer container = context.getBean(DefaultYarnContainer.class);
    final StateWrapper stateWrapper = new StateWrapper();

    container.addContainerStateListener(new ContainerStateListener() {
      @Override
      public void state(ContainerState state, Object exit) {
        stateWrapper.state = state;
        stateWrapper.exit = exit;
      }
View Full Code Here

    @SuppressWarnings("resource")
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(BaseConfig.class, TestBean5Config.class);
    DefaultYarnContainer container = context.getBean(DefaultYarnContainer.class);
    final StateWrapper stateWrapper = new StateWrapper();

    container.addContainerStateListener(new ContainerStateListener() {
      @Override
      public void state(ContainerState state, Object exit) {
        stateWrapper.state = state;
        stateWrapper.exit = exit;
      }
View Full Code Here

    @SuppressWarnings("resource")
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(BaseConfig.class, TestBean6Config.class);
    DefaultYarnContainer container = context.getBean(DefaultYarnContainer.class);
    final StateWrapper stateWrapper = new StateWrapper();

    container.addContainerStateListener(new ContainerStateListener() {
      @Override
      public void state(ContainerState state, Object exit) {
        stateWrapper.state = state;
        stateWrapper.exit = exit;
      }
View Full Code Here

TOP

Related Classes of org.springframework.yarn.listener.ContainerStateListener

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.