HBASE-14001 Optimize write(OutputStream out, boolean withTags) for SizeCachedNoTagsKeyValue.

This commit is contained in:
anoopsjohn 2015-06-30 22:50:38 +05:30
parent f8bd578b80
commit 7e7fbdb84b
1 changed files with 11 additions and 0 deletions

View File

@ -19,7 +19,11 @@
*/ */
package org.apache.hadoop.hbase; package org.apache.hadoop.hbase;
import java.io.IOException;
import java.io.OutputStream;
import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceAudience;
import org.apache.hadoop.hbase.util.Bytes;
/** /**
* This class is an extension to ContentSizeCachedKeyValue where there are no tags in Cell. * This class is an extension to ContentSizeCachedKeyValue where there are no tags in Cell.
@ -42,4 +46,11 @@ public class SizeCachedNoTagsKeyValue extends SizeCachedKeyValue {
public long heapSizeWithoutTags() { public long heapSizeWithoutTags() {
return super.heapSize(); return super.heapSize();
} }
@Override
public int write(OutputStream out, boolean withTags) throws IOException {
writeInt(out, this.length);
out.write(this.bytes, this.offset, this.length);
return this.length + Bytes.SIZEOF_INT;
}
} }