hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hsieh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-6990) Pretty print TTL
Date Sun, 11 May 2014 13:01:16 GMT

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

Jonathan Hsieh commented on HBASE-6990:

Please add tests.

Please check the find bugs and report if this patch added it.

I don't think the toHuman function or enum should live in HColumnDescriptor.  Move it to o.a.h.h.util.

Can make this more readable as:
//+  public static final Long SECONDS_PER_DAY = 86400L;
+  public static final Long SECONDS_PER_DAY = 60 * 60 * 24; // secs * minutes * hours

So this is going to print total seconds and then total days?  Why print something like "3d
4h 15s"?  I don't think you need Math.floor.
+    if (interval >= SECONDS_PER_DAY) {
+      sb.append(interval);
+      sb.append(" SECONDS (");
+      sb.append((int) Math.floor(interval/SECONDS_PER_DAY));
+      sb.append(" DAY" + (interval == SECONDS_PER_DAY ? "" : "S"));
+      sb.append(")");
+    }

> Pretty print TTL
> ----------------
>                 Key: HBASE-6990
>                 URL: https://issues.apache.org/jira/browse/HBASE-6990
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Jean-Daniel Cryans
>            Assignee: Esteban Gutierrez
>            Priority: Minor
>         Attachments: HBASE-6990.v0.patch, HBASE-6990.v1.patch
> I've seen a lot of users getting confused by the TTL configuration and I think that if
we just pretty printed it it would solve most of the issues. For example, let's say a user
wanted to set a TTL of 90 days. That would be 7776000. But let's say that it was typo'd to
77760000 instead, it gives you 900 days!
> So when we print the TTL we could do something like "x days, x hours, x minutes, x seconds
(real_ttl_value)". This would also help people when they use ms instead of seconds as they
would see really big values in there.

This message was sent by Atlassian JIRA

View raw message