use of org.apache.flink.runtime.leaderelection.LeaderInformation in project flink by apache.
the class ZooKeeperUtilsITCase method runWriteAndReadLeaderInformationTest.
private void runWriteAndReadLeaderInformationTest(LeaderInformation leaderInformation) throws Exception {
final CuratorFrameworkWithUnhandledErrorListener curatorFramework = startCuratorFramework();
final String path = "/foobar";
try {
ZooKeeperUtils.writeLeaderInformationToZooKeeper(leaderInformation, curatorFramework.asCuratorFramework(), () -> true, path);
final LeaderInformation readLeaderInformation = ZooKeeperUtils.readLeaderInformation(curatorFramework.asCuratorFramework().getData().forPath(path));
assertThat(readLeaderInformation).isEqualTo(leaderInformation);
} finally {
curatorFramework.close();
}
}
Aggregations