gpt4 book ai didi

pl.allegro.tech.hermes.test.helper.zookeeper.ZookeeperWaiter.untilZookeeperPathNotExists()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 05:29:31 29 4
gpt4 key购买 nike

本文整理了Java中pl.allegro.tech.hermes.test.helper.zookeeper.ZookeeperWaiter.untilZookeeperPathNotExists()方法的一些代码示例,展示了ZookeeperWaiter.untilZookeeperPathNotExists()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZookeeperWaiter.untilZookeeperPathNotExists()方法的具体详情如下:
包路径:pl.allegro.tech.hermes.test.helper.zookeeper.ZookeeperWaiter
类名称:ZookeeperWaiter
方法名:untilZookeeperPathNotExists

ZookeeperWaiter.untilZookeeperPathNotExists介绍

暂无

代码示例

代码示例来源:origin: pl.allegro.tech.hermes/hermes-test-helper

public void untilZookeeperPathNotExists(String... path) {
  untilZookeeperPathNotExists(stream(path).collect(joining("/")));
}

代码示例来源:origin: allegro/hermes

public void untilZookeeperPathNotExists(String... path) {
  untilZookeeperPathNotExists(stream(path).collect(joining("/")));
}

代码示例来源:origin: allegro/hermes

private Subscription dropAssignment(Subscription sub) {
    workTracker.dropAssignment(sub);
    wait.untilZookeeperPathNotExists(basePath, sub.getQualifiedName().toString(), supervisorId);
    return sub;
  }
}

代码示例来源:origin: allegro/hermes

@Test
public void shouldDropAssignmentAndEmptySubscriptionNode() {
  // given
  Subscription sub = forceAssignment(anySubscription());
  // when
  workTracker.dropAssignment(sub);
  wait.untilZookeeperPathNotExists(basePath, sub.getQualifiedName().toString());
  // then
  assertThat(workTracker.isAssignedTo(sub.getQualifiedName(), supervisorId)).isFalse();
}

代码示例来源:origin: allegro/hermes

@Test
public void shouldApplyAssignmentChangesByRemovingInvalidNodes() {
  // given
  Subscription s1 = forceAssignment(anySubscription());
  // when
  workTracker.apply(subscriptionAssignmentRegistry.createSnapshot(), stateWithNoAssignments());
  // then
  wait.untilZookeeperPathNotExists(basePath, s1.getQualifiedName().toString(), supervisorId);
}

代码示例来源:origin: allegro/hermes

@Test
public void shouldApplyAssignmentChangesByRemovingInvalidSubscriptionNode() {
  // given
  Subscription s1 = dropAssignment(forceAssignment(anySubscription()));
  // when
  workTracker.apply(subscriptionAssignmentRegistry.createSnapshot(), stateWithNoAssignments());
  // then
  wait.untilZookeeperPathNotExists(basePath, s1.getQualifiedName().toString());
}

代码示例来源:origin: allegro/hermes

@Test
public void shouldRemoveInactiveConsumerEntries() throws Exception {
  // given
  ConsumerInstance consumer1 = consumer("consumer1");
  ConsumerInstance consumer2 = consumer("consumer2");
  maxRateRegistry.ensureCorrectAssignments(subscription, Sets.newHashSet("consumer1", "consumer2"));
  maxRateRegistry.update(subscription, ImmutableMap.of(
      "consumer1", new MaxRate(350.0),
      "consumer2", new MaxRate(0.5)
  ));
  wait.untilZookeeperPathIsCreated(
      zookeeperPaths.consumersMaxRatePath(cluster, consumer1.getSubscription(), consumer1.getConsumerId()));
  wait.untilZookeeperPathIsCreated(
      zookeeperPaths.consumersMaxRatePath(cluster, consumer2.getSubscription(), consumer2.getConsumerId()));
  // when
  maxRateRegistry.ensureCorrectAssignments(subscription, Sets.newHashSet("consumer1", "consumer3"));
  wait.untilZookeeperPathNotExists(
      zookeeperPaths.consumersRatePath(cluster, consumer2.getSubscription(), consumer2.getConsumerId()));
  // then
  assertEquals(Optional.empty(), maxRateRegistry.getMaxRate(consumer2));
}

代码示例来源:origin: allegro/hermes

@Test
public void shouldApplyAssignmentChangesByRemovingSubscriptionNode() {
  // given
  Subscription s1 = anySubscription();
  SubscriptionAssignmentView view = stateWithSingleAssignment(s1);
  workTracker.apply(subscriptionAssignmentRegistry.createSnapshot(), view);
  wait.untilZookeeperPathIsCreated(basePath, s1.getQualifiedName().toString(), supervisorId);
  // when
  workTracker.apply(subscriptionAssignmentRegistry.createSnapshot(), stateWithNoAssignments());
  // then
  wait.untilZookeeperPathNotExists(basePath, s1.getQualifiedName().toString());
}

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com