You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2013/07/11 11:34:37 UTC
svn commit: r1502167 - in
/lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs:
HdfsDirectory.java NullIndexOutput.java
Author: uschindler
Date: Thu Jul 11 09:34:36 2013
New Revision: 1502167
URL: http://svn.apache.org/r1502167
Log:
SOLR-4916: Fix bugs & usage of NullIndexOutput
Modified:
lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/NullIndexOutput.java
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java?rev=1502167&r1=1502166&r2=1502167&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java Thu Jul 11 09:34:36 2013
@@ -45,7 +45,6 @@ public class HdfsDirectory extends Direc
private static final String LF_EXT = ".lf";
protected static final String SEGMENTS_GEN = "segments.gen";
- protected static final IndexOutput NULL_WRITER = new NullIndexOutput();
protected Path hdfsDirPath;
protected Configuration configuration;
@@ -79,7 +78,7 @@ public class HdfsDirectory extends Direc
public IndexOutput createOutput(String name, IOContext context)
throws IOException {
if (SEGMENTS_GEN.equals(name)) {
- return NULL_WRITER;
+ return new NullIndexOutput();
}
HdfsFileWriter writer = new HdfsFileWriter(getFileSystem(), new Path(
hdfsDirPath, name));
Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/NullIndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/NullIndexOutput.java?rev=1502167&r1=1502166&r2=1502167&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/NullIndexOutput.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/store/hdfs/NullIndexOutput.java Thu Jul 11 09:34:36 2013
@@ -49,6 +49,7 @@ public class NullIndexOutput extends Ind
@Override
public void writeByte(byte b) throws IOException {
pos++;
+ updateLength();
}
@Override