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 06:30:45 UTC
[GitHub] [iotdb] wangchao316 commented on a diff in pull request #6087: [IOTDB-3289][IOTDB-3291] Limit the number of regions
wangchao316 commented on code in PR #6087:
URL: https://github.com/apache/iotdb/pull/6087#discussion_r886360369
##########
confignode/src/main/java/org/apache/iotdb/confignode/client/handlers/HeartbeatHandler.java:
##########
@@ -18,32 +18,40 @@
*/
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(
+ String.format(
+ "Heartbeat error on DataNode: {id=%d, internalEndPoint=%s}, exception: %s",
+ dataNodeLocation.getDataNodeId(), dataNodeLocation.getInternalEndPoint(), e));
Review Comment:
LOGGER.error("Heartbeat error on DataNode: id={}, internalEndPoint={}", dataNodeLocation.getDataNodeId(), dataNodeLocation.getInternalEndPoint(), e);
--
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