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

Issue 61 Fix with old style "Access" instead of "Rental" #84

Merged
merged 28 commits into from
Mar 6, 2024

Conversation

eemhu
Copy link
Contributor

@eemhu eemhu commented Mar 1, 2024

Add new phaser implementation rather than using a custom count and lock solution to BufferLease and Access.

eemhu and others added 20 commits February 19, 2024 15:54
…re than 1 instead of zero as Phaser inits at 1, not 0.
…rk BufferLeaseImpl.refs as unreliable, change Rental.closed() to return phaser.isTerminated
Note: RentalTest contains IllegalStateException assert that does not seem to happen, commented out for now.
…rnalOffer, add stub unless phaser was terminated explicitly
…Lease to BufferContainer. Pool holds BufferContainers and wraps them in BufferLeases while out of the queue.
# Conflicts:
#	src/main/java/com/teragrep/rlp_03/context/buffer/BufferLeaseImpl.java
#	src/main/java/com/teragrep/rlp_03/context/buffer/BufferLeasePool.java
@eemhu eemhu marked this pull request as ready for review March 4, 2024 07:23
@eemhu eemhu requested a review from kortemik March 4, 2024 08:56
@StrongestNumber9
Copy link
Contributor

StrongestNumber9 commented Mar 5, 2024

General note: Noticed mixed use of this.classVariable and classVariable but didn't comment on all of them. Use them consistently in one way or another, we usually refer to this.classVariable only inside constructor and classVariable everywhere else

BufferLease queuedBufferLease = queue.poll();
if (queuedBufferLease == null) {
BufferContainer queuedBufferContainer = queue.poll();
if (queuedBufferContainer == null) {
break;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this implementation consume all available processing power in a busy loop until poll returns null?

…ion, rename access.terminated() to isTerminated(), fix BufferContainerImpl logger class, remove attemptRelease() from BufferLease interface, remove usage of 'this' keyword outside of constructors, inline phaser (de)register output in BufferLeaseImpl and throw IllegalStateException in case of dirty pool,
@eemhu
Copy link
Contributor Author

eemhu commented Mar 5, 2024

added fixes till "wrong classname" comment

@eemhu
Copy link
Contributor Author

eemhu commented Mar 5, 2024

added fixes to rest of the comments.

Copy link
Member

@kortemik kortemik left a comment

Choose a reason for hiding this comment

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

move Access stuff to it's own pr and this will do

@eemhu
Copy link
Contributor Author

eemhu commented Mar 6, 2024

@kortemik Reverted to main branch Access / Lease / AccessTest. This PR should now only contain the changed BufferLease, will move Access phaser to new pull request.

Copy link
Contributor

@StrongestNumber9 StrongestNumber9 left a comment

Choose a reason for hiding this comment

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

LGTM

@kortemik kortemik merged commit 7d5c9ba into teragrep:main Mar 6, 2024
1 check passed
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.

investigate possibility to use a Phaser instead of a custom solution in Access and BufferLeaseImpl
3 participants