dlmarion commented on code in PR #2804:
URL: https://github.com/apache/accumulo/pull/2804#discussion_r926888990
##########
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/CompactableImpl.java:
##########
@@ -1105,23 +1105,23 @@ public Optional<Files> getFiles(CompactionServiceId
service, CompactionKind kind
}
class CompactionCheck {
- private final Supplier<Boolean> memoizedCheck;
+ private final Supplier<Boolean> expensiveCheck;
+ private final Supplier<Boolean> inexpensiveCheck;
public CompactionCheck(CompactionServiceId service, CompactionKind kind,
Long compactionId) {
- this.memoizedCheck = Suppliers.memoizeWithExpiration(() -> {
- if (closed)
+ this.expensiveCheck = Suppliers.memoizeWithExpiration(() -> {
+ return service.equals(getConfiguredService(kind));
Review Comment:
maybe `expensive` was the wrong term, the more expensive check in this case
is more complex than comparing enums and longs. The more expensive check
evaluates whether the service parameter is equal to the configured service,
meaning, has the configuration changed. The path to getting there is more
complex.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]