Caideyipi commented on code in PR #17238:
URL: https://github.com/apache/iotdb/pull/17238#discussion_r2921910617
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java:
##########
@@ -2477,6 +2484,52 @@ public long
getSubscriptionMetaSyncerSyncIntervalMinutes() {
return subscriptionMetaSyncerSyncIntervalMinutes;
}
+ public int getSubscriptionConsensusBatchMaxDelayInMs() {
+ return subscriptionConsensusBatchMaxDelayInMs;
+ }
+
+ public void setSubscriptionConsensusBatchMaxDelayInMs(
+ final int subscriptionConsensusBatchMaxDelayInMs) {
+ this.subscriptionConsensusBatchMaxDelayInMs =
subscriptionConsensusBatchMaxDelayInMs;
+ }
+
+ public long getSubscriptionConsensusBatchMaxSizeInBytes() {
+ return subscriptionConsensusBatchMaxSizeInBytes;
+ }
+
+ public void setSubscriptionConsensusBatchMaxSizeInBytes(
+ final long subscriptionConsensusBatchMaxSizeInBytes) {
+ this.subscriptionConsensusBatchMaxSizeInBytes =
subscriptionConsensusBatchMaxSizeInBytes;
+ }
+
+ public int getSubscriptionConsensusBatchMaxTabletCount() {
+ return subscriptionConsensusBatchMaxTabletCount;
+ }
+
+ public void setSubscriptionConsensusBatchMaxTabletCount(
+ final int subscriptionConsensusBatchMaxTabletCount) {
+ this.subscriptionConsensusBatchMaxTabletCount =
subscriptionConsensusBatchMaxTabletCount;
+ }
+
+ public int getSubscriptionConsensusBatchMaxWalEntries() {
+ return subscriptionConsensusBatchMaxWalEntries;
+ }
+
+ public void setSubscriptionConsensusBatchMaxWalEntries(
+ final int subscriptionConsensusBatchMaxWalEntries) {
+ this.subscriptionConsensusBatchMaxWalEntries =
subscriptionConsensusBatchMaxWalEntries;
+ }
+
+ public long getSubscriptionConsensusWalRetentionSizeInBytes() {
+ return subscriptionConsensusWalRetentionSizeInBytes;
+ }
+
+ public void setSubscriptionConsensusWalRetentionSizeInBytes(
Review Comment:
Is it called?
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/conf/CommonConfig.java:
##########
@@ -389,6 +389,13 @@ public class CommonConfig {
private long subscriptionMetaSyncerInitialSyncDelayMinutes = 3;
private long subscriptionMetaSyncerSyncIntervalMinutes = 3;
+ private int subscriptionConsensusBatchMaxDelayInMs = 50;
Review Comment:
May any of them support hot-reloading?
##########
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/payload/request/PipeSubscribeSeekReq.java:
##########
@@ -0,0 +1,128 @@
+/*
+ * 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.payload.request;
+
+import org.apache.iotdb.service.rpc.thrift.TPipeSubscribeReq;
+
+import org.apache.tsfile.utils.PublicBAOS;
+import org.apache.tsfile.utils.ReadWriteIOUtils;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.Objects;
+
+public class PipeSubscribeSeekReq extends TPipeSubscribeReq {
+
+ /** Seek type constants. */
+ public static final short SEEK_TO_BEGINNING = 1;
+
+ public static final short SEEK_TO_END = 2;
+ public static final short SEEK_TO_TIMESTAMP = 3;
+
+ private transient String topicName;
+ private transient short seekType;
+ private transient long timestamp; // only meaningful when seekType ==
SEEK_TO_TIMESTAMP
+
+ public String getTopicName() {
+ return topicName;
+ }
+
+ public short getSeekType() {
+ return seekType;
+ }
+
+ public long getTimestamp() {
+ return timestamp;
+ }
+
+ /////////////////////////////// Thrift ///////////////////////////////
+
+ /**
+ * Serialize the incoming parameters into {@code PipeSubscribeSeekReq},
called by the subscription
+ * client.
+ */
+ public static PipeSubscribeSeekReq toTPipeSubscribeReq(
+ final String topicName, final short seekType, final long timestamp)
+ throws IOException {
+ final PipeSubscribeSeekReq req = new PipeSubscribeSeekReq();
+
+ req.topicName = topicName;
+ req.seekType = seekType;
+ req.timestamp = timestamp;
+
+ req.version = PipeSubscribeRequestVersion.VERSION_1.getVersion();
+ req.type = PipeSubscribeRequestType.SEEK.getType();
+ try (final PublicBAOS byteArrayOutputStream = new PublicBAOS();
+ final DataOutputStream outputStream = new
DataOutputStream(byteArrayOutputStream)) {
+ ReadWriteIOUtils.write(topicName, outputStream);
+ ReadWriteIOUtils.write(seekType, outputStream);
+ if (seekType == SEEK_TO_TIMESTAMP) {
+ ReadWriteIOUtils.write(timestamp, outputStream);
+ }
+ req.body = ByteBuffer.wrap(byteArrayOutputStream.getBuf(), 0,
byteArrayOutputStream.size());
+ }
+
+ return req;
+ }
+
+ /** Deserialize {@code TPipeSubscribeReq} to obtain parameters, called by
the subscription server. */
+ public static PipeSubscribeSeekReq fromTPipeSubscribeReq(final
TPipeSubscribeReq seekReq) {
+ final PipeSubscribeSeekReq req = new PipeSubscribeSeekReq();
+
+ if (Objects.nonNull(seekReq.body) && seekReq.body.hasRemaining()) {
+ req.topicName = ReadWriteIOUtils.readString(seekReq.body);
+ req.seekType = ReadWriteIOUtils.readShort(seekReq.body);
+ if (req.seekType == SEEK_TO_TIMESTAMP) {
+ req.timestamp = ReadWriteIOUtils.readLong(seekReq.body);
+ }
+ }
+
+ req.version = seekReq.version;
+ req.type = seekReq.type;
+ req.body = seekReq.body;
Review Comment:
May delete this to help GC
--
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]