[ https://issues.apache.org/jira/browse/LUCENE-5951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14250219#comment-14250219 ]
Hoss Man commented on LUCENE-5951: ---------------------------------- {noformat} + public static int AUTO_DETECT_MERGES_AND_THREADS = -1; {noformat} ...that's suppose to be a final (sentinel value) correct? nothing should be allowed modify it at run time? {noformat} + public synchronized void setMaxMergesAndThreads(int maxMergeCount, int maxThreadCount) { + if (maxMergeCount == AUTO_DETECT_MERGES_AND_THREADS && maxThreadCount == AUTO_DETECT_MERGES_AND_THREADS) { + // OK + maxMergeCount = AUTO_DETECT_MERGES_AND_THREADS; + maxThreadCount = AUTO_DETECT_MERGES_AND_THREADS; {noformat} ...is that suppose to be setting this.maxMergeCount and this.maxThreadCount ? ... it looks like it it's just a No-Op (and this.maxMergeCount and this.maxThreadCount never get set in this case?) {noformat} + public static boolean spins(Path path) throws IOException { {noformat} ...is it worth using a terinary enum (or "nullable "Boolean") here to track the diff between: * confident it's a spinning disk * confident it's not a spinning disk * unknown what type of storage this is ...that way we can make the default behavior of CMS conservative, and only be aggressive if we are confident it's not-spinning; but app devs can be more aggressive -- call the same spins() utility and only use conservative values if they are confident it's a spinning disk, otherwise call setMaxMergesAndThreads with higher values. > Detect when index is on SSD and set dynamic defaults > ---------------------------------------------------- > > Key: LUCENE-5951 > URL: https://issues.apache.org/jira/browse/LUCENE-5951 > Project: Lucene - Core > Issue Type: Improvement > Reporter: Michael McCandless > Assignee: Michael McCandless > Attachments: LUCENE-5951.patch, LUCENE-5951.patch, LUCENE-5951.patch > > > E.g. ConcurrentMergeScheduler should default maxMergeThreads to 3 if it's on > SSD and 1 if it's on spinning disks. > I think the new NIO2 APIs can let us figure out which device we are mounted > on, and from there maybe we can do os-specific stuff e.g. look at > /sys/block/dev/queue/rotational to see if it's spinning storage or not ... -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org