JinHyuk Kim created HBASE-30117:
-----------------------------------

             Summary: HBase shell CONFIGURATION for column family uses setValue 
instead of setConfiguration
                 Key: HBASE-30117
                 URL: https://issues.apache.org/jira/browse/HBASE-30117
             Project: HBase
          Issue Type: Bug
          Components: shell
            Reporter: JinHyuk Kim
            Assignee: JinHyuk Kim


h2. Summary

The HBase shell {{create}} and {{alter}} commands put {{CONFIGURATION}} entries 
into the wrong map for column family descriptors. This causes features like 
{{ROWPREFIX_FIXED_LENGTH}} bloom filter to fail when configured via the shell.
h2. Problem

In HBASE-20819, {{set_descriptor_config}} in {{admin.rb}} was changed from 
{{descriptor.setConfiguration(k, v)}} to {{descriptor.setValue(k, v)}} to 
support {{TableDescriptorBuilder}} which does not have a {{setConfiguration}} 
method. However, this change also affects 
{{{}ColumnFamilyDescriptorBuilder{}}}, where {{setValue}} and 
{{setConfiguration}} put values into different maps ({{{}values{}}} vs 
{{{}configuration{}}}).

When we run:
{code:java}
create 'mytable', {NAME => 'f', BLOOMFILTER => 'ROWPREFIX_FIXED_LENGTH',
  CONFIGURATION => {'RowPrefixBloomFilter.prefix_length' => '4'}}
{code}
The {{prefix_length}} is stored in the {{values}} map instead of the 
{{configuration}} map. {{TableDescriptorChecker.checkBloomFilterType}} reads 
from {{{}cfd.getConfiguration(){}}}, so it fails with...
{code:java}
Caused by: java.lang.IllegalArgumentException: Bloom filter type is 
ROWPREFIX_FIXED_LENGTH, RowPrefixBloomFilter.prefix_length not specified.
        at 
org.apache.hadoop.hbase.util.BloomFilterUtil.getBloomFilterParam(BloomFilterUtil.java:262)
        at 
org.apache.hadoop.hbase.util.TableDescriptorChecker.lambda$checkBloomFilterType$6(TableDescriptorChecker.java:323)
        ... 11 more
{code}
h2. Fix

Call {{setConfiguration}} directly for column family descriptors in the {{cfd}} 
method instead of using the shared {{set_descriptor_config}} method.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to