10421043104410451046104710481049
possibleMergeNeeded = false; try (InternalLock _ = readLock.acquire()) { currentIndexWriter().maybeMerge(); } catch (Throwable t) { maybeFailEngine(t, "maybe_merge"); throw new OptimizeFailedEngineException(shardId, t); } }
10501051105210531054105510561057105810591060
private void waitForMerges(boolean flushAfter) { try { currentIndexWriter().waitForMerges(); } catch (IOException e) { throw new OptimizeFailedEngineException(shardId, e); } if (flushAfter) { flush(new Flush().force(true).waitIfOngoing(true)); } }
10861087108810891090109110921093109410951096
} else { writer.forceMerge(optimize.maxNumSegments(), false); } } catch (Throwable t) { maybeFailEngine(t, "optimize"); throw new OptimizeFailedEngineException(shardId, t); } finally { optimizeMutex.set(false); } }