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

Update durable-queue to use deps.edn and the latest dependency versions #28

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

vedang
Copy link

@vedang vedang commented May 2, 2023

This PR builds on top of #27 , which should be reviewed and merged in first.

In this PR, I have done the following work:

  1. Update the directory structure to mimic the style used by primitive-math and byte-streams
  2. Migrate from project.clj to deps.edn. The main motivation here is that this lets me use changes I have made in my own projects as a git dependency, until the maintainers can review these PRs and merge them in.
  3. Update all the dependencies of durable-queue to the latest versions.

All the non-stress tests are passing. I could not run the stress tests because I did not have enough free disk space. But I do not see any reason that they will not work.

The individual commit messages explain the changes in more detail, where required.

Thanks!

markbastian and others added 12 commits May 2, 2023 10:57
Fixes Java 13+ compatiblity issues, as noted in
clj-commons#23. Copying the relevant parts from the
Issue:

   `java.nio.ByteBuffer` and the other buffer types in `java.nio` now
   define absolute bulk `get` and `put` methods to transfer contiguous
   sequences of bytes without regard to or effect on the buffer
   position.

Due to this, running durable-queue against Java 13+ leads to the
following error:

   No matching method put found taking 2 args for class
   `java.nio.DirectByteBuffer`

This commit fixes the problem by adding the relevant type-hints

Author: Mark Bastian
Ref:    https://github.com/markbastian/durable-queue
Closes: clj-commons#23
Closes: clj-commons#24
System/currentTimeMillis is not guaranteed to progress monotonically.
NTP shifts, leap seconds, and manual system time changes can all cause
elapsed time calculations to be incorrect if you use
currentTimeMillis.

nanoTime is always calculated against a fixed point and proceeds
monotonically.

https://go.googlesource.com/proposal/+/master/design/12914-monotonic.md
has a good discussion on monotonic time.

Closes: clj-commons#21
The README contains documentation for these parameters, this commit
copies them from the README into the docstring.

Closes: clj-commons#20
This function lets the client delete an individual named queue. It is
useful for deleting corrupted queue files (such as that get created
when the disk fills up).

Closes: clj-commons#17
Creating a tag here to mark a working point with a `project.clj` file.
Next up, I am going to convert this to a `deps.edn` project and update
the dependencies to use the latest libraries from the `clj-commons`
group.
Here are the keys that are not captured in the migration:

1. :jvm-opts, :global-vars -- I do not think there is an elegant way
   to port these to deps.edn
2. :codox -- I am not sure this is being used anywhere right now
3. :deploy-repositories -- Deploying to Clojars will need to be added
   later, probably using something like `slipset/deps-deploy` and/or
   `org.clojure/tools.build`
Follow the same conventions as the `org.clj-commons/byte-streams` and
`org.clj-commons/primitive-math` projects do.
No breaking changes for us, since we were freezing and thawing
byte-arrays directly.
We need to change the top-level namespace for byte-streams. The rest
works as-is
We need to change the top-level namespace for primitive-math. The rest
works as-is.
This makes it easier to read the code for someone new (like me).
Note: At the moment, I have modified the instructions in the deps.edn
section of the README to use my fork of the project. Once the
clj-commons team cuts a release, I / they can change it back to the
proper mvn-version. At the moment, the README was anyway pointing to
an outdated version of `factual/durable-queue 0.1.5`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants