當前位置: 首頁>>代碼示例>>Java>>正文


Java HConstants.DEFAULT_CLUSTER_ID屬性代碼示例

本文整理匯總了Java中org.apache.hadoop.hbase.HConstants.DEFAULT_CLUSTER_ID屬性的典型用法代碼示例。如果您正苦於以下問題:Java HConstants.DEFAULT_CLUSTER_ID屬性的具體用法?Java HConstants.DEFAULT_CLUSTER_ID怎麽用?Java HConstants.DEFAULT_CLUSTER_ID使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.apache.hadoop.hbase.HConstants的用法示例。


在下文中一共展示了HConstants.DEFAULT_CLUSTER_ID屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testLogMoving

/**
 * Sanity check that we can move logs around while we are reading
 * from them. Should this test fail, ReplicationSource would have a hard
 * time reading logs that are being archived.
 * @throws Exception
 */
@Test
public void testLogMoving() throws Exception{
  Path logPath = new Path(logDir, "log");
  if (!FS.exists(logDir)) FS.mkdirs(logDir);
  if (!FS.exists(oldLogDir)) FS.mkdirs(oldLogDir);
  WALProvider.Writer writer = WALFactory.createWALWriter(FS, logPath,
      TEST_UTIL.getConfiguration());
  for(int i = 0; i < 3; i++) {
    byte[] b = Bytes.toBytes(Integer.toString(i));
    KeyValue kv = new KeyValue(b,b,b);
    WALEdit edit = new WALEdit();
    edit.add(kv);
    WALKey key = new WALKey(b, TableName.valueOf(b), 0, 0,
        HConstants.DEFAULT_CLUSTER_ID);
    writer.append(new WAL.Entry(key, edit));
    writer.sync();
  }
  writer.close();

  WAL.Reader reader = WALFactory.createReader(FS, logPath, TEST_UTIL.getConfiguration());
  WAL.Entry entry = reader.next();
  assertNotNull(entry);

  Path oldLogPath = new Path(oldLogDir, "log");
  FS.rename(logPath, oldLogPath);

  entry = reader.next();
  assertNotNull(entry);

  entry = reader.next();
  entry = reader.next();

  assertNull(entry);
  reader.close();
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:41,代碼來源:TestReplicationSource.java

示例2: createTestLogEntry

private WAL.Entry createTestLogEntry(int i) {
  long seq = i;
  long now = i * 1000;

  WALEdit edit = new WALEdit();
  edit.add(KeyValueTestUtil.create("row", "fam", "qual", 1234, "val"));
  WALKey key = new WALKey(TEST_REGION, TEST_TABLE, seq, now,
      HConstants.DEFAULT_CLUSTER_ID);
  WAL.Entry entry = new WAL.Entry(key, edit);
  return entry;
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:11,代碼來源:TestWALMethods.java

示例3: getOriginatingClusterId

/**
 * @return the cluster id on which the change has originated. It there is no such cluster, it
 *         returns DEFAULT_CLUSTER_ID (cases where replication is not enabled)
 */
public UUID getOriginatingClusterId(){
  return clusterIds.isEmpty() ? HConstants.DEFAULT_CLUSTER_ID : clusterIds.get(0);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:7,代碼來源:WALKey.java


注:本文中的org.apache.hadoop.hbase.HConstants.DEFAULT_CLUSTER_ID屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。