Re: [PR] Subscription: support TsFile message format [iotdb]

2024-05-23 Thread via GitHub


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


##
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/exception/SubscriptionConnectionException.java:
##
@@ -21,25 +21,20 @@
 
 import java.util.Objects;
 
-public class SubscriptionPollTimeOutException extends SubscriptionException {
+public class SubscriptionConnectionException extends 
SubscriptionRuntimeCriticalException {
 
-  public SubscriptionPollTimeOutException(String message) {
+  public SubscriptionConnectionException(final String message) {
 super(message);
   }
 
-  protected SubscriptionPollTimeOutException(String message, long timeStamp) {
-super(message, timeStamp);
+  public SubscriptionConnectionException(final String message, final Throwable 
cause) {
+super(message, cause);
   }
 
   @Override
-  public boolean equals(Object obj) {
-return obj instanceof SubscriptionPollTimeOutException
-&& Objects.equals(getMessage(), ((SubscriptionPollTimeOutException) 
obj).getMessage())
-&& Objects.equals(getTimeStamp(), ((SubscriptionPollTimeOutException) 
obj).getTimeStamp());
-  }
-
-  @Override
-  public int hashCode() {
-return Objects.hash(getMessage(), getTimeStamp());
+  public boolean equals(final Object obj) {
+return obj instanceof SubscriptionConnectionException
+&& Objects.equals(getMessage(), ((SubscriptionConnectionException) 
obj).getMessage())
+&& Objects.equals(getTimeStamp(), ((SubscriptionConnectionException) 
obj).getTimeStamp());

Review Comment:
   Method 'hashCode()' is identical to its super method



-- 
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: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Subscription: support TsFile message format [iotdb]

2024-05-23 Thread via GitHub


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


##
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/exception/SubscriptionIncompatibleHandlerException.java:
##
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.rpc.subscription.exception;
+
+import java.util.Objects;
+
+public class SubscriptionIncompatibleHandlerException extends 
SubscriptionException {
+
+  public SubscriptionIncompatibleHandlerException(final String message) {
+super(message);
+  }
+
+  public SubscriptionIncompatibleHandlerException(final String message, final 
Throwable cause) {
+super(message, cause);
+  }
+
+  @Override
+  public boolean equals(final Object obj) {
+return obj instanceof SubscriptionIncompatibleHandlerException
+&& Objects.equals(
+getMessage(), ((SubscriptionIncompatibleHandlerException) 
obj).getMessage())
+&& Objects.equals(
+getTimeStamp(), ((SubscriptionIncompatibleHandlerException) 
obj).getTimeStamp());
+  }

Review Comment:
   Method 'hashCode()' is identical to its super method



##
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/exception/SubscriptionParameterNotValidException.java:
##
@@ -23,24 +23,19 @@
 
 public class SubscriptionParameterNotValidException extends 
SubscriptionException {
 
-  public SubscriptionParameterNotValidException(String message) {
+  public SubscriptionParameterNotValidException(final String message) {
 super(message);
   }
 
-  protected SubscriptionParameterNotValidException(String message, long 
timeStamp) {
-super(message, timeStamp);
+  public SubscriptionParameterNotValidException(final String message, final 
Throwable cause) {
+super(message, cause);
   }
 
   @Override
-  public boolean equals(Object obj) {
+  public boolean equals(final Object obj) {
 return obj instanceof SubscriptionParameterNotValidException
 && Objects.equals(getMessage(), 
((SubscriptionParameterNotValidException) obj).getMessage())
 && Objects.equals(
 getTimeStamp(), ((SubscriptionParameterNotValidException) 
obj).getTimeStamp());
   }

Review Comment:
   Method 'hashCode()' is identical to its super method 



-- 
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: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Subscription: support TsFile message format [iotdb]

2024-05-23 Thread via GitHub


SteveYurongSu commented on code in PR #12326:
URL: https://github.com/apache/iotdb/pull/12326#discussion_r1611474577


##
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/exception/SubscriptionParameterNotValidException.java:
##
@@ -23,24 +23,19 @@
 
 public class SubscriptionParameterNotValidException extends 
SubscriptionException {
 
-  public SubscriptionParameterNotValidException(String message) {
+  public SubscriptionParameterNotValidException(final String message) {
 super(message);
   }
 
-  protected SubscriptionParameterNotValidException(String message, long 
timeStamp) {
-super(message, timeStamp);
+  public SubscriptionParameterNotValidException(final String message, final 
Throwable cause) {
+super(message, cause);
   }
 
   @Override
-  public boolean equals(Object obj) {
+  public boolean equals(final Object obj) {
 return obj instanceof SubscriptionParameterNotValidException
 && Objects.equals(getMessage(), 
((SubscriptionParameterNotValidException) obj).getMessage())
 && Objects.equals(
 getTimeStamp(), ((SubscriptionParameterNotValidException) 
obj).getTimeStamp());
   }

Review Comment:
   hashCode



-- 
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: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Subscription: support TsFile message format [iotdb]

2024-05-23 Thread via GitHub


SteveYurongSu commented on code in PR #12326:
URL: https://github.com/apache/iotdb/pull/12326#discussion_r1611474132


##
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/exception/SubscriptionIncompatibleHandlerException.java:
##
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.rpc.subscription.exception;
+
+import java.util.Objects;
+
+public class SubscriptionIncompatibleHandlerException extends 
SubscriptionException {
+
+  public SubscriptionIncompatibleHandlerException(final String message) {
+super(message);
+  }
+
+  public SubscriptionIncompatibleHandlerException(final String message, final 
Throwable cause) {
+super(message, cause);
+  }
+
+  @Override
+  public boolean equals(final Object obj) {
+return obj instanceof SubscriptionIncompatibleHandlerException
+&& Objects.equals(
+getMessage(), ((SubscriptionIncompatibleHandlerException) 
obj).getMessage())
+&& Objects.equals(
+getTimeStamp(), ((SubscriptionIncompatibleHandlerException) 
obj).getTimeStamp());
+  }

Review Comment:
   hashCode
   



-- 
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: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Subscription: support TsFile message format [iotdb]

2024-05-23 Thread via GitHub


SteveYurongSu commented on code in PR #12326:
URL: https://github.com/apache/iotdb/pull/12326#discussion_r1611471054


##
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/exception/SubscriptionConnectionException.java:
##
@@ -21,25 +21,20 @@
 
 import java.util.Objects;
 
-public class SubscriptionPollTimeOutException extends SubscriptionException {
+public class SubscriptionConnectionException extends 
SubscriptionRuntimeCriticalException {
 
-  public SubscriptionPollTimeOutException(String message) {
+  public SubscriptionConnectionException(final String message) {
 super(message);
   }
 
-  protected SubscriptionPollTimeOutException(String message, long timeStamp) {
-super(message, timeStamp);
+  public SubscriptionConnectionException(final String message, final Throwable 
cause) {
+super(message, cause);
   }
 
   @Override
-  public boolean equals(Object obj) {
-return obj instanceof SubscriptionPollTimeOutException
-&& Objects.equals(getMessage(), ((SubscriptionPollTimeOutException) 
obj).getMessage())
-&& Objects.equals(getTimeStamp(), ((SubscriptionPollTimeOutException) 
obj).getTimeStamp());
-  }
-
-  @Override
-  public int hashCode() {
-return Objects.hash(getMessage(), getTimeStamp());
+  public boolean equals(final Object obj) {
+return obj instanceof SubscriptionConnectionException
+&& Objects.equals(getMessage(), ((SubscriptionConnectionException) 
obj).getMessage())
+&& Objects.equals(getTimeStamp(), ((SubscriptionConnectionException) 
obj).getTimeStamp());

Review Comment:
   hashCode?



-- 
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: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Subscription: support TsFile message format [iotdb]

2024-05-23 Thread via GitHub


SteveYurongSu commented on code in PR #12326:
URL: https://github.com/apache/iotdb/pull/12326#discussion_r1611469028


##
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/config/TopicConfig.java:
##
@@ -82,6 +82,15 @@ public Map getAttributesWithTimeRange(long 
creationTime) {
 return attributesWithTimeRange;
   }
 
+  public Map getAttributesWithSourceRealtimeMode() {
+if (TopicConstant.FORMAT_TS_FILE_HANDLER_VALUE.equals(

Review Comment:
   return a ? b : c;



-- 
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: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



Re: [PR] Subscription: support TsFile message format [iotdb]

2024-05-23 Thread via GitHub


SteveYurongSu commented on code in PR #12326:
URL: https://github.com/apache/iotdb/pull/12326#discussion_r1611468044


##
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/config/ConsumerConstant.java:
##
@@ -34,31 +34,34 @@ public class ConsumerConstant {
   public static final String CONSUMER_GROUP_ID_KEY = "group-id";
 
   public static final String HEARTBEAT_INTERVAL_MS_KEY = 
"heartbeat-interval-ms"; // unit: ms
-  public static final long HEARTBEAT_INTERVAL_MS_DEFAULT_VALUE = 5000;
-  public static final long HEARTBEAT_INTERVAL_MS_MIN_VALUE = 1000;
+  public static final long HEARTBEAT_INTERVAL_MS_DEFAULT_VALUE = 30_000;
+  public static final long HEARTBEAT_INTERVAL_MS_MIN_VALUE = 1_000;
 
   public static final String ENDPOINTS_SYNC_INTERVAL_MS_KEY =
   "endpoints-sync-interval-ms"; // unit: ms
-  public static final long ENDPOINTS_SYNC_INTERVAL_MS_DEFAULT_VALUE = 3;
-  public static final long ENDPOINTS_SYNC_INTERVAL_MS_MIN_VALUE = 5000;
+  public static final long ENDPOINTS_SYNC_INTERVAL_MS_DEFAULT_VALUE = 120_000;
+  public static final long ENDPOINTS_SYNC_INTERVAL_MS_MIN_VALUE = 5_000;
+
+  public static final String FILE_SAVE_DIR_KEY = "file-save-dir";
+  public static final String FILE_SAVE_DIR_DEFAULT_VALUE = 
System.getProperty("user.dir");

Review Comment:
   ```suggestion
 public static final String FILE_SAVE_DIR_DEFAULT_VALUE = 
System.getProperty("user.dir") + "iotdb-subscription";
   ```
   ?



-- 
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: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[PR] Subscription: support TsFile message format [iotdb]

2024-04-12 Thread via GitHub


VGalaxies opened a new pull request, #12326:
URL: https://github.com/apache/iotdb/pull/12326

   WIP...


-- 
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: reviews-unsubscr...@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org