Skip to content

Commit

Permalink
HBASE-27654 IndexBlockEncoding is missing in HFileContextBuilder copy…
Browse files Browse the repository at this point in the history
… constructor (#5039)

Signed-off-by: Bryan Beaudreault <[email protected]>
  • Loading branch information
comnetwork authored Feb 20, 2023
1 parent 5f0dcdd commit cf179d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public HFileContextBuilder(final HFileContext hfc) {
this.columnFamily = hfc.getColumnFamily();
this.tableName = hfc.getTableName();
this.cellComparator = hfc.getCellComparator();
this.indexBlockEncoding = hfc.getIndexBlockEncoding();
}

public HFileContextBuilder withHBaseCheckSum(boolean useHBaseCheckSum) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import org.apache.hadoop.hbase.io.compress.Compression;
import org.apache.hadoop.hbase.io.encoding.DataBlockEncoder;
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.Writer;
import org.apache.hadoop.hbase.io.hfile.ReaderContext.ReaderType;
Expand Down Expand Up @@ -1061,4 +1062,11 @@ private void testReaderCombinedCache(final String l1CachePolicy) throws Exceptio
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);
}
}

0 comments on commit cf179d3

Please sign in to comment.