AMashenkov commented on code in PR #1004:
URL: https://github.com/apache/ignite-3/pull/1004#discussion_r947582215
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/session/SessionManager.java:
##########
@@ -17,21 +17,44 @@
package org.apache.ignite.internal.sql.engine.session;
-import java.util.Map;
+import com.github.benmanes.caffeine.cache.Cache;
+import com.github.benmanes.caffeine.cache.Caffeine;
+import com.github.benmanes.caffeine.cache.Expiry;
import java.util.UUID;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.TimeUnit;
import org.apache.ignite.internal.sql.engine.CurrentTimeProvider;
import org.apache.ignite.internal.sql.engine.property.PropertiesHolder;
+import org.checkerframework.checker.index.qual.NonNegative;
import org.jetbrains.annotations.Nullable;
/**
* A manager of a server side sql sessions.
*/
public class SessionManager {
- private final Map<SessionId, Session> activeSessions = new
ConcurrentHashMap<>();
private final CurrentTimeProvider timeProvider;
+ /** Active sessions with expiration. */
+ private Cache<SessionId, Session> activeSessions = Caffeine.newBuilder()
+ .weakKeys()
+ .weakValues()
Review Comment:
Does it mean keys/values are reachable if there is at least one non-weak
reference on these objects?
--
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]