gjacoby126 commented on a change in pull request #735: PHOENIX-5734 - 
IndexScrutinyTool should not report rows beyond maxLoo…
URL: https://github.com/apache/phoenix/pull/735#discussion_r395880099
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/util/SchemaUtil.java
 ##########
 @@ -1183,6 +1186,22 @@ public static int getIsNullableInt(boolean isNullable) {
                return isNullable ? ResultSetMetaData.columnNullable : 
ResultSetMetaData.columnNoNulls;
        }
 
+       public static int getTimeToLive(PhoenixConnection conn, String 
physicalName) throws SQLException {
+        byte[] tableQualifier = Bytes.toBytes(physicalName);
+        return getTimeToLive(conn, tableQualifier);
+    }
+
+    public static int getTimeToLive(PhoenixConnection conn, byte[] 
tableQualifier)
+     throws SQLException {
+        HTableDescriptor td = 
conn.getQueryServices().getTableDescriptor(tableQualifier);
+        HColumnDescriptor[] cds = td.getColumnFamilies();
+        if (cds.length > 0){
+            return cds[0].getTimeToLive();
+        } else {
+            return HConstants.FOREVER;
 
 Review comment:
   I couldn't think of one, but decided to code the function defensively. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to