* @throws Exception if failed
*/
@Test
public void input() throws Exception {
final int count = 10000;
LocalFileSystem fs = FileSystem.getLocal(conf);
Path path = new Path(folder.newFile("testing").toURI());
SequenceFile.Writer writer = SequenceFile.createWriter(fs, conf, path, LongWritable.class, Text.class);
try {
LongWritable k = new LongWritable();
Text v = new Text();
for (int i = 0; i < count; i++) {
k.set(i);
v.set("Hello, world at " + i);
writer.append(k, v);
}
} finally {
writer.close();
}
ModelInput<StringOption> in = format.createInput(
StringOption.class,
fs,
path,
0,
fs.getFileStatus(path).getLen(),
new Counter());
try {
StringOption value = new StringOption();
for (int i = 0; i < count; i++) {
String answer = "Hello, world at " + i;