Package org.apache.hadoop.hbase.io
Class TagCompressionContext
java.lang.Object
org.apache.hadoop.hbase.io.TagCompressionContext
Context that holds the dictionary for Tag compression and doing the compress/uncompress. This
will be used for compressing tags while writing into HFiles and WALs.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTagCompressionContext
(Class<? extends Dictionary> dictType, int dictCapacity) -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
void
compressTags
(OutputStream out, byte[] in, int offset, int length) Compress tags one by one and writes to the OutputStream.void
compressTags
(OutputStream out, ByteBuffer in, int offset, int length) Compress tags one by one and writes to the OutputStream.void
uncompressTags
(InputStream src, byte[] dest, int offset, int length) Uncompress tags from the InputStream and writes to the destination array.void
uncompressTags
(InputStream src, ByteBuffer dest, int length) Uncompress tags from the InputStream and writes to the destination buffer.int
uncompressTags
(ByteBuff src, byte[] dest, int offset, int length) Uncompress tags from the input ByteBuffer and writes to the destination array.
-
Field Details
-
tagDict
-
-
Constructor Details
-
TagCompressionContext
public TagCompressionContext(Class<? extends Dictionary> dictType, int dictCapacity) throws SecurityException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
-
-
Method Details
-
clear
-
compressTags
Compress tags one by one and writes to the OutputStream.- Parameters:
out
- Stream to which the compressed tags to be writtenin
- Source where tags are availableoffset
- Offset for the tags byteslength
- Length of all tag bytes- Throws:
IOException
-
compressTags
public void compressTags(OutputStream out, ByteBuffer in, int offset, int length) throws IOException Compress tags one by one and writes to the OutputStream.- Parameters:
out
- Stream to which the compressed tags to be writtenin
- Source buffer where tags are availableoffset
- Offset for the tags byte bufferlength
- Length of all tag bytes- Throws:
IOException
-
uncompressTags
Uncompress tags from the InputStream and writes to the destination array.- Parameters:
src
- Stream where the compressed tags are availabledest
- Destination array where to write the uncompressed tagsoffset
- Offset in destination where tags to be writtenlength
- Length of all tag bytes- Throws:
IOException
-
uncompressTags
Uncompress tags from the input ByteBuffer and writes to the destination array.- Parameters:
src
- Buffer where the compressed tags are availabledest
- Destination array where to write the uncompressed tagsoffset
- Offset in destination where tags to be writtenlength
- Length of all tag bytes- Returns:
- bytes count read from source to uncompress all tags.
- Throws:
IOException
-
uncompressTags
Uncompress tags from the InputStream and writes to the destination buffer.- Parameters:
src
- Stream where the compressed tags are availabledest
- Destination buffer where to write the uncompressed tagslength
- Length of all tag bytes- Throws:
IOException
- when the dictionary does not have the entry
-