本文整理匯總了Java中org.apache.hadoop.hbase.KeyValue.write方法的典型用法代碼示例。如果您正苦於以下問題:Java KeyValue.write方法的具體用法?Java KeyValue.write怎麽用?Java KeyValue.write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.hbase.KeyValue
的用法示例。
在下文中一共展示了KeyValue.write方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: write
import org.apache.hadoop.hbase.KeyValue; //導入方法依賴的package包/類
@Override
public void write(DataOutput out) throws IOException {
LOG.warn("WALEdit is being serialized to writable - only expected in test code");
out.writeInt(VERSION_2);
out.writeInt(cells.size());
// We interleave the two lists for code simplicity
for (Cell cell : cells) {
// This is not used in any of the core code flows so it is just fine to convert to KV
KeyValue kv = KeyValueUtil.ensureKeyValue(cell);
if (compressionContext != null) {
KeyValueCompression.writeKV(out, kv, compressionContext);
} else{
KeyValue.write(kv, out);
}
}
if (scopes == null) {
out.writeInt(0);
} else {
out.writeInt(scopes.size());
for (byte[] key : scopes.keySet()) {
Bytes.writeByteArray(out, key);
out.writeInt(scopes.get(key));
}
}
}
示例2: serialize
import org.apache.hadoop.hbase.KeyValue; //導入方法依賴的package包/類
@Override
public void serialize(KeyValue kv) throws IOException {
KeyValue.write(kv, this.dos);
}