microstream-one / examples

10 stars 4 forks source link

Change Request: Example for an in-memory file system setup with microstream #23

Closed marcelbaumann closed 3 years ago

marcelbaumann commented 3 years ago

Hello

I write all my unit and integration tests with an in-memory file system (in my case jimfs). I found a hint in the documentation

        NioFileSystem msFs = NioFileSystem.New();
        EmbeddedStorageManager storageManager = EmbeddedStorage.start(msFs.ensureDirectoryPath("path', "to", "storage"); 
        // But I would at least need to provide a jimfs path to ensureDirectoryPath to connect to jimfs file system

So I am struggling how to connect the NioFileSystem to the jimfs file system. The documentation shows various examples for databases but I could not find an example for an in-memory file system.

Could it be worth the time to add an example showing how to do it? I assume that quite a few developers use in-memory file system for tests run through a CI pipeline.

Sincerely

hg-ms commented 3 years ago

Hello Thank you very much for your proposal.

At the moment it would require implementing quite a lot of code to do that without some changes to the current Microstream implementation. We just decided to do some refactoring to make the usage of other Java.nio.file based file systems more easy.

Best regards

marcelbaumann commented 3 years ago

Hello

Thanks for the prompt answer. I am looking forward to a future release which more easily supports in-memory file systems.

fh-ms commented 3 years ago

Jimfs example online now: https://github.com/microstream-one/examples/blob/master/filesystems/src/main/java/one/microstream/sampler/filesystems/nio/NioFilesystemJimfs.java