Examples of ChronosImplement


Examples of com.xiaomi.infra.chronos.ChronosImplement

  }

  @Before
  public void resetZooKeeper() throws IOException, KeeperException, FatalChronosException,
      ChronosException {
    ChronosImplement chronosImplement = createChronosImplement(new HostPort("127.0.0.1", 10086));
    ZooKeeperUtil.deleteNodeRecursively(chronosImplement.getChronosServerWatcher(),
      chronosImplement.getChronosServerWatcher().getBaseZnode());
    chronosImplement.getChronosServerWatcher().close();
  }
View Full Code Here

Examples of com.xiaomi.infra.chronos.ChronosImplement

      ZKConfig.getZKQuorumServersString(TEST_UTIL.getConfiguration()));
    properties.setProperty(FailoverServer.SESSION_TIMEOUT, String.valueOf(3000));
    properties.setProperty(ChronosServer.ZK_ADVANCE_TIMESTAMP, "100000");
    properties.setProperty(FailoverServer.CONNECT_RETRY_TIMES, String.valueOf(10));

    return new ChronosImplement(properties, new ChronosServerWatcher(properties));
  }
View Full Code Here

Examples of com.xiaomi.infra.chronos.ChronosImplement

  }

  @Test
  public void testGetTimestamp() throws FatalChronosException, ChronosException, IOException,
      TException {
    ChronosImplement chronosImplement = createChronosImplement(new HostPort("127.0.0.1", 10086));

    chronosImplement.initTimestamp();
    long firstTimestamp = chronosImplement.getTimestamp();
    long secondTimestamp = chronosImplement.getTimestamp();
    Assert.assertTrue(firstTimestamp < secondTimestamp);

    chronosImplement.getChronosServerWatcher().close();
  }
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.