Skip to content

Commit 55fee71

Browse files
committed
HBASE-29726 Allow updating time limit on ScannerContext
1 parent 4ba9b46 commit 55fee71

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ScannerContext.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,18 @@ void setSizeLimitScope(LimitScope scope) {
321321
limits.setSizeScope(scope);
322322
}
323323

324+
/**
325+
* Update the time limit.
326+
* If the new limit would be later than the current one or would be in the past then do nothing.
327+
*
328+
* @param timeLimit The new time limit in milliseconds.
329+
*/
330+
void setTimeLimit(long newLimit) {
331+
if (newLimit < limits.getTime() && newLimit > EnvironmentEdgeManager.currentTime()) {
332+
limits.setTime(newLimit);
333+
}
334+
}
335+
324336
/**
325337
* @param scope The scope in which the time limit will be enforced
326338
*/

0 commit comments

Comments
 (0)