|
19 | 19 |
|
20 | 20 | package org.apache.jackrabbit.oak.plugins.index.lucene; |
21 | 21 |
|
22 | | -import org.apache.jackrabbit.guava.common.collect.Maps; |
23 | 22 | import org.apache.jackrabbit.oak.api.CommitFailedException; |
24 | 23 | import org.apache.jackrabbit.oak.api.jmx.CheckpointMBean; |
25 | 24 | import org.apache.jackrabbit.oak.api.jmx.IndexStatsMBean; |
|
47 | 46 | import java.util.concurrent.Callable; |
48 | 47 | import java.util.concurrent.Executor; |
49 | 48 | import java.util.concurrent.TimeUnit; |
| 49 | +import java.util.function.Function; |
50 | 50 | import java.util.stream.Collectors; |
51 | 51 | import java.util.stream.StreamSupport; |
52 | 52 |
|
@@ -212,25 +212,25 @@ public void flagActiveDeletionSafe() { |
212 | 212 | * @return true if all running index cycles have been through; false otherwise |
213 | 213 | */ |
214 | 214 | private boolean waitForRunningIndexCycles() { |
215 | | - Map<IndexStatsMBean, Long> origIndexLaneToExecutinoCountMap = Maps.asMap( |
216 | | - new HashSet<>(StreamSupport.stream(asyncIndexInfoService.getAsyncLanes().spliterator(), false) |
217 | | - .map(lane -> asyncIndexInfoService.getInfo(lane).getStatsMBean()) |
218 | | - .filter(bean -> { |
219 | | - String beanStatus; |
220 | | - try { |
221 | | - if (bean != null) { |
222 | | - beanStatus = bean.getStatus(); |
223 | | - } else { |
224 | | - return false; |
225 | | - } |
226 | | - } catch (Exception e) { |
227 | | - LOG.warn("Exception during getting status for {}. Ignoring this indexer lane", bean.getName(), e); |
228 | | - return false; |
229 | | - } |
230 | | - return STATUS_RUNNING.equals(beanStatus); |
231 | | - }) |
232 | | - .collect(Collectors.toList())), |
233 | | - IndexStatsMBean::getTotalExecutionCount); |
| 215 | + Map<IndexStatsMBean, Long> origIndexLaneToExecutinoCountMap = new HashSet<>(StreamSupport.stream(asyncIndexInfoService.getAsyncLanes().spliterator(), false) |
| 216 | + .map(lane -> asyncIndexInfoService.getInfo(lane).getStatsMBean()) |
| 217 | + .filter(bean -> { |
| 218 | + String beanStatus; |
| 219 | + try { |
| 220 | + if (bean != null) { |
| 221 | + beanStatus = bean.getStatus(); |
| 222 | + } else { |
| 223 | + return false; |
| 224 | + } |
| 225 | + } catch (Exception e) { |
| 226 | + LOG.warn("Exception during getting status for {}. Ignoring this indexer lane", bean.getName(), e); |
| 227 | + return false; |
| 228 | + } |
| 229 | + return STATUS_RUNNING.equals(beanStatus); |
| 230 | + }) |
| 231 | + .collect(Collectors.toList())) |
| 232 | + .stream() |
| 233 | + .collect(Collectors.toMap(Function.identity(), IndexStatsMBean::getTotalExecutionCount)); |
234 | 234 |
|
235 | 235 | if (!origIndexLaneToExecutinoCountMap.isEmpty()) { |
236 | 236 | LOG.info("Found running index lanes ({}). Sleep a bit before continuing.", |
|
0 commit comments