@Override public int deserializeKV(DataInputStream in, SizedWritable key, SizedWritable value) throws IOException { if (!in.hasUnReadData()) { return 0; } key.length = in.readInt(); value.length = in.readInt(); keySerializer.deserialize(in, key.length, key.v); valueSerializer.deserialize(in, value.length, value.v); return key.length + value.length + KV_HEAD_LENGTH; }
@Override public void updateLength(SizedWritable key, SizedWritable value) throws IOException { key.length = keySerializer.getLength(key.v); value.length = valueSerializer.getLength(value.v); return; }