Package org.apache.twill.api

Examples of org.apache.twill.api.TwillController.stop()


      }
    }, Threads.SAME_THREAD_EXECUTOR);

    Assert.assertTrue(running.await(30, TimeUnit.SECONDS));
    Assert.assertTrue(waitForDebugPort(controller, "r1", 30));
    controller.stop().get(30, TimeUnit.SECONDS);
    // Sleep a bit before exiting.
    TimeUnit.SECONDS.sleep(2);
  }

  @Test
View Full Code Here


    }, Threads.SAME_THREAD_EXECUTOR);

    Assert.assertTrue(running.await(30, TimeUnit.SECONDS));
    Assert.assertTrue(waitForDebugPort(controller, "r1", 30));
    Assert.assertTrue(waitForDebugPort(controller, "r2", 30));
    controller.stop().get(30, TimeUnit.SECONDS);
    // Sleep a bit before exiting.
    TimeUnit.SECONDS.sleep(2);
  }
}
View Full Code Here

      } finally {
        socket.close();
      }
    }

    controller.stop().get(30, TimeUnit.SECONDS);
    // Sleep a bit before exiting.
    TimeUnit.SECONDS.sleep(2);
  }

  @Test
View Full Code Here

      count++;
      TimeUnit.SECONDS.sleep(1);
    }
    Assert.assertTrue("Still has 2 contains running after 20 seconds", count < 20);

    controller.stop().get(30, TimeUnit.SECONDS);
    // Sleep a bit before exiting.
    TimeUnit.SECONDS.sleep(2);
  }

  @Test
View Full Code Here

    // TODO: check cores after hadoop-2.1.0
    for (TwillRunResources resources : echo2Resources) {
      Assert.assertEquals(256, resources.getMemoryMB());
    }

    controller.stop().get(30, TimeUnit.SECONDS);
    // Sleep a bit before exiting.
    TimeUnit.SECONDS.sleep(2);
  }
}
View Full Code Here

      Service service = createService(zkClientService, runId);
      service.startAndWait();

      TwillController controller = getController(zkClientService, runId);
      controller.sendCommand(Command.Builder.of("test").build()).get(2, TimeUnit.SECONDS);
      controller.stop().get(2, TimeUnit.SECONDS);

      Assert.assertEquals(ServiceController.State.TERMINATED, controller.state());

      final CountDownLatch terminateLatch = new CountDownLatch(1);
      service.addListener(new ServiceListenerAdapter() {
View Full Code Here

      Service service = createService(zkClientService, runId);
      service.startAndWait();

      TwillController controller = getController(zkClientService, runId);
      controller.sendCommand(Command.Builder.of("test").build()).get(2, TimeUnit.SECONDS);
      controller.stop().get(2, TimeUnit.SECONDS);

      Assert.assertEquals(ServiceController.State.TERMINATED, controller.state());

      final CountDownLatch terminateLatch = new CountDownLatch(1);
      service.addListener(new ServiceListenerAdapter() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.