HBASE-29654 IndexBlockEncoding is missing in HFileContextBuilder copy constructor (#5041)
Signed-off-by: Bryan Beaudreault <bbeaudreault@apache.org>
This commit is contained in:
parent
3a5fc6dad6
commit
f87c6b8505
|
@ -84,6 +84,7 @@ public class HFileContextBuilder {
|
||||||
this.columnFamily = hfc.getColumnFamily();
|
this.columnFamily = hfc.getColumnFamily();
|
||||||
this.tableName = hfc.getTableName();
|
this.tableName = hfc.getTableName();
|
||||||
this.cellComparator = hfc.getCellComparator();
|
this.cellComparator = hfc.getCellComparator();
|
||||||
|
this.indexBlockEncoding = hfc.getIndexBlockEncoding();
|
||||||
}
|
}
|
||||||
|
|
||||||
public HFileContextBuilder withHBaseCheckSum(boolean useHBaseCheckSum) {
|
public HFileContextBuilder withHBaseCheckSum(boolean useHBaseCheckSum) {
|
||||||
|
|
|
@ -70,6 +70,7 @@ import org.apache.hadoop.hbase.io.ByteBuffAllocator;
|
||||||
import org.apache.hadoop.hbase.io.compress.Compression;
|
import org.apache.hadoop.hbase.io.compress.Compression;
|
||||||
import org.apache.hadoop.hbase.io.encoding.DataBlockEncoder;
|
import org.apache.hadoop.hbase.io.encoding.DataBlockEncoder;
|
||||||
import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
|
import org.apache.hadoop.hbase.io.encoding.DataBlockEncoding;
|
||||||
|
import org.apache.hadoop.hbase.io.encoding.IndexBlockEncoding;
|
||||||
import org.apache.hadoop.hbase.io.hfile.HFile.Reader;
|
import org.apache.hadoop.hbase.io.hfile.HFile.Reader;
|
||||||
import org.apache.hadoop.hbase.io.hfile.HFile.Writer;
|
import org.apache.hadoop.hbase.io.hfile.HFile.Writer;
|
||||||
import org.apache.hadoop.hbase.io.hfile.ReaderContext.ReaderType;
|
import org.apache.hadoop.hbase.io.hfile.ReaderContext.ReaderType;
|
||||||
|
@ -1070,4 +1071,11 @@ public class TestHFile {
|
||||||
alloc.clean();
|
alloc.clean();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testHFileContextBuilderWithIndexEncoding() throws IOException {
|
||||||
|
HFileContext context =
|
||||||
|
new HFileContextBuilder().withIndexBlockEncoding(IndexBlockEncoding.PREFIX_TREE).build();
|
||||||
|
HFileContext newContext = new HFileContextBuilder(context).build();
|
||||||
|
assertTrue(newContext.getIndexBlockEncoding() == IndexBlockEncoding.PREFIX_TREE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue