SOLR-4916: Fix bugs & usage of NullIndexOutput

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1502167 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2013-07-11 09:34:36 +00:00
parent f4557be8c1
commit 748cb61e82
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,6 @@ public class HdfsDirectory extends Directory {
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 Directory {
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));

View File

@ -49,6 +49,7 @@ public class NullIndexOutput extends IndexOutput {
@Override
public void writeByte(byte b) throws IOException {
pos++;
updateLength();
}
@Override