gpt4 book ai didi

com.liveramp.hank.coordinator.zk.ZkDomain.getVersions()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:22:23 26 4
gpt4 key购买 nike

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

ZkDomain.getVersions介绍

暂无

代码示例

代码示例来源:origin: LiveRamp/hank

@Override
public DomainVersion getVersion(int versionNumber) throws IOException {
 return findVersion(getVersions(), versionNumber);
}

代码示例来源:origin: LiveRamp/hank

@Override
public DomainVersion getVersionShallow(int versionNumber) throws IOException {
 if (versions.isLoaded()) {
  return findVersion(getVersions(), versionNumber);
 } else {
  try {
   return new ZkDomainVersion(zk,
     ZkPath.append(path, VERSIONS_PATH, ZkDomainVersion.getPathName(versionNumber)),
     getDomainVersionPropertiesSerialization());
  } catch (InterruptedException e) {
   return null;
  } catch (KeeperException e) {
   return null;
  }
 }
}

代码示例来源:origin: LiveRamp/hank

@Test
public void testVersioning() throws Exception {
 final ZkDomain dc = ZkDomain.create(getZk(), getRoot(), "domain0", 1, STORAGE_ENGINE_FACTORY, STORAGE_ENGINE_OPTS, CONST_PARTITIONER, 0, Collections.<String>emptyList());
 assertTrue(dc.getVersions().isEmpty());
 DomainVersion version = dc.openNewVersion(null);
 assertEquals(0, version.getVersionNumber());
 assertEquals(1, dc.getVersions().size());
 version.close();
 Thread.sleep(1000);
 version = dc.openNewVersion(null);
 assertNotNull(version);
 assertEquals(1, version.getVersionNumber());
 assertEquals(2, dc.getVersions().size());
 // Test getVersionShallow
 assertTrue(dc.getVersionShallow(0) != null);
 assertEquals(dc.getVersion(0), dc.getVersionShallow(0));
}

代码示例来源:origin: LiveRamp/hank

@Test
public void testCreate() throws Exception {
 ZkDomain dc = ZkDomain.create(getZk(), getRoot(), "domain0", 1024, ConstantStorageEngine.Factory.class.getName(), "---", Murmur64Partitioner.class.getName(), 0, Collections.<String>emptyList());
 assertEquals(0, dc.getId());
 assertEquals("domain0", dc.getName());
 assertEquals(1024, dc.getNumParts());
 assertEquals(ConstantStorageEngine.Factory.class.getName(), dc.getStorageEngineFactoryClassName());
 assertEquals(ConstantStorageEngine.Factory.class, dc.getStorageEngineFactoryClass());
 assertTrue(dc.getStorageEngine() instanceof ConstantStorageEngine);
 assertTrue(dc.getVersions().isEmpty());
 assertTrue(dc.getPartitioner() instanceof Murmur64Partitioner);
}

代码示例来源:origin: LiveRamp/hank

@Test
public void testLoad() throws Exception {
 ZkDomain.create(getZk(), getRoot(), "domain0", 1024, ConstantStorageEngine.Factory.class.getName(), "---", Murmur64Partitioner.class.getName(), 0, Collections.<String>emptyList());
 ZkDomain dc = new ZkDomain(getZk(), ZkPath.append(getRoot(), "domain0"));
 assertEquals(0, dc.getId());
 assertEquals("domain0", dc.getName());
 assertEquals(1024, dc.getNumParts());
 assertEquals(ConstantStorageEngine.Factory.class.getName(), dc.getStorageEngineFactoryClassName());
 assertEquals(ConstantStorageEngine.Factory.class, dc.getStorageEngineFactoryClass());
 assertTrue(dc.getStorageEngine() instanceof ConstantStorageEngine);
 assertTrue(dc.getVersions().isEmpty());
 assertTrue(dc.getPartitioner() instanceof Murmur64Partitioner);
}

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