swaroopak commented on a change in pull request #857:
URL: https://github.com/apache/phoenix/pull/857#discussion_r473351996
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/compile/QueryCompiler.java
##########
@@ -172,6 +178,28 @@ public QueryPlan compile() throws SQLException{
return plan;
}
+ private void verifySCN() throws SQLException {
+ if (!HbaseCompatCapabilities.isMaxLookbackTimeSupported()) {
+ return;
+ }
+ PhoenixConnection conn = statement.getConnection();
+ Long scn = conn.getSCN();
+ if (scn == null) {
+ return;
+ }
+ ColumnResolver resolver =
+ FromCompiler.getResolverForQuery(select, conn);
+ int maxLookBackAge = conn.getQueryServices().
+
getConfiguration().getInt(CompatBaseScannerRegionObserver.PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY,
+ CompatBaseScannerRegionObserver.DEFAULT_PHOENIX_MAX_LOOKBACK_AGE);
+ long now = EnvironmentEdgeManager.currentTimeMillis();
+ if (maxLookBackAge > 0 && now - maxLookBackAge * 1000L > scn){
Review comment:
maxLookBackAge*1000 can be stored into a variable like done for ttl in
other function.
----------------------------------------------------------------
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:
[email protected]