From 9989a5035a53647ea69693778e31e160c4c15c35 Mon Sep 17 00:00:00 2001 From: offermannu Date: Wed, 5 May 2021 11:22:37 +0200 Subject: [PATCH] Update Import.java See https://issues.apache.org/jira/browse/HBASE-25839 * CellSortImporter emits values wrapped inside MapReduceExtendedCell * CellWritableComparable serializes given cells using standard KeyValue serialization methods in order to fit with the used deserialization method --- .../main/java/org/apache/hadoop/hbase/mapreduce/Import.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java index 30071fdfd80..6a9007fadd8 100644 --- a/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java +++ b/hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/Import.java @@ -135,9 +135,7 @@ public class Import extends Configured implements Tool { @Override public void write(DataOutput out) throws IOException { - out.writeInt(PrivateCellUtil.estimatedSerializedSizeOfKey(kv)); - out.writeInt(0); - PrivateCellUtil.writeFlatKey(kv, out); + KeyValueUtil.write(new KeyValue(kv), out); } @Override @@ -219,7 +217,7 @@ public class Import extends Configured implements Tool { // skip if we filtered it out if (kv == null) continue; Cell ret = convertKv(kv, cfRenameMap); - context.write(new CellWritableComparable(ret), ret); + context.write(new CellWritableComparable(ret), new MapReduceExtendedCell(ret)); } } } catch (InterruptedException e) {