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

Rework read-only tracking #15

Merged
merged 3 commits into from
Sep 15, 2014
Merged

Rework read-only tracking #15

merged 3 commits into from
Sep 15, 2014

Conversation

rovarga
Copy link
Contributor

@rovarga rovarga commented Sep 15, 2014

This builds on top of pull request #14, and changes how read-only is tracked. Instead of tracking a reference, there is final boolean field which is checked before the static updater is touched.

It should have the same (or slightly better) performance characteristics, that may or may not be true.

Robert Varga added 3 commits September 15, 2014 14:27
Couple of improvements to the serialization strategy:
- emit the fact that the map is read-only, so we preserve that trait
- write out the size and entries ourselves, not via an intermediate
  HashMap()

The read path now takes these changes into account and resets the
rootupdater after deserialization is done back to null.

Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Removes duplicate fields and makes the equivalent methods final. Also
marks things that we take care of as transient, thus allowing us to
reuse the JVM magic in serialization.

Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
Instead of using the updater reference as the indicator of read-only
views, add an explicit boolean. Thus all instances reuse a single
updater reference, but still guard access to it via an explicit check.

This changes the behavior a bit: instead of throwing NPE on read-only
views, we throw IllegalStateException. The reason for that is that we
should have caught the attempt in the MAP API functions.

Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
romix added a commit that referenced this pull request Sep 15, 2014
@romix romix merged commit 2b62f01 into romix:master Sep 15, 2014
@rovarga
Copy link
Contributor Author

rovarga commented Sep 18, 2014

With this merged, my queue is empty. Would it be possible to spin the 0.2.1 release? Can I help with anything to make that happen?

@romix
Copy link
Owner

romix commented Sep 18, 2014

I have released it as 0.2.23. It should arrive on Maven Central in a few hours.
Don't ask why it has a version 0.2.23... I had some issues publishing it. At the end it was somehow published with this version number ;-)

@rovarga rovarga deleted the outstanding branch September 19, 2014 11:25
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.

None yet

2 participants