gpt4 book ai didi

org.apache.fluo.accumulo.util.ZookeeperUtil.getGcTimestamp()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:39:19 34 4
gpt4 key购买 nike

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

ZookeeperUtil.getGcTimestamp介绍

[英]Retrieves the GC timestamp, set by the Oracle, from zookeeper
[中]从zookeeper检索由Oracle设置的GC时间戳

代码示例

代码示例来源:origin: apache/fluo

private void waitForGcTime(long expectedTime) throws Exception {
 env.getSharedResources().getTimestampTracker().updateZkNode();
 long oldestTs = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());
 while (oldestTs < expectedTime) {
  Thread.sleep(500);
  oldestTs = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());
 }
}

代码示例来源:origin: apache/fluo

@Override
public void init(SortedKeyValueIterator<Key, Value> source, Map<String, String> options,
  IteratorEnvironment env) throws IOException {
 if (env.getIteratorScope() == IteratorScope.scan) {
  throw new IllegalArgumentException();
 }
 this.source = source;
 isFullMajc = env.getIteratorScope() == IteratorScope.majc && env.isFullMajorCompaction();
 String oats = options.get(GC_TIMESTAMP_OPT);
 if (oats != null) {
  gcTimestamp = Long.valueOf(oats);
 } else {
  String zookeepers = options.get(ZOOKEEPER_CONNECT_OPT);
  if (zookeepers == null) {
   throw new IllegalArgumentException("A configuration item for GC iterator was not set");
  }
  gcTimestamp = ZookeeperUtil.getGcTimestamp(zookeepers);
 }
}

代码示例来源:origin: apache/fluo

@Test
public void testGetOldestTimestamp() throws Exception {
 // we are expecting an error in this test
 final Level curLevel = Logger.getLogger(ZookeeperUtil.class).getLevel();
 Logger.getLogger(ZookeeperUtil.class).setLevel(Level.FATAL);
 // verify that oracle initial current ts
 Assert.assertEquals(0, ZookeeperUtil.getGcTimestamp(config.getAppZookeepers()));
 // delete the oracle current timestamp path
 env.getSharedResources().getCurator().delete().forPath(ZookeeperPath.ORACLE_GC_TIMESTAMP);
 // verify that oldest possible is returned
 Assert.assertEquals(ZookeeperUtil.OLDEST_POSSIBLE,
   ZookeeperUtil.getGcTimestamp(config.getAppZookeepers()));
 // set level back
 Logger.getLogger(ZookeeperUtil.class).setLevel(curLevel);
}

代码示例来源:origin: apache/fluo

long oldestTS = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());
 oldestTS = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());

代码示例来源:origin: apache/fluo

LongUtil.toByteArray(nextTs));
long gcTs = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());
while (gcTs < nextTs) {
 Thread.sleep(500);
 gcTs = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());

代码示例来源:origin: apache/fluo

public void testVerifyAfterGC() throws Exception {
 final TestTransaction tx1 = new TestTransaction(env);
 BankUtil.setBalance(tx1, "bob", 10);
 BankUtil.setBalance(tx1, "joe", 20);
 BankUtil.setBalance(tx1, "jill", 60);
 tx1.done();
 BankUtil.transfer(env, "joe", "jill", 1);
 BankUtil.transfer(env, "joe", "bob", 1);
 BankUtil.transfer(env, "bob", "joe", 2);
 BankUtil.transfer(env, "jill", "joe", 2);
 final TestTransaction tx2 = new TestTransaction(env);
 waitForGcTime(tx2.getStartTimestamp());
 long oldestTs = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());
 Assert.assertEquals(tx2.getStartTs(), oldestTs);
 // Force a garbage collection
 aClient.tableOperations().flush(table, null, null, true);
 verify(oldestTs);
 final TestTransaction tx3 = new TestTransaction(env);
 Assert.assertEquals(9, BankUtil.getBalance(tx3, "bob"));
 Assert.assertEquals(22, BankUtil.getBalance(tx3, "joe"));
 Assert.assertEquals(59, BankUtil.getBalance(tx3, "jill"));
 tx3.done();
 tx2.done();
}

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