FSDataInputStream in = dfs.open(fpath);
in.read(new byte[512]);
// By closing the pipeline connection, force a block recovery
InjectionHandler.set(new InjectionHandler() {
int thrownCount = 0;
@Override
protected void _processEventIO(InjectionEventI event, Object... args)
throws IOException {
if (event == InjectionEvent.DFSCLIENT_DATASTREAM_AFTER_WAIT
&& thrownCount < 1) {
thrownCount++;
MultiDataOutputStream blockStream = (MultiDataOutputStream) args[0];
blockStream.close();
}
}
});
out.write(new byte[512 * 2]);
out.sync();
InjectionHandler.set(new InjectionHandler() {
int thrownCount = 0;
@SuppressWarnings("unchecked")
@Override
protected void _processEventIO(InjectionEventI event, Object... args)