Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-1145: handle parentless infoStream file, move example to mainIndex, uncomment and set to false by default.

Yonik Seeleyd87d335af8e7
diff --git a/example/solr/conf/solrconfig.xml b/example/solr/conf/solrconfig.xml
index 9f317269e93..e2c0a48e054 100755
--- a/example/solr/conf/solrconfig.xml
+++ b/example/solr/conf/solrconfig.xml
@@ -87,10 +87,6 @@
-->
<!--<mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>-->
- <!-- To aid in advanced debugging, you may turn on IndexWriter debug logging.
- Uncommenting this and setting to true will set the file that the underlying
- Lucene IndexWriter will write its debug infostream to. -->
- <!-- <infoStream file="/path/file">false</infoStream> -->
<!--
This option specifies which Lucene LockFactory implementation to use.
@@ -165,6 +161,11 @@
-->
</deletionPolicy>
+ <!-- To aid in advanced debugging, you may turn on IndexWriter debug logging.
+ Setting to true will set the file that the underlying Lucene IndexWriter
+ will write its debug infostream to. -->
+ <infoStream file="INFOSTREAM.txt">false</infoStream>
+
</mainIndex>
<!-- Enables JMX if and only if an existing MBeanServer is found, use this
diff --git a/src/java/org/apache/solr/update/SolrIndexWriter.java b/src/java/org/apache/solr/update/SolrIndexWriter.java
index 9271ac3245c..26f4bc006c9 100644
--- a/src/java/org/apache/solr/update/SolrIndexWriter.java
+++ b/src/java/org/apache/solr/update/SolrIndexWriter.java
@@ -99,7 +99,8 @@ public class SolrIndexWriter extends IndexWriter {
String infoStreamFile = config.infoStreamFile;
if (infoStreamFile != null) {
File f = new File(infoStreamFile);
- f.getParentFile().mkdirs();
+ File parent = f.getParentFile();
+ if (parent != null) parent.mkdirs();
FileOutputStream fos = new FileOutputStream(f, true);
infoStream = new TimeLoggingPrintStream(fos, true);
setInfoStream(infoStream);