You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2023/11/06 02:41:05 UTC
(hbase) branch branch-2.5 updated: HBASE-28185 Alter table to set TTL using hbase shell failed when ttl string is not match format (#5494)
This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-2.5
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.5 by this push:
new 4236b70070c HBASE-28185 Alter table to set TTL using hbase shell failed when ttl string is not match format (#5494)
4236b70070c is described below
commit 4236b70070ce2ba8edf4358c4738d6c8cdb64c2b
Author: chaijunjie0101 <64...@users.noreply.github.com>
AuthorDate: Mon Nov 6 10:32:19 2023 +0800
HBASE-28185 Alter table to set TTL using hbase shell failed when ttl string is not match format (#5494)
Signed-off-by: Duo Zhang <zh...@apache.org>
(cherry picked from commit 027a119bcf495e18b3e0fa4984f8982b9ed1390d)
---
.../src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java
index f73064f70a8..1b19bd25287 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/PrettyPrinter.java
@@ -184,7 +184,11 @@ public final class PrettyPrinter {
hours = matcher.group(6);
minutes = matcher.group(8);
seconds = matcher.group(10);
+ } else {
+ LOG.warn("Given interval value '{}' is not a number and does not match human readable format,"
+ + " value will be set to 0.", humanReadableInterval);
}
+
ttl = 0;
ttl += days != null ? Long.parseLong(days) * HConstants.DAY_IN_SECONDS : 0;
ttl += hours != null ? Long.parseLong(hours) * HConstants.HOUR_IN_SECONDS : 0;