public void io_fragment() throws Exception {
File file = folder.newFile();
Assume.assumeThat(file.delete() || file.exists() == false, is(true));
ParquetFileFormat<MockSimple> format = format(MockSimple.class);
LocalFileSystem fs = FileSystem.getLocal(format.getConf());
ModelOutput<MockSimple> output = format.createOutput(
MockSimple.class,
fs, new Path(file.toURI()),
new Counter());
try {
output.write(new MockSimple(100, "Hello, world!"));
} finally {
output.close();
}
assertThat(file.exists(), is(true));
FileStatus stat = fs.getFileStatus(new Path(file.toURI()));
List<DirectInputFragment> fragments = format.computeInputFragments(new StripedDataFormat.InputContext(
MockSimple.class,
Arrays.asList(stat), fs,
-1L, -1L,
false, false));