本文整理匯總了Java中org.apache.hadoop.hbase.CellUtil.getCellKeySerializedAsKeyValueKey方法的典型用法代碼示例。如果您正苦於以下問題:Java CellUtil.getCellKeySerializedAsKeyValueKey方法的具體用法?Java CellUtil.getCellKeySerializedAsKeyValueKey怎麽用?Java CellUtil.getCellKeySerializedAsKeyValueKey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.hbase.CellUtil
的用法示例。
在下文中一共展示了CellUtil.getCellKeySerializedAsKeyValueKey方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: finishFileInfo
import org.apache.hadoop.hbase.CellUtil; //導入方法依賴的package包/類
/**
* Add last bits of metadata to file info before it is written out.
*/
protected void finishFileInfo() throws IOException {
if (lastCell != null) {
// Make a copy. The copy is stuffed into our fileinfo map. Needs a clean
// byte buffer. Won't take a tuple.
byte [] lastKey = CellUtil.getCellKeySerializedAsKeyValueKey(this.lastCell);
fileInfo.append(FileInfo.LASTKEY, lastKey, false);
}
// Average key length.
int avgKeyLen =
entryCount == 0 ? 0 : (int) (totalKeyLength / entryCount);
fileInfo.append(FileInfo.AVG_KEY_LEN, Bytes.toBytes(avgKeyLen), false);
// Average value length.
int avgValueLen =
entryCount == 0 ? 0 : (int) (totalValueLength / entryCount);
fileInfo.append(FileInfo.AVG_VALUE_LEN, Bytes.toBytes(avgValueLen), false);
fileInfo.append(FileInfo.CREATE_TIME_TS, Bytes.toBytes(hFileContext.getFileCreateTime()),
false);
}