Skip to content

Commit

Permalink
PHOENIX-5881 - Port PHOENIX-5645 (MaxLookbackAge) to 5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
gjacoby126 committed Aug 19, 2020
1 parent 0969403 commit bf40d12
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,11 @@ private void verifySCN() throws SQLException {
}
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 maxLookBackAgeInMillis =
CompatBaseScannerRegionObserver.getMaxLookbackInMillis(conn.getQueryServices().
getConfiguration());
long now = EnvironmentEdgeManager.currentTimeMillis();
if (maxLookBackAge > 0 && now - maxLookBackAge * 1000L > scn){
if (maxLookBackAgeInMillis > 0 && now - maxLookBackAgeInMillis > scn){
throw new SQLExceptionInfo.Builder(
SQLExceptionCode.CANNOT_QUERY_TABLE_WITH_SCN_OLDER_THAN_MAX_LOOKBACK_AGE)
.build().buildException();
Expand Down

0 comments on commit bf40d12

Please sign in to comment.