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


##########
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);

Review Comment:
   It's perf improvement depending on the size of the string. When heavy 
objects are to be logged and if we use non-param version, the string 
concatenation happens even though the given logger level is not enabled (e.g. 
even if log level is INFO and the above DEBUG log is not going to be printed, 
the string concatenation still happens), whereas if we use parameterized 
version, the string concatenation happens only if the given logger level is 
enabled and the log is expected to be printed. With parameterized version, the 
string concatenation takes place within log4j implementation.



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