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

Small code cleanup #10690

Merged
merged 4 commits into from
Jan 19, 2022
Merged

Conversation

findepi
Copy link
Member

@findepi findepi commented Jan 19, 2022

No description provided.

There is no apparent advantage in calling `getIfPresent(key)` before
calling `get(key)` on a loading cache.
@findepi findepi requested review from ebyhr and hashhar January 19, 2022 14:10
@cla-bot cla-bot bot added the cla-signed label Jan 19, 2022
Copy link
Member

@hashhar hashhar left a comment

Choose a reason for hiding this comment

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

LGTM % question (I'll get back with details)

@@ -494,10 +494,6 @@ private static PinotColumnHandle resolveAggregateExpressionWithAlias(PinotColumn

private static <K, V> V getFromCache(LoadingCache<K, V> cache, K key)
{
V value = cache.getIfPresent(key);
Copy link
Member

Choose a reason for hiding this comment

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

IIRC there was some mention that getIfPresent is more contention safe than get? Or was it about computeIfAbsent?

I'll check and get back.

Copy link
Member

Choose a reason for hiding this comment

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

However this doesn't seem to be in a hot path so shouldn't matter. Readability first.

Copy link
Member Author

Choose a reason for hiding this comment

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

@hashhar thanks for reminding me.
yes, i think it doesn't matter here
i think this is the thread: #9980

cc @sopel39

@findepi findepi merged commit 779d7f6 into trinodb:master Jan 19, 2022
@findepi findepi deleted the findepi/remove-redundant-code-e63714 branch January 19, 2022 20:47
@github-actions github-actions bot added this to the 369 milestone Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants