本文整理匯總了Java中org.apache.hadoop.hbase.HRegionInfo.parseFrom方法的典型用法代碼示例。如果您正苦於以下問題:Java HRegionInfo.parseFrom方法的具體用法?Java HRegionInfo.parseFrom怎麽用?Java HRegionInfo.parseFrom使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.hbase.HRegionInfo
的用法示例。
在下文中一共展示了HRegionInfo.parseFrom方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadRegionInfoFileContent
import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
/**
* Create a {@link HRegionInfo} from the serialized version on-disk.
*
* @param fs {@link FileSystem} that contains the Region Info file
* @param regionDir {@link Path} to the Region Directory that contains the Info file
* @return An {@link HRegionInfo} instance gotten from the Region Info file.
* @throws IOException if an error occurred during file open/read operation.
*/
public static HRegionInfo loadRegionInfoFileContent(final FileSystem fs, final Path regionDir)
throws IOException {
FSDataInputStream in = fs.open(new Path(regionDir, REGION_INFO_FILE));
try {
return HRegionInfo.parseFrom(in);
} finally {
in.close();
}
}
示例2: testPb
import org.apache.hadoop.hbase.HRegionInfo; //導入方法依賴的package包/類
@Test
public void testPb() throws DeserializationException {
HRegionInfo hri = HRegionInfo.FIRST_META_REGIONINFO;
byte [] bytes = hri.toByteArray();
HRegionInfo pbhri = HRegionInfo.parseFrom(bytes);
assertTrue(hri.equals(pbhri));
}