本文整理汇总了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);
}