[
https://issues.apache.org/jira/browse/LUCENE-6119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14264402#comment-14264402
]
Adrien Grand commented on LUCENE-6119:
--------------------------------------
I was never sure what a good value for the rate limiter would be so I'm very
happy to see Lucene take care of it by itself. :-)
{code}
+ /** true if we should rate-limit writes for each merge; false if not. null
means use dynamic default: */
+ private boolean doAutoIOThrottle = true;
{code}
I think the comment is outdated since doAutoIOThrottle is a boolean now
(instead of a Boolean)? There is a similar leftover a couple of lines below I
think: {{if (doAutoIOThrottle == Boolean.TRUE)}}
{code}
+ /** Set by {@link IndexWriter} to rate limit writes and abort this merge.
*/
+ public final MergeRateLimiter rateLimiter;
{code}
I think the comment is a bit confusing since this property is not actually set
by the index writer?
{code}
/** Returns 0 if no pause happened, 1 if pause because rate was 0.0 (merge is
paused), 2 if paused with a normal rate limit. */
private synchronized int maybePause(long bytes, long curNS) throws
MergePolicy.MergeAbortedException
{code}
Maybe having constants or an enum would make the code easier to read?
> Add auto-io-throttle to ConcurrentMergeScheduler
> ------------------------------------------------
>
> Key: LUCENE-6119
> URL: https://issues.apache.org/jira/browse/LUCENE-6119
> Project: Lucene - Core
> Issue Type: Improvement
> Reporter: Michael McCandless
> Assignee: Michael McCandless
> Fix For: 5.0, Trunk
>
> Attachments: LUCENE-6119.patch, LUCENE-6119.patch, LUCENE-6119.patch,
> LUCENE-6119.patch, LUCENE-6119.patch
>
>
> This method returns number of "incoming" bytes IW has written since it
> was opened, excluding merging.
> It tracks flushed segments, new commits (segments_N), incoming
> files/segments by addIndexes, newly written live docs / doc values
> updates files.
> It's an easy statistic for IW to track and should be useful to help
> applications more intelligently set defaults for IO throttling
> (RateLimiter).
> For example, an application that does hardly any indexing but finally
> triggered a large merge can afford to heavily throttle that large
> merge so it won't interfere with ongoing searches.
> But an application that's causing IW to write new bytes at 50 MB/sec
> must set a correspondingly higher IO throttling otherwise merges will
> clearly fall behind.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]