keith-turner commented on code in PR #6128:
URL: https://github.com/apache/accumulo/pull/6128#discussion_r2818144008
##########
server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java:
##########
@@ -230,26 +230,29 @@ class EventHandler implements EventCoordinator.Listener {
// created, so just start off with full scan.
private boolean needsFullScan = true;
- private final BlockingQueue<Range> rangesToProcess;
+ private final EventQueue eventQueue;
- class RangeProccessor implements Runnable {
+ class RangeProcessor implements Runnable {
@Override
public void run() {
try {
while (manager.stillManager()) {
- var range = rangesToProcess.poll(100, TimeUnit.MILLISECONDS);
- if (range == null) {
+ var events = eventQueue.poll(100, TimeUnit.MILLISECONDS);
+
+ if (events.isEmpty()) {
// check to see if still the manager
continue;
}
- ArrayList<Range> ranges = new ArrayList<>();
- ranges.add(range);
-
- rangesToProcess.drainTo(ranges);
-
- if (!processRanges(ranges)) {
+ if (events.stream().map(Event::getScope)
+ .anyMatch(s -> s == EventScope.ALL || s ==
EventScope.DATA_LEVEL)) {
setNeedsFullScan();
+ } else {
+ var ranges =
+
events.stream().map(Event::getExtent).map(KeyExtent::toMetaRange).toList();
Review Comment:
Removed the streams in 4e4e63a which avoided making two passes over the data
and made it possible to add some checks for unexpected cases.
--
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]