Github user vincentpoon commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/290#discussion_r164211639
--- Diff:
phoenix-core/src/main/java/org/apache/phoenix/optimize/QueryOptimizer.java ---
@@ -312,6 +317,16 @@ private static QueryPlan addPlan(PhoenixStatement
statement, SelectStatement sel
return null;
}
+ // returns true if we can still use the index
+ // retuns false if we've been in PENDING_DISABLE too long - index
should be considered disabled
+ private static boolean isUnderPendingDisableThreshold(PhoenixStatement
statement, PTable indexTable) {
+ return EnvironmentEdgeManager
+ .currentTimeMillis() -
indexTable.getIndexDisableTimestamp() <= statement
--- End diff --
I wanted to add a member variable to hold the threshold, but these methods
are static, and I wasn't sure if adding a mutable static was advisable. The
call to isUnderPendingDIsableThreshold() is the last thing in the if-statement,
so this only gets called in a PENDING_DISABLE scenario. I'll add the
optimization to use ReadOnlyProps, and use the client-side timestamp
---