[
https://issues.apache.org/jira/browse/HBASE-12085?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14147744#comment-14147744
]
Anoop Sam John commented on HBASE-12085:
----------------------------------------
Looks good. Some minor comments
Make sure to add @param, @return in the javadoc for new HCD methods
MobUtils
{code}
public static boolean isMobFamily(HColumnDescriptor hcd) {
- byte[] isMob = hcd.getValue(MobConstants.IS_MOB);
- return isMob != null && isMob.length == 1 && Bytes.toBoolean(isMob);
+ return hcd.isMobEnabled();
}
public static long getMobThreshold(HColumnDescriptor hcd) {
- byte[] threshold = hcd.getValue(MobConstants.MOB_THRESHOLD);
- return threshold != null && threshold.length == Bytes.SIZEOF_LONG ?
Bytes.toLong(threshold)
- : MobConstants.DEFAULT_MOB_THRESHOLD;
+ return hcd.getMobThreshold();
}
{code}
Just remove these from MobUtils. We dont need util method to call a getter on
the passed param.
{code}
public class MobConstants {
- public static final byte[] IS_MOB = Bytes.toBytes("IS_MOB");
- public static final byte[] MOB_THRESHOLD = Bytes.toBytes("MOB_THRESHOLD");
- public static final long DEFAULT_MOB_THRESHOLD = 100 * 1024; // 100k
+ public static final byte[] IS_MOB = HColumnDescriptor.IS_MOB_BYTES;
+ public static final byte[] MOB_THRESHOLD =
HColumnDescriptor.MOB_THRESHOLD_BYTES;
{code}
Just remove these duplicate declaration. Just use them from HColumnDescriptor
wherever used.
> mob status should print human readable numbers.
> -----------------------------------------------
>
> Key: HBASE-12085
> URL: https://issues.apache.org/jira/browse/HBASE-12085
> Project: HBase
> Issue Type: Sub-task
> Components: mob, UI
> Affects Versions: hbase-11339
> Reporter: Jonathan Hsieh
> Assignee: Jingcheng Du
> Attachments: HBASE-12085-V2.diff, HBASE-12085.diff
>
>
> Currently, mob cf configuration stuff shows up as ugly byte strings instead
> of meaningful numeric values.
> {code}
> IntegrationTestIngestWithMOB 20 'IntegrationTestIngestWithMOB', {NAME
> => 'test_cf', METADATA => {'mobThreshold' =>
> '\x00\x00\x00\x00\x00\x01\x90\x00', 'isMob' => '\xFF'}}
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)