You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2013/09/16 17:11:32 UTC
svn commit: r1523694 - in /lucene/dev/branches/branch_4x: ./ solr/
solr/CHANGES.txt solr/core/
solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
Author: markrmiller
Date: Mon Sep 16 15:11:31 2013
New Revision: 1523694
URL: http://svn.apache.org/r1523694
Log:
SOLR-5150: HdfsIndexInput may not fully read requested bytes.
Modified:
lucene/dev/branches/branch_4x/ (props changed)
lucene/dev/branches/branch_4x/solr/ (props changed)
lucene/dev/branches/branch_4x/solr/CHANGES.txt (contents, props changed)
lucene/dev/branches/branch_4x/solr/core/ (props changed)
lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
Modified: lucene/dev/branches/branch_4x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/CHANGES.txt?rev=1523694&r1=1523693&r2=1523694&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/solr/CHANGES.txt Mon Sep 16 15:11:31 2013
@@ -233,6 +233,8 @@ Bug Fixes
can fail if some nodes of the deleted shard were down and had incorrect logging.
(Christine Poerschke, shalin)
+* SOLR-5150: HdfsIndexInput may not fully read requested bytes. (Mark Miller, Patrick Hunt)
+
Optimizations
----------------------
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java?rev=1523694&r1=1523693&r2=1523694&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/store/hdfs/HdfsDirectory.java Mon Sep 16 15:11:31 2013
@@ -110,7 +110,7 @@ public class HdfsDirectory extends BaseD
}
private IndexInput openInput(String name, int bufferSize) throws IOException {
- return new HdfsNormalIndexInput(name, getFileSystem(), new Path(
+ return new HdfsIndexInput(name, getFileSystem(), new Path(
hdfsDirPath, name), BUFFER_SIZE);
}
@@ -165,16 +165,16 @@ public class HdfsDirectory extends BaseD
return configuration;
}
- static class HdfsNormalIndexInput extends CustomBufferedIndexInput {
+ static class HdfsIndexInput extends CustomBufferedIndexInput {
public static Logger LOG = LoggerFactory
- .getLogger(HdfsNormalIndexInput.class);
+ .getLogger(HdfsIndexInput.class);
private final Path path;
private final FSDataInputStream inputStream;
private final long length;
private boolean clone = false;
- public HdfsNormalIndexInput(String name, FileSystem fileSystem, Path path,
+ public HdfsIndexInput(String name, FileSystem fileSystem, Path path,
int bufferSize) throws IOException {
super(name);
this.path = path;
@@ -187,12 +187,12 @@ public class HdfsDirectory extends BaseD
@Override
protected void readInternal(byte[] b, int offset, int length)
throws IOException {
- inputStream.read(getFilePointer(), b, offset, length);
+ inputStream.readFully(getFilePointer(), b, offset, length);
}
@Override
protected void seekInternal(long pos) throws IOException {
- inputStream.seek(pos);
+
}
@Override
@@ -210,7 +210,7 @@ public class HdfsDirectory extends BaseD
@Override
public IndexInput clone() {
- HdfsNormalIndexInput clone = (HdfsNormalIndexInput) super.clone();
+ HdfsIndexInput clone = (HdfsIndexInput) super.clone();
clone.clone = true;
return clone;
}