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


Java HRegionInfo.equals方法代碼示例

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


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

示例1: getStoreFileInfo

import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
/**
 * Returns a StoreFileInfo from the given FileStatus. Secondary replicas refer to the
 * files of the primary region, so an HFileLink is used to construct the StoreFileInfo. This
 * way ensures that the secondary will be able to continue reading the store files even if
 * they are moved to archive after compaction
 * @throws IOException
 */
public static StoreFileInfo getStoreFileInfo(Configuration conf, FileSystem fs,
    HRegionInfo regionInfo, HRegionInfo regionInfoForFs, String familyName, Path path)
    throws IOException {

  // if this is a primary region, just return the StoreFileInfo constructed from path
  if (regionInfo.equals(regionInfoForFs)) {
    return new StoreFileInfo(conf, fs, path);
  }

  // else create a store file link. The link file does not exists on filesystem though.
  HFileLink link = HFileLink.build(conf, regionInfoForFs.getTable(),
          regionInfoForFs.getEncodedName(), familyName, path.getName());

  if (StoreFileInfo.isReference(path)) {
    Reference reference = Reference.read(fs, path);
    return new StoreFileInfo(conf, fs, link.getFileStatus(fs), reference);
  }

  return new StoreFileInfo(conf, fs, link.getFileStatus(fs), link);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:28,代碼來源:ServerRegionReplicaUtil.java

示例2: verifyRegionInfo

import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
/**
 * Verify that the regionInfo is valid
 * @param region the region to check
 * @param manifest snapshot manifest to inspect
 */
private void verifyRegionInfo(final HRegionInfo region,
    final SnapshotRegionManifest manifest) throws IOException {
  HRegionInfo manifestRegionInfo = HRegionInfo.convert(manifest.getRegionInfo());
  if (!region.equals(manifestRegionInfo)) {
    String msg = "Manifest region info " + manifestRegionInfo +
                 "doesn't match expected region:" + region;
    throw new CorruptedSnapshotException(msg, snapshot);
  }
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:15,代碼來源:MasterSnapshotVerifier.java


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