aboutsummaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2020-09-09 13:43:11 +0200
committerHarald Musum <musum@verizonmedia.com>2020-09-09 13:43:11 +0200
commit703a69752f6e125c336b11ad3bba455e143beed6 (patch)
treefbcc85134799f2a12af9edf008d765bdc3837e52 /configserver
parent86ab9d3f1416a90d8909bb0ced5385f030ef8060 (diff)
Always add to cache now that we change RemoteSession for sessions with same id
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionCache.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionCache.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionCache.java
index 9cf0b1e428d..37de857a251 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionCache.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionCache.java
@@ -15,23 +15,13 @@ public class SessionCache<SESSIONTYPE extends Session> {
private final HashMap<Long, SESSIONTYPE> sessions = new HashMap<>();
- public synchronized void putSession(SESSIONTYPE session) {
- sessions.putIfAbsent(session.getSessionId(), session);
- }
+ public synchronized void putSession(SESSIONTYPE session) { sessions.put(session.getSessionId(), session); }
synchronized void removeSession(long id) {
sessions.remove(id);
}
- /**
- * Gets a Session
- *
- * @param id session id
- * @return a session belonging to the id supplied, or null if no session with the id was found
- */
- public synchronized SESSIONTYPE getSession(long id) {
- return sessions.get(id);
- }
+ public synchronized SESSIONTYPE getSession(long id) { return sessions.get(id); }
public synchronized List<SESSIONTYPE> getSessions() {
return new ArrayList<>(sessions.values());