Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

In-Memory Provider for Object and Metadata storage #37

Merged
merged 3 commits into from
Apr 24, 2017

Conversation

schoeneu
Copy link

@schoeneu schoeneu commented Mar 20, 2017

This is an attempt to implement the in-memory backend mentioned in #25 . I believe it to be complete (on the same level as FileProvider, but am happy to work on/rework any part of it, or abandon it altogether should another solution be preferable.

In terms of the behaviour, it should be mostly identical with the existing FileProvider, apart from:

  • will calculate md5sums for ListBucket requests. FileProvider seems to return 0 for all.
  • will throw NoSuchBucketException when a delete request is received against a nonexistent bucket. FileProvider throws NoSuchKeyException only. The correct semantics are unclear to me.
  • does not care about about separators and doesn't need to strip leading slashes, as it's not bound to the file system for storage. This should solve ListObjects with prefix does not work on windows #28 (Windows compatibility) in the case when in-memory storage is acceptable.

The most invasive changes have been to the test suite, as I was trying to find a way to automatically run the tests for both providers. I have tried to keep the changes clean (the github diff viewer marks huge blocks as changed, but it's mostly indentation due to wrapping the tests in an encapsulating method), but I'm not an expert in scalatest at all, so there may be a preferable way to do this.

Thanks for creating s3mock!

@shuttie
Copy link
Contributor

shuttie commented Mar 21, 2017

Wow, it looks epic. I will review it and merge this week. But for the first sight, it looks great!

@schoeneu
Copy link
Author

@shuttie Would it be helpful to you if I split the test changes into one commit that does the functional changes but without the reformatting that happens due to encapsulating the spec in a new method; and one that contains the formatting? The diff view of this PR looks like a lot more changes than actually present, since it doesn't properly recognise the whitespace changes.

@shuttie shuttie merged commit 80de609 into findify:master Apr 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants