A DataStore can be connected to a big file through internet, for example if the file is a Cloud Optimized GeoTIFF (COG). This is reasonably efficient if the server support HTTP ranges. But if the GeoTiffStore (for example) is connected to a big TIFF on a server that do not support HTTP range, it may download a large amount of data. We need a way to interrupt that.
Implementing an abort() method would be a significant amount of work. But as a mid-term solution, we need to at least get DataStore.close() to work asynchronously. In current DataStore implementations, close() is a synchronized method which blocks until the reading process is completed. We should invoke Channel.close() before to enter in the synchronized block. It will allow java.nio.channels.AsynchronousCloseException to be thrown and interrupt the reading process.