You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/06/01 11:13:52 UTC
[GitHub] [iotdb] qiaojialin commented on a diff in pull request #6087: [IOTDB-3289][IOTDB-3291][IOTDB-3217] Limit the number of regions
qiaojialin commented on code in PR #6087:
URL: https://github.com/apache/iotdb/pull/6087#discussion_r886677212
##########
confignode/src/main/java/org/apache/iotdb/confignode/client/handlers/HeartbeatHandler.java:
##########
@@ -18,32 +18,41 @@
*/
package org.apache.iotdb.confignode.client.handlers;
+import org.apache.iotdb.common.rpc.thrift.TDataNodeLocation;
import org.apache.iotdb.common.rpc.thrift.THeartbeatResp;
import org.apache.iotdb.confignode.manager.load.heartbeat.HeartbeatCache;
import org.apache.iotdb.confignode.manager.load.heartbeat.HeartbeatPackage;
import org.apache.thrift.async.AsyncMethodCallback;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class HeartbeatHandler implements AsyncMethodCallback<THeartbeatResp> {
+ private static final Logger LOGGER = LoggerFactory.getLogger(HeartbeatHandler.class);
+
// Update HeartbeatCache when success
- private final int dataNodeId;
+ private final TDataNodeLocation dataNodeLocation;
private final HeartbeatCache heartbeatCache;
- public HeartbeatHandler(int dataNodeId, HeartbeatCache heartbeatCache) {
- this.dataNodeId = dataNodeId;
+ public HeartbeatHandler(TDataNodeLocation dataNodeLocation, HeartbeatCache heartbeatCache) {
+ this.dataNodeLocation = dataNodeLocation;
this.heartbeatCache = heartbeatCache;
}
@Override
public void onComplete(THeartbeatResp tHeartbeatResp) {
heartbeatCache.cacheHeartBeat(
- dataNodeId,
+ dataNodeLocation.getDataNodeId(),
new HeartbeatPackage(tHeartbeatResp.getHeartbeatTimestamp(), System.currentTimeMillis()));
}
@Override
public void onError(Exception e) {
- // Just ignore heartbeat error
+ LOGGER.error(
Review Comment:
warn
##########
confignode/src/main/java/org/apache/iotdb/confignode/service/thrift/ConfigNodeRPCServiceProcessor.java:
##########
@@ -177,14 +177,10 @@ public TSStatus setStorageGroup(TSetStorageGroupReq req) throws TException {
storageGroupSchema.setTimePartitionInterval(
ConfigNodeDescriptor.getInstance().getConf().getTimePartitionInterval());
}
- if (!storageGroupSchema.isSetMaximumSchemaRegionCount()) {
- storageGroupSchema.setMaximumSchemaRegionCount(
- ConfigNodeDescriptor.getInstance().getConf().getMaximumSchemaRegionCount());
- }
- if (!storageGroupSchema.isSetMaximumDataRegionCount()) {
- storageGroupSchema.setMaximumDataRegionCount(
- ConfigNodeDescriptor.getInstance().getConf().getMaximumDataRegionCount());
- }
+
+ // Mark the StorageGroup as SchemaRegions and DataRegions not yet created
+ storageGroupSchema.setMaximumSchemaRegionCount(-1);
Review Comment:
use 0?
--
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-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org