mirror of https://github.com/apache/lucene.git
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:
parent
f4557be8c1
commit
748cb61e82
|
@ -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));
|
||||
|
|
|
@ -49,6 +49,7 @@ public class NullIndexOutput extends IndexOutput {
|
|||
@Override
|
||||
public void writeByte(byte b) throws IOException {
|
||||
pos++;
|
||||
updateLength();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue