This is an automated email from the ASF dual-hosted git repository. apucher pushed a commit to branch tls-integration-test in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
commit 61f58f553d2e24842e8d81f3eb258274f5a8598d Author: Alexander Pucher <a...@alexpucher.com> AuthorDate: Wed Jun 2 14:40:12 2021 -0700 add protocol override config to ServerSegmentCompletionProtocolHandler --- .../server/realtime/ServerSegmentCompletionProtocolHandler.java | 4 +++- .../src/main/java/org/apache/pinot/spi/utils/CommonConstants.java | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java b/pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java index aa0296e..b1db67c 100644 --- a/pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java +++ b/pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java @@ -53,6 +53,7 @@ public class ServerSegmentCompletionProtocolHandler { private static Integer _controllerHttpsPort; private static int _segmentUploadRequestTimeoutMs; private static String _authToken; + private static String _protocol; private final FileUploadDownloadClient _fileUploadDownloadClient; private final ServerMetrics _serverMetrics; @@ -64,6 +65,7 @@ public class ServerSegmentCompletionProtocolHandler { _sslContext = new ClientSSLContextGenerator(httpsConfig.subset(CommonConstants.PREFIX_OF_SSL_SUBSET)).generate(); _controllerHttpsPort = httpsConfig.getProperty(CONFIG_OF_CONTROLLER_HTTPS_PORT, Integer.class); } + _protocol = uploaderConfig.getProperty(CONFIG_OF_PROTOCOL, HTTP_PROTOCOL); _segmentUploadRequestTimeoutMs = uploaderConfig .getProperty(CONFIG_OF_SEGMENT_UPLOAD_REQUEST_TIMEOUT_MS, DEFAULT_SEGMENT_UPLOAD_REQUEST_TIMEOUT_MS); _authToken = uploaderConfig.getProperty(CONFIG_OF_SEGMENT_UPLOADER_AUTH_TOKEN); @@ -192,7 +194,7 @@ public class ServerSegmentCompletionProtocolHandler { LOGGER.warn("No leader found while trying to send {}", request.toString()); return null; } - String protocol = HTTP_PROTOCOL; + String protocol = _protocol; if (_controllerHttpsPort != null) { leaderHostPort.setSecond(_controllerHttpsPort); protocol = HTTPS_PROTOCOL; diff --git a/pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java b/pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java index 4e8d69a..99b6315 100644 --- a/pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java +++ b/pinot-spi/src/main/java/org/apache/pinot/spi/utils/CommonConstants.java @@ -324,6 +324,11 @@ public class CommonConstants { public static final String CONFIG_OF_SEGMENT_UPLOAD_REQUEST_TIMEOUT_MS = "upload.request.timeout.ms"; /** + * Specify connection scheme to use for controller upload connections. Defaults to "http" + */ + public static final String CONFIG_OF_PROTOCOL = "protocol"; + + /** * Service token for accessing protected controller APIs. * E.g. null (auth disabled), "Basic abcdef..." (basic auth), "Bearer 123def..." (oauth2) */ --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org