[ 
https://issues.apache.org/jira/browse/HBASE-20819?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17146470#comment-17146470
 ] 

Elliot Miller commented on HBASE-20819:
---------------------------------------

h2. Which Constants Should We Keep?

Below are my opinions on which constants we should keep, based on my last 
comment.
h3. L1 Cache Constants
 * {color:#de350b}CACHE_DATA_IN_L1{color}
 ** Fact: Zero usages in HBase repo (via grep)
 ** Fact: This constant pertains to a feature that is marked for removal in 
HBase 3.0.0
 *** "From HBase 2.0.0 onwards, the notions of L1 and L2 have been deprecated." 
[See HBase Book|http://hbase.apache.org/book.html#offheap.blockcache]
 ** Conclusion: Delete it!

h3. Comparator Constants

Both of these constants (while public) are marked with 
{{@InterfaceAudience.Private}}, and seem to be for internal use only. I'm 
inclined to leave them out.
 * {color:#de350b}COMPARATOR{color}
 * {color:#de350b}COMPARATOR_IGNORE_REPLICATION{color}

h3. MOB (Medium OBjects) Constants

All three of these constants were copied from HTableDescriptor to 
ColumnFamilyDescriptorBuilder. In this process, they went from public to 
private and three new setters were added to ColumnFamilyDescriptorBuilder: 
setMobCompactPartitionPolicy, setMobEnabled, and setMobThreshold. *I worry that 
if we include the constants in the shell, it will encourage users to circumvent 
our new builder interface setters and directly mess with values.* For that 
reason, I think we should not include these constants.
 * {color:#ff0000}IS_MOB_BYTES{color}
 * {color:#ff0000}MOB_COMPACT_PARTITION_POLICY_BYTES{color}
 * {color:#ff0000}MOB_THRESHOLD_BYTES{color}

h3. Replication Scope Constants
 * {color:#00875a}REPLICATION_SCOPE_BYTES{color}
 ** Copied from HColumnDescriptor to ColumnFamilyDescriptor and it's public! We 
should *definitely keep this one*.

h3. MISC Constants
 * {color:#de350b}ENCODE_ON_DISK{color}
 ** Zero usages in entire HBase repo
 ** No longer used... In fact, there was a [comment on the definition 
line|https://github.com/apache/hbase/blob/fe5865d9e3ffc7b0c0fdef4980295f6ca07298a2/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java#L74]
 added in 2013 stating that it was no longer used
 * {color:#00875a}FOREVER{color}
 ** Moved to HConstants.FOREVER

 * {color:#00875a}IS_ROOT{color}
 ** Used in TableSchemaModel... I'm guessing the constant will be moved to 
HConstants in some follow-up work to remove HTableDescriptor from the entire 
repo before the 3.0.0 release. For now, I'll keep it.

 * {color:#de350b}LENGTH{color}
 ** As far as I can tell, it hasn't been in use since 
[HBASE-1304|https://github.com/apache/hbase/commit/6af4292630daca370de7fce3a2b2b3401cd1abfa]
 (2009)

> Use TableDescriptor to replace HTableDescriptor in hbase-shell module
> ---------------------------------------------------------------------
>
>                 Key: HBASE-20819
>                 URL: https://issues.apache.org/jira/browse/HBASE-20819
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 2.0.0
>            Reporter: Xiaolin Ha
>            Assignee: Elliot Miller
>            Priority: Minor
>             Fix For: 3.0.0-alpha-1
>
>         Attachments: HBASE-20819.branch-2.001.patch, 
> HBASE-20819.branch-2.002.patch, 
> HBaseConstants-b5563432922268c7a16deacbb51bfba89c0a2aba.txt, 
> HBaseConstants-cf2aa593e590133b0c76d3723b4074b28b55dcc9.txt, 
> HBaseConstants-diff.txt
>
>
> HTableDescriptor is deprecated as of release 2.0.0, and will be removed in 
> 3.0.0. This patch replaces all usages of HTableDescriptor and 
> HColumnDescriptor in the hbase-shell module so that HTableDescriptor can be 
> removed.
> There a few other consequences of this change:
>  * Ruby methods relating to HTableDescriptor and HColumnDescriptor have been 
> removed. This is noted in "Release Note" on this issue.
>  * We no longer import constants from HTableDescriptor and HColumnDescriptor 
> into the ruby HBaseConstants module. Instead, we import them from 
> ColumnFamilyDescriptorBuilder and TableDescriptorBuilder.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to