sanjeet006py commented on code in PR #1751:
URL: https://github.com/apache/phoenix/pull/1751#discussion_r1499781459


##########
phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/BaseScannerRegionObserver.java:
##########
@@ -527,6 +535,28 @@ public static boolean isMaxLookbackTimeEnabled(long 
maxLookbackTime){
         return maxLookbackTime > 0L;
     }
 
+    public static long 
getMaxLookbackAge(ObserverContext<RegionCoprocessorEnvironment> c) {
+        TableName tableName = 
c.getEnvironment().getRegion().getRegionInfo().getTable();
+        String fullTableName = tableName.getNameAsString();
+        Configuration conf = c.getEnvironment().getConfiguration();
+        PTable table;
+        try(PhoenixConnection conn = QueryUtil.getConnectionOnServer(
+                conf).unwrap(PhoenixConnection.class)) {
+            table = conn.getTableNoCache(fullTableName);
+        }
+        catch (Exception e) {
+            if (e instanceof TableNotFoundException) {
+                LOGGER.debug("Ignoring HBase table that is not a Phoenix 
table: "
+                        + fullTableName);
+                // non-Phoenix HBase tables won't be found, do nothing

Review Comment:
   > What is the alternative approach?
   
   In `TransformClient` we derive new table name from existing table name. I 
saw we are appending sequence num to eixtsing table's full name separated by 
underscore. I added a logic to derive logical table name from physical table 
name by checking if physical table is underscore separated and if part of table 
name before underscore is valid logical table name in SYSCAT along with 
checking if the logical table found has physical table as original physical 
table name.
   
   I thought this will avoid FULL SCAN and max be one RPC call but any READ 
operation on any table even if we create an index will be at least one RPC 
call. Please correct me if I misunderstood something. Thanks



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to