Caideyipi commented on code in PR #12543:
URL: https://github.com/apache/iotdb/pull/12543#discussion_r1606601320
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/connector/protocol/IoTDBConnector.java:
##########
@@ -96,6 +102,10 @@ public abstract class IoTDBConnector implements
PipeConnector {
protected boolean isTabletBatchModeEnabled = true;
+ protected boolean isRateLimitModeEnabled = false;
+ protected double rateLimitBytesPerSecond = 0;
+ protected Map<TEndPoint, ConnectorRateLimiter>
endPointConnectorRateLimiterMap;
Review Comment:
Note that the "RateLimit" is per-pipe, not per connector.
##########
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/connector/protocol/IoTDBAirGapConnector.java:
##########
@@ -266,6 +267,11 @@ protected boolean send(Socket socket, byte[] bytes) throws
IOException {
return false;
}
+ rateLimitIfNeeded(
+ new TEndPoint(
+ Arrays.toString(socket.getLocalAddress().getAddress()),
socket.getLocalPort()),
Review Comment:
Will calling "toString" per send lower the performance?
--
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]