keith-turner commented on code in PR #4902:
URL: https://github.com/apache/accumulo/pull/4902#discussion_r1769276295


##########
server/tserver/src/main/java/org/apache/accumulo/tserver/session/Session.java:
##########
@@ -66,13 +67,21 @@ public State getState() {
     return state;
   }
 
+  public void setSessionId(long sessionId) {
+    this.sessionId = sessionId;
+  }
+
+  public long getSessionId() {
+    return sessionId;
+  }
+

Review Comment:
   Could make the getter and setters more strict, only allowing it to be set 
once and failing get when not set.
   
   
   ```suggestion
     private boolean sessionIdSet = false;
   
     public void setSessionId(long sessionId) {
       Preconditions.checkState(!sessionIdSet);
       this.sessionId = sessionId;
        sessionIdSet = true;
     }
   
     public long getSessionId() {
       Preconditions.checkState(sessionIdSet);
       return sessionId;
     }
   
   ```



-- 
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]

Reply via email to