-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
use Caffeine instead of Guava Cache #9166
Conversation
Thanks for the PR! One note: catching blanket |
|
||
private final Cache<K, V> cache; | ||
private final AtomicBoolean isClosed = new AtomicBoolean(false); | ||
@JsonProperty | ||
private final int concurrencyLevel; |
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.
Please make sure a warning is printed if this legacy JSON property is still specified.
@@ -96,28 +95,6 @@ public void testClose() | |||
EasyMock.verify(lookupCache, reverseLookupCache); | |||
} | |||
|
|||
@Test | |||
public void testApplyWithExecutionError() throws ExecutionException |
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.
Could these tests be retained?
|
||
/** | ||
* A semi-persistent mapping from keys to values. Cache entries are added using | ||
* {@link #get(Object, Callable)} and stored in the cache until either evicted or manually invalidated. | ||
* {@link #get(Object, Function)} and stored in the cache until either evicted or manually invalidated. | ||
* <p> | ||
* <p>Implementations of this interface are expected to be thread-safe, and can be safely accessed | ||
* by multiple concurrent threads. |
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.
Please ensure a warning is printed when legacy "guava" type is specified, and add a new "onHeap" type.
@@ -140,6 +140,7 @@ public void testTimeStampParserWithLongTimeZone() | |||
|
|||
long millis1 = new DateTime(1994, 11, 9, 4, 0, DateTimeZone.forOffsetHours(-8)).getMillis(); | |||
long millis2 = new DateTime(1994, 11, 9, 4, 0, DateTimeZone.forOffsetHours(-6)).getMillis(); | |||
// java.util.Locale.setDefault(java.util.Locale.US); |
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.
Please remove
@@ -157,6 +158,7 @@ public void testTimeStampParserWithLongTimeZone() | |||
@Test | |||
public void testTimeZoneAtExtremeLocations() | |||
{ | |||
// java.util.Locale.setDefault(java.util.Locale.US); |
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.
And this
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.
As part of this change, forbidden-apis entries should also be added.
Labelling Labelling |
@leventov @drcrallen Thanks for the review, I'm new to druid, for now I just resolved the conflicts. I'll take time to address your comments, thanks! |
Looks like there is a legit checkstyle CI failure:
|
@leventov I've updated the code, now the failed checks are not relevant. can you please re-trigger the CI? |
@adrian-wang I retriggered the jobs for you |
@adrian-wang sorry for the delayed review. Would you please fix the conflicts? |
@jihoonson Sorry for the late response, I just merged this with master. |
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@druid.apache.org list. Thank you for your contributions. |
gently ping @leventov @jihoonson |
This issue is no longer marked as stale. |
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@druid.apache.org list. Thank you for your contributions. |
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
Fixes #8399 .
Description
Turn to Caffeine instead of Guava's Cache in
ResourcePool
,OnHeapLoadingCache
, andSegmentLoadDropHandler
, and interface changes inOffHeapLoadingCache
.This PR has: