本文整理了Java中com.twitter.distributedlog.impl.ZKLogMetadataStore
类的一些代码示例,展示了ZKLogMetadataStore
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZKLogMetadataStore
类的具体详情如下:
包路径:com.twitter.distributedlog.impl.ZKLogMetadataStore
类名称:ZKLogMetadataStore
[英]ZooKeeper based log metadata store
[中]基于ZooKeeper的日志元数据存储
代码示例来源:origin: twitter/distributedlog
static interface ZooKeeperClientHandler<T> {
T handle(ZooKeeperClient zkc) throws IOException;
}
代码示例来源:origin: twitter/distributedlog
@Test(timeout = 60000)
public void testCreateLog() throws Exception {
assertEquals(uri, FutureUtils.result(metadataStore.createLog("test")));
}
代码示例来源:origin: twitter/distributedlog
@Test(timeout = 60000)
public void testGetLogLocation() throws Exception {
Optional<URI> uriOptional = FutureUtils.result(metadataStore.getLogLocation("test"));
assertTrue(uriOptional.isPresent());
assertEquals(uri, uriOptional.get());
}
代码示例来源:origin: twitter/distributedlog
@Test(timeout = 60000)
public void testGetLogs() throws Exception {
Set<String> logs = Sets.newHashSet();
for (int i = 0; i < 10; i++) {
String logName = "test-" + i;
logs.add(logName);
createLogInNamespace(uri, logName);
}
Set<String> result = Sets.newHashSet(FutureUtils.result(metadataStore.getLogs()));
assertEquals(10, result.size());
assertTrue(Sets.difference(logs, result).isEmpty());
}
}
代码示例来源:origin: twitter/distributedlog
@Before
public void setup() throws Exception {
zkc = TestZooKeeperClientBuilder.newBuilder()
.uri(createDLMURI("/"))
.sessionTimeoutMs(zkSessionTimeoutMs)
.build();
scheduler = OrderedScheduler.newBuilder()
.name("test-zk-logmetadata-store")
.corePoolSize(1)
.build();
DistributedLogConfiguration conf = new DistributedLogConfiguration();
conf.addConfiguration(baseConf);
this.uri = createDLMURI("/" + runtime.getMethodName());
metadataStore = new ZKLogMetadataStore(conf, uri, zkc, scheduler);
}
内容来源于网络,如有侵权,请联系作者删除!