Examples of stopAndWait()


Examples of org.apache.twill.internal.TwillContainerController.stopAndWait()

      Preconditions.checkState(lastContainerId != null,
                               "No container found for {} with instanceId = {}", runnableName, maxInstanceId);

      LOG.info("Stopping service: {} {}", runnableName, lastController.getRunId());
      lastController.stopAndWait();
      containers.remove(runnableName, lastContainerId);
      removeInstanceId(runnableName, maxInstanceId);
      resourceReport.removeRunnableResources(runnableName, lastContainerId);
      containerChange.signalAll();
    } finally {
View Full Code Here

Examples of org.apache.twill.internal.TwillContainerController.stopAndWait()

      Preconditions.checkState(lastContainerId != null,
                               "No container found for {} with instanceId = {}", runnableName, maxInstanceId);

      LOG.info("Stopping service: {} {}", runnableName, lastController.getRunId());
      lastController.stopAndWait();
      containers.remove(runnableName, lastContainerId);
      removeInstanceId(runnableName, maxInstanceId);
      resourceReport.removeRunnableResources(runnableName, lastContainerId);
      containerChange.signalAll();
    } finally {
View Full Code Here

Examples of org.apache.twill.internal.kafka.EmbeddedKafkaServer.stopAndWait()

    // Should receive one message
    Assert.assertEquals("Message 0", consumedMessages.poll(5, TimeUnit.SECONDS));

    // Now shutdown and restart the server on different port
    server.stopAndWait();
    server = new EmbeddedKafkaServer(generateKafkaConfig(connectionStr, logDir));
    server.startAndWait();

    // Wait a little while to make sure changes is reflected in broker service
    TimeUnit.SECONDS.sleep(3);
View Full Code Here

Examples of org.apache.twill.internal.kafka.EmbeddedKafkaServer.stopAndWait()

    publisher.prepare("test").add(Charsets.UTF_8.encode("Message 1"), 0).send().get();
    Assert.assertEquals("Message 1", consumedMessages.poll(5, TimeUnit.SECONDS));

    kafkaClient.stopAndWait();
    zkClient.stopAndWait();
    server.stopAndWait();
  }

  private Thread createPublishThread(final KafkaClient kafkaClient, final String topic,
                                     final Compression compression, final String message, final int count) {
    return createPublishThread(kafkaClient, topic, compression, message, count, 0);
View Full Code Here

Examples of org.apache.twill.internal.kafka.client.ZKKafkaClientService.stopAndWait()

    // Now publish again with the same publisher. It should succeed and the consumer should receive the message.
    publisher.prepare("test").add(Charsets.UTF_8.encode("Message 1"), 0).send().get();
    Assert.assertEquals("Message 1", consumedMessages.poll(5, TimeUnit.SECONDS));

    kafkaClient.stopAndWait();
    zkClient.stopAndWait();
    server.stopAndWait();
  }

  private Thread createPublishThread(final KafkaClient kafkaClient, final String topic,
View Full Code Here

Examples of org.apache.twill.internal.zookeeper.InMemoryZKServer.stopAndWait()

      } finally {
        client.stopAndWait();
      }
    } finally {
      zkServer.stopAndWait();
    }
  }

  @Test
  public void testCreateParent() throws ExecutionException, InterruptedException {
View Full Code Here

Examples of org.apache.twill.internal.zookeeper.InMemoryZKServer.stopAndWait()

        Assert.assertTrue(Arrays.equals("testing".getBytes(), client.getData(path).get().getData()));
      } finally {
        client.stopAndWait();
      }
    } finally {
      zkServer.stopAndWait();
    }
  }

  @Test
  public void testGetChildren() throws ExecutionException, InterruptedException {
View Full Code Here

Examples of org.apache.twill.internal.zookeeper.InMemoryZKServer.stopAndWait()

      } finally {
        client.stopAndWait();
      }
    } finally {
      zkServer.stopAndWait();
    }
  }

  @Test
  public void testSetData() throws ExecutionException, InterruptedException {
View Full Code Here

Examples of org.apache.twill.internal.zookeeper.InMemoryZKServer.stopAndWait()

      client.setData("/test", "testing".getBytes()).get();
      Assert.assertTrue(Arrays.equals("testing".getBytes(), client.getData("/test").get().getData()));

    } finally {
      zkServer.stopAndWait();
    }
  }

  @Test
  public void testExpireRewatch() throws InterruptedException, IOException, ExecutionException {
View Full Code Here

Examples of org.apache.twill.internal.zookeeper.InMemoryZKServer.stopAndWait()

        Assert.assertEquals(Watcher.Event.EventType.NodeDeleted, events.poll(4, TimeUnit.SECONDS));
      } finally {
        client.stopAndWait();
      }
    } finally {
      zkServer.stopAndWait();
    }
  }

  @Test
  public void testRetry() throws ExecutionException, InterruptedException, TimeoutException, IOException {
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.