|
@@ -128,7 +128,7 @@ public class DistributedFSCheck extends TestCase {
|
|
if (rootStatus.isFile()) {
|
|
if (rootStatus.isFile()) {
|
|
nrFiles++;
|
|
nrFiles++;
|
|
// For a regular file generate <fName,offset> pairs
|
|
// For a regular file generate <fName,offset> pairs
|
|
- long blockSize = fs.getDefaultBlockSize();
|
|
|
|
|
|
+ long blockSize = fs.getDefaultBlockSize(rootFile);
|
|
long fileLength = rootStatus.getLen();
|
|
long fileLength = rootStatus.getLen();
|
|
for(long offset = 0; offset < fileLength; offset += blockSize)
|
|
for(long offset = 0; offset < fileLength; offset += blockSize)
|
|
writer.append(new Text(rootFile.toString()), new LongWritable(offset));
|
|
writer.append(new Text(rootFile.toString()), new LongWritable(offset));
|
|
@@ -160,15 +160,16 @@ public class DistributedFSCheck extends TestCase {
|
|
) throws IOException {
|
|
) throws IOException {
|
|
// open file
|
|
// open file
|
|
FSDataInputStream in = null;
|
|
FSDataInputStream in = null;
|
|
|
|
+ Path p = new Path(name);
|
|
try {
|
|
try {
|
|
- in = fs.open(new Path(name));
|
|
|
|
|
|
+ in = fs.open(p);
|
|
} catch(IOException e) {
|
|
} catch(IOException e) {
|
|
return name + "@(missing)";
|
|
return name + "@(missing)";
|
|
}
|
|
}
|
|
in.seek(offset);
|
|
in.seek(offset);
|
|
long actualSize = 0;
|
|
long actualSize = 0;
|
|
try {
|
|
try {
|
|
- long blockSize = fs.getDefaultBlockSize();
|
|
|
|
|
|
+ long blockSize = fs.getDefaultBlockSize(p);
|
|
reporter.setStatus("reading " + name + "@" +
|
|
reporter.setStatus("reading " + name + "@" +
|
|
offset + "/" + blockSize);
|
|
offset + "/" + blockSize);
|
|
for( int curSize = bufferSize;
|
|
for( int curSize = bufferSize;
|