Package co.cask.cdap.app.runtime

Examples of co.cask.cdap.app.runtime.ProgramController.addListener()


        runtimeService.run(program, new SimpleProgramOptions(id.getId(), new BasicArguments(), userArguments, debug));

      ProgramController controller = runtimeInfo.getController();
      final String runId = controller.getRunId().getId();

      controller.addListener(new AbstractListener() {
        @Override
        public void stopped() {
          store.setStop(id, runId,
                        TimeUnit.SECONDS.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS),
                        ProgramController.State.STOPPED.toString());
View Full Code Here


                   TimeUnit.SECONDS.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS));

    final Id.Program programId = program.getId();
    final String runId = controller.getRunId().getId();
    final CountDownLatch latch = new CountDownLatch(1);
    controller.addListener(new AbstractListener() {
      @Override
      public void stopped() {
        store.setStop(programId, runId,
                      TimeUnit.SECONDS.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS),
                      ProgramController.State.STOPPED.toString());
View Full Code Here

    final MapReduceContext context = (controller instanceof MapReduceProgramController)
                                        ? ((MapReduceProgramController) controller).getContext()
                                        : null;
    // Execute the program.
    final SettableFuture<MapReduceContext> completion = SettableFuture.create();
    controller.addListener(new AbstractListener() {
      @Override
      public void stopped() {
        completion.set(context);
      }
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.