MAPREDUCE-5866. Merging change r1608585 from trunk to branch-2.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1608588 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
29099c8a5c
commit
00ff3d320a
|
@ -12,6 +12,9 @@ Release 2.6.0 - UNRELEASED
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
|
|
||||||
|
MAPREDUCE-5866. TestFixedLengthInputFormat fails in windows.
|
||||||
|
(Varun Vasudev via cnauroth)
|
||||||
|
|
||||||
Release 2.5.0 - UNRELEASED
|
Release 2.5.0 - UNRELEASED
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -372,10 +372,13 @@ public class TestFixedLengthInputFormat {
|
||||||
format.getRecordReader(split, job, voidReporter);
|
format.getRecordReader(split, job, voidReporter);
|
||||||
LongWritable key = reader.createKey();
|
LongWritable key = reader.createKey();
|
||||||
BytesWritable value = reader.createValue();
|
BytesWritable value = reader.createValue();
|
||||||
while (reader.next(key, value)) {
|
try {
|
||||||
result.add(new String(value.getBytes(), 0, value.getLength()));
|
while (reader.next(key, value)) {
|
||||||
|
result.add(new String(value.getBytes(), 0, value.getLength()));
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
reader.close();
|
||||||
}
|
}
|
||||||
reader.close();
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -417,15 +417,18 @@ public class TestFixedLengthInputFormat {
|
||||||
new MapContextImpl<LongWritable, BytesWritable, LongWritable,
|
new MapContextImpl<LongWritable, BytesWritable, LongWritable,
|
||||||
BytesWritable>(job.getConfiguration(), context.getTaskAttemptID(),
|
BytesWritable>(job.getConfiguration(), context.getTaskAttemptID(),
|
||||||
reader, null, null, MapReduceTestUtil.createDummyReporter(), split);
|
reader, null, null, MapReduceTestUtil.createDummyReporter(), split);
|
||||||
reader.initialize(split, mcontext);
|
|
||||||
LongWritable key;
|
LongWritable key;
|
||||||
BytesWritable value;
|
BytesWritable value;
|
||||||
while (reader.nextKeyValue()) {
|
try {
|
||||||
key = reader.getCurrentKey();
|
reader.initialize(split, mcontext);
|
||||||
value = reader.getCurrentValue();
|
while (reader.nextKeyValue()) {
|
||||||
result.add(new String(value.getBytes(), 0, value.getLength()));
|
key = reader.getCurrentKey();
|
||||||
|
value = reader.getCurrentValue();
|
||||||
|
result.add(new String(value.getBytes(), 0, value.getLength()));
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
reader.close();
|
||||||
}
|
}
|
||||||
reader.close();
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue