use of org.apache.flink.runtime.io.disk.iomanager.FileIOChannel in project flink by apache.
the class SpillChannelManager method close.
@Override
public synchronized void close() {
if (this.closed) {
return;
}
this.closed = true;
for (Iterator<FileIOChannel> channels = this.openChannels.iterator(); channels.hasNext(); ) {
final FileIOChannel channel = channels.next();
channels.remove();
try {
channel.closeAndDelete();
} catch (Throwable ignored) {
}
}
for (Iterator<FileIOChannel.ID> channels = this.channels.iterator(); channels.hasNext(); ) {
final FileIOChannel.ID channel = channels.next();
channels.remove();
try {
final File f = new File(channel.getPath());
if (f.exists()) {
f.delete();
}
} catch (Throwable ignored) {
}
}
}
Aggregations