Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memdb: API cleanups and improvements #56

Merged
merged 12 commits into from
Mar 9, 2020
Merged

memdb: API cleanups and improvements #56

merged 12 commits into from
Mar 9, 2020

Conversation

erikgrinaker
Copy link
Contributor

@erikgrinaker erikgrinaker commented Mar 4, 2020

Fixes #54, fixes #55. Somewhat breaking, since we're removing exported methods, but these are not likely to be widely used.

  • Removes atomicSetDeleter interface and related public methods
  • Uses an RWMutex instead of a Mutex in MemDB
  • Removes mockDB since it is not really used
  • Adds batch tests for all backends
  • Various minor code cleanups

Branched off of #53, should be rebased onto master before merging.

mem_db.go Outdated Show resolved Hide resolved
mem_db.go Outdated Show resolved Hide resolved
mem_db.go Outdated
return newMemDBIterator(db.btree, start, end, true), nil
}

//----------------------------------------
// Iterator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've been talking for a long time about getting rid of these ascii separators and instead putting things in their own files. Do you want to do that while you're in here cleaning things up? (Could also go in a follow up PR, since it might create a lot of noise in this one.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I split the iterator and batch into separate files, but kept them in the root directory since using a separate directory would break the API quite severely. I also renamed files from e.g. mem_db_iterator.go to memdb_iterator.go.

Let me know if you think this is fine, and I'll merge this and submit a PR that does the same for the other backends.

@tessr
Copy link
Contributor

tessr commented Mar 9, 2020

Nice. Happy to see an unused DB removed!

@erikgrinaker erikgrinaker changed the base branch from erik/memdb-btree to master March 9, 2020 12:27
Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

memdb_batch.go Outdated Show resolved Hide resolved
Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>
@erikgrinaker erikgrinaker merged commit 310f1ac into master Mar 9, 2020
@erikgrinaker erikgrinaker deleted the erik/memdb-api branch March 9, 2020 15:22
faddat pushed a commit to faddat/tm-db that referenced this pull request Feb 21, 2024
…rmint#56)

Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.53.0 to 1.55.0.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.53.0...v1.55.0)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:breaking Type: Breaking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use RWMutex in MemDB Reduce MemDB API surface
3 participants