carlspring / s3fs-nio

A Java (NIO2) FileSystem Provider for Amazon AWS S3.
https://s3fs-nio.carlspring.org/
66 stars 24 forks source link

Configuration + S3FileSystem + S3FileSystemProvider refactoring #194

Open carlspring opened 3 years ago

carlspring commented 3 years ago

Task Description

The current implementation of the configuration is not flexible enough. It also requires you to pass properties around. The way that the properties are loaded for testing and production is different. We should implement a S3FileSystemConfiguration and use this instead of the properties/hash maps.

When creating a new S3Path, at the moment, you always have to specify the bucket like this:

S3Path path = s3FileSystem.getPath("/bucketA", "dir");

This is very inconvenient. The S3FileSystemProvider needs to be able to resolve this via the S3FileSystemConfiguration. Google's NIO2 FileSystem implementation does not require you to specify the bucket and we should follow this approach as well.

We need to come up with better solutions for the current implementations.

This is the master task for the work.

Tasks

The following tasks will need to be carried out:

Task Relationships

This task:

Help

carlspring commented 3 years ago

Some similar things have been done in #192, however, this is only addressing (in a similar way) the problem from a test-related point-of-view. Since we'll be doing such a major refactoring, it doesn't make sense to do it in one way for the tests and in another way for the production code.

The good news, however, @mslowiak , is that we appear to be on the same page as to how this should be implemented. Please, bear with me until I've worked out most of the details on how we should approach this. I have pushed my incomplete (and therefore not fully working changes) to the massive-provider-refactoring branch. This branch will only serve as a reference of what I think we should do. We will cherry pick some of the changes from there and try to finish the work that I began (but lacked the time to properly finish on my own). It has not yet been rebased.

mslowiak commented 3 years ago

Yeah, it looks like we have a similar point of view. I would be really happy to help with that. Catch me on chat if the code will be ready for some refactoring stuff @carlspring.