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
Introduce a RefCounted interface and basic impl #8210
Conversation
@bleskes all yours... ;) |
@Override | ||
public final void incRef() { | ||
if (tryIncRef() == false) { | ||
throw new AlreadyClosedException("Store is already closed can't increment refCount current count [" + refCount.get() + "]"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove the Store part. Perhaps make a constructor with a name? these errors are difficult tot trace so we should make it as clear as possible where the error came from (even if the stack trace is lost)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is a copy / paste error I will fix
LGTM. I like the abstract class + interface approach. Left two little comments. |
@bleskes pushed a new commit |
@s1monw looks great. |
We already have two places duplicating this rather hairy logic, this commit intorduces a new RefCoutned interace and an abstract implementation that can be used for delegation. It factors out all the reference counting and adds single and multithreaded test for it. Closes elastic#8210
We already have two places duplicating this rather hairy logic, this commit intorduces a new RefCoutned interace and an abstract implementation that can be used for delegation. It factors out all the reference counting and adds single and multithreaded test for it. Closes #8210
We already have two places duplicating this rather hairy logic, this
commit intorduces a new RefCoutned interace and an abstract implementation
that can be used for delegation. It factors out all the reference counting
and adds single and multithreaded test for it.