This is an automated email from the ASF dual-hosted git repository.

zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new e6f269b9b3e HBASE-28185 Alter table to set TTL using hbase shell 
failed when ttl string is not match format (#5494)
e6f269b9b3e is described below

commit e6f269b9b3e7f341ec40e4196cb334eb577d2c8a
Author: chaijunjie0101 <64140218+chaijunjie0...@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 <zhang...@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 d5b3f894a7f..516f788f0b8 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
@@ -173,7 +173,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;

Reply via email to