Jackie-Jiang commented on code in PR #13546:
URL: https://github.com/apache/pinot/pull/13546#discussion_r1669033338
##########
pinot-common/src/main/java/org/apache/pinot/common/config/GrpcConfig.java:
##########
@@ -28,6 +28,24 @@ public class GrpcConfig {
public static final String GRPC_TLS_PREFIX = "tls";
public static final String CONFIG_USE_PLAIN_TEXT = "usePlainText";
public static final String CONFIG_MAX_INBOUND_MESSAGE_BYTES_SIZE =
"maxInboundMessageSizeBytes";
+
+ private static final String CONFIG_CHANNEL_SHUTDOWN_TIMEOUT_SECOND =
"channelShutdownTimeoutSecond";
+ private static final int DEFAULT_CHANNEL_SHUTDOWN_TIMEOUT_SECOND = 10;
Review Comment:
```suggestion
private static final String CONFIG_CHANNEL_SHUTDOWN_TIMEOUT_SECONDS =
"channelShutdownTimeoutSeconds";
private static final int DEFAULT_CHANNEL_SHUTDOWN_TIMEOUT_SECONDS = 10;
```
##########
pinot-common/src/main/java/org/apache/pinot/common/config/GrpcConfig.java:
##########
@@ -69,6 +87,27 @@ public boolean isUsePlainText() {
return
Boolean.parseBoolean(_pinotConfig.getProperty(CONFIG_USE_PLAIN_TEXT,
DEFAULT_IS_USE_PLAIN_TEXT));
}
+ public int getChannelShutdownTimeoutSecond() {
+ return _pinotConfig.getProperty(CONFIG_CHANNEL_SHUTDOWN_TIMEOUT_SECOND,
DEFAULT_CHANNEL_SHUTDOWN_TIMEOUT_SECOND);
+ }
+
+ public boolean getChannelKeepAliveEnabled() {
+ return _pinotConfig.getProperty(CONFIG_CHANNEL_KEEP_ALIVE_ENABLED,
DEFAULT_CHANNEL_KEEP_ALIVE_ENABLED);
+ }
+
+ public int getChannelKeepAliveTimeSeconds() {
+ return _pinotConfig.getProperty(CONFIG_CHANNEL_KEEP_ALIVE_TIME_SECONDS,
DEFAULT_CHANNEL_KEEP_ALIVE_TIME_SECONDS);
+ }
+
+ public int getChannelKeepAliveTimeoutSeconds() {
+ return _pinotConfig.getProperty(CONFIG_CHANNEL_KEEP_ALIVE_TIMEOUT_SECONDS,
+ DEFAULT_CHANNEL_KEEP_ALIVE_TIMEOUT_SECONDS);
+ }
+
+ public boolean getChannelKeepAliveWithoutCalls() {
Review Comment:
```suggestion
public boolean isChannelKeepAliveWithoutCalls() {
```
##########
pinot-common/src/main/java/org/apache/pinot/common/config/GrpcConfig.java:
##########
@@ -28,6 +28,24 @@ public class GrpcConfig {
public static final String GRPC_TLS_PREFIX = "tls";
public static final String CONFIG_USE_PLAIN_TEXT = "usePlainText";
public static final String CONFIG_MAX_INBOUND_MESSAGE_BYTES_SIZE =
"maxInboundMessageSizeBytes";
+
+ private static final String CONFIG_CHANNEL_SHUTDOWN_TIMEOUT_SECOND =
"channelShutdownTimeoutSecond";
+ private static final int DEFAULT_CHANNEL_SHUTDOWN_TIMEOUT_SECOND = 10;
+
+ // KeepAlive configs
+ private static final String CONFIG_CHANNEL_KEEP_ALIVE_ENABLED =
"channelKeepAliveEnabled";
+ // To control keep alive on no usage
+ private static final boolean DEFAULT_CHANNEL_KEEP_ALIVE_ENABLED = false;
+
+ private static final String CONFIG_CHANNEL_KEEP_ALIVE_TIME_SECONDS =
"channelKeepAliveTimeSeconds";
+ private static final int DEFAULT_CHANNEL_KEEP_ALIVE_TIME_SECONDS = 300; // 5
minutes
Review Comment:
Consider merging this 2? Basically enabling keep alive is equivalent to
setting the keep alive time to a positive value
##########
pinot-common/src/main/java/org/apache/pinot/common/config/GrpcConfig.java:
##########
@@ -69,6 +87,27 @@ public boolean isUsePlainText() {
return
Boolean.parseBoolean(_pinotConfig.getProperty(CONFIG_USE_PLAIN_TEXT,
DEFAULT_IS_USE_PLAIN_TEXT));
}
+ public int getChannelShutdownTimeoutSecond() {
+ return _pinotConfig.getProperty(CONFIG_CHANNEL_SHUTDOWN_TIMEOUT_SECOND,
DEFAULT_CHANNEL_SHUTDOWN_TIMEOUT_SECOND);
+ }
+
+ public boolean getChannelKeepAliveEnabled() {
Review Comment:
```suggestion
public boolean isChannelKeepAliveEnabled() {
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]