Proposal implementation of IOResource #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following the discussion today, I did some changes to the idea in #42 and provide an implementation instead of a document to show my point. The idea is:
file
/null
schemes are reserved for default, which isjava.nio.Path
. This has the following advantages:java.nio.Path
. For example, an use case is the GenomicDB, that could be specified asgendb:hdfs://${path}
orgendb:${local_path}
or SRA accessions/files.FileSystemProviders
IOResourceFactory
get methods. Registering ofIOResourceProvider
could be done by either the service API or directly in the factory. Default implementation (java.nio.Path
) is not exposed, and could not be overwriten. This allows to fallback to thejava.nio.Path
in every case, and to be flexible enough to get users define their own providers.A custom implementation of an
IOResource
might look as this:And a consumer will use it in this way (too many assumptions in this case, because we don't have any idea on how we will implement the high-level record interfaces, but the reader/writer will take care if the
IOResource
- scheme and/or input/output):This is the alternative that I have in mind instead of #34.