VGalaxies commented on code in PR #12275:
URL: https://github.com/apache/iotdb/pull/12275#discussion_r1549087793


##########
iotdb-client/session/src/main/java/org/apache/iotdb/session/subscription/SubscriptionProvider.java:
##########
@@ -81,11 +87,49 @@ public synchronized void close() throws 
IoTDBConnectionException {
       throw new IoTDBConnectionException(e);
     } finally {
       super.close();
+      setUnavailable();
       isClosed.set(true);
     }
   }
 
   SubscriptionSessionConnection getSessionConnection() {
     return (SubscriptionSessionConnection) defaultSessionConnection;
   }
+
+  boolean isAvailable() {
+    return isAvailable.get();
+  }
+
+  void setAvailable() {
+    isAvailable.set(true);
+  }
+
+  void setUnavailable() {
+    isAvailable.set(false);
+  }
+
+  int getDataNodeId() {
+    return dataNodeId;
+  }
+
+  TEndPoint getEndPoint() {
+    return endPoint;
+  }
+
+  @Override
+  public String toString() {
+    return "{endPoint="
+        + endPoint
+        + ", dataNodeId="
+        + dataNodeId
+        + ", consumerId="
+        + consumerId
+        + ", consumerGroupId="
+        + consumerGroupId
+        + ", isAvailable="
+        + isAvailable

Review Comment:
   No need since atomic variable class overrides the `toString` method...
   
   ```java
   public String toString() {
        return Boolean.toString(this.get());
   }
   ```
   
   
   
   
   



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