You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/06/02 21:56:22 UTC

[GitHub] [incubator-pinot] apucher opened a new pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

apucher opened a new pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010


   ## Description
   This PR adds a cross-integration test of Realtime & Basic Auth & TLS to get ahead of the rapid adoption of these features by our community. This effort also uncovered #7009 where segment upload fails on HTTPS-exclusive controllers. This PR also contains an appropriate fix.
   
   ## Upgrade Notes
   Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)
   * [ ] Yes (Please label as **<code>backward-incompat</code>**, and complete the section below on Release Notes)
   
   Does this PR fix a zero-downtime upgrade introduced earlier?
   * [ ] Yes (Please label this as **<code>backward-incompat</code>**, and complete the section below on Release Notes)
   
   Does this PR otherwise need attention when creating release notes? Things to consider:
   - New configuration options
   - Deprecation of configurations
   - Signature changes to public methods/interfaces
   - New plugins added or old plugins removed
   * [ ] Yes (Please label this PR as **<code>release-notes</code>** and complete the section on Release Notes)
   ## Release Notes
   * adds new TLS configuration option `pinot.server.segment.uploader.protocol` (which defaults to `http`) to gracefully handle HTTPS-only controllers in realtime scenarios
   
   ## Documentation
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] codecov-commenter edited a comment on pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#issuecomment-853476127


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#7010](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (67d3d3d) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/637cc34941372c7b1154534e8bdf52df504189b1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (637cc34) will **decrease** coverage by `7.70%`.
   > The diff coverage is `44.44%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/7010/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #7010      +/-   ##
   ============================================
   - Coverage     73.10%   65.39%   -7.71%     
     Complexity       12       12              
   ============================================
     Files          1451     1451              
     Lines         71826    71980     +154     
     Branches      10412    10418       +6     
   ============================================
   - Hits          52508    47073    -5435     
   - Misses        15781    21511    +5730     
   + Partials       3537     3396     -141     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration | `?` | |
   | unittests | `65.39% <44.44%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...main/java/org/apache/pinot/core/util/TlsUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS91dGlsL1Rsc1V0aWxzLmphdmE=) | `17.80% <ø> (ø)` | |
   | [...va/org/apache/pinot/spi/utils/CommonConstants.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdXRpbHMvQ29tbW9uQ29uc3RhbnRzLmphdmE=) | `29.82% <ø> (ø)` | |
   | [...altime/ServerSegmentCompletionProtocolHandler.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VydmVyL3JlYWx0aW1lL1NlcnZlclNlZ21lbnRDb21wbGV0aW9uUHJvdG9jb2xIYW5kbGVyLmphdmE=) | `6.66% <33.33%> (-41.88%)` | :arrow_down: |
   | [...inot/client/JsonAsyncHttpPinotClientTransport.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0pzb25Bc3luY0h0dHBQaW5vdENsaWVudFRyYW5zcG9ydC5qYXZh) | `12.90% <36.36%> (-47.10%)` | :arrow_down: |
   | [...ava/org/apache/pinot/client/ConnectionFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb25GYWN0b3J5LmphdmE=) | `28.57% <44.44%> (-17.59%)` | :arrow_down: |
   | [...ient/JsonAsyncHttpPinotClientTransportFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0pzb25Bc3luY0h0dHBQaW5vdENsaWVudFRyYW5zcG9ydEZhY3RvcnkuamF2YQ==) | `50.00% <53.84%> (-16.67%)` | :arrow_down: |
   | [...a/org/apache/pinot/minion/metrics/MinionMeter.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25NZXRlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../apache/pinot/common/metrics/BrokerQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9Ccm9rZXJRdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../apache/pinot/minion/metrics/MinionQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25RdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...pache/pinot/common/utils/grpc/GrpcQueryClient.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vdXRpbHMvZ3JwYy9HcnBjUXVlcnlDbGllbnQuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [350 more](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [637cc34...67d3d3d](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] apucher commented on a change in pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
apucher commented on a change in pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#discussion_r645203205



##########
File path: pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java
##########
@@ -64,6 +65,7 @@ public static void init(PinotConfiguration uploaderConfig) {
       _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);

Review comment:
       `CONFIG_OF_CONTROLLER_HTTPS_ENABLED` really is a feature flag that configures a hand-rolled TLS key and truststore. it also requires a dedicated https port (there may be only one)




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] codecov-commenter commented on pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#issuecomment-853476127


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#7010](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a3d6be1) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/637cc34941372c7b1154534e8bdf52df504189b1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (637cc34) will **decrease** coverage by `7.71%`.
   > The diff coverage is `58.53%`.
   
   > :exclamation: Current head a3d6be1 differs from pull request most recent head 8f97bd7. Consider uploading reports for the commit 8f97bd7 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/7010/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #7010      +/-   ##
   ============================================
   - Coverage     73.10%   65.38%   -7.72%     
     Complexity       12       12              
   ============================================
     Files          1451     1450       -1     
     Lines         71826    71851      +25     
     Branches      10412    10416       +4     
   ============================================
   - Hits          52508    46983    -5525     
   - Misses        15781    21469    +5688     
   + Partials       3537     3399     -138     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration | `?` | |
   | unittests | `65.38% <58.53%> (-0.02%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...main/java/org/apache/pinot/core/util/TlsUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS91dGlsL1Rsc1V0aWxzLmphdmE=) | `17.80% <ø> (ø)` | |
   | [...va/org/apache/pinot/spi/utils/CommonConstants.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdXRpbHMvQ29tbW9uQ29uc3RhbnRzLmphdmE=) | `29.82% <ø> (ø)` | |
   | [...ava/org/apache/pinot/client/ConnectionFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb25GYWN0b3J5LmphdmE=) | `18.18% <33.33%> (-27.98%)` | :arrow_down: |
   | [...altime/ServerSegmentCompletionProtocolHandler.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VydmVyL3JlYWx0aW1lL1NlcnZlclNlZ21lbnRDb21wbGV0aW9uUHJvdG9jb2xIYW5kbGVyLmphdmE=) | `6.66% <33.33%> (-41.88%)` | :arrow_down: |
   | [...ient/JsonAsyncHttpPinotClientTransportFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0pzb25Bc3luY0h0dHBQaW5vdENsaWVudFRyYW5zcG9ydEZhY3RvcnkuamF2YQ==) | `50.00% <53.84%> (-16.67%)` | :arrow_down: |
   | [...inot/client/JsonAsyncHttpPinotClientTransport.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0pzb25Bc3luY0h0dHBQaW5vdENsaWVudFRyYW5zcG9ydC5qYXZh) | `18.75% <61.53%> (-41.25%)` | :arrow_down: |
   | [...ot/core/query/pruner/ColumnValueSegmentPruner.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9wcnVuZXIvQ29sdW1uVmFsdWVTZWdtZW50UHJ1bmVyLmphdmE=) | `85.71% <100.00%> (-7.21%)` | :arrow_down: |
   | [...a/org/apache/pinot/minion/metrics/MinionMeter.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25NZXRlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../apache/pinot/common/metrics/BrokerQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9Ccm9rZXJRdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../apache/pinot/minion/metrics/MinionQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25RdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [343 more](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [637cc34...8f97bd7](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] codecov-commenter edited a comment on pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#issuecomment-853476127


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#7010](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (67d3d3d) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/637cc34941372c7b1154534e8bdf52df504189b1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (637cc34) will **increase** coverage by `0.25%`.
   > The diff coverage is `75.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/7010/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #7010      +/-   ##
   ============================================
   + Coverage     73.10%   73.35%   +0.25%     
     Complexity       12       12              
   ============================================
     Files          1451     1451              
     Lines         71826    71980     +154     
     Branches      10412    10418       +6     
   ============================================
   + Hits          52508    52803     +295     
   + Misses        15781    15652     -129     
   + Partials       3537     3525      -12     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration | `41.97% <69.44%> (+0.17%)` | :arrow_up: |
   | unittests | `65.39% <44.44%> (-0.01%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...main/java/org/apache/pinot/core/util/TlsUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS91dGlsL1Rsc1V0aWxzLmphdmE=) | `71.23% <ø> (+53.42%)` | :arrow_up: |
   | [...va/org/apache/pinot/spi/utils/CommonConstants.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdXRpbHMvQ29tbW9uQ29uc3RhbnRzLmphdmE=) | `29.82% <ø> (ø)` | |
   | [...ava/org/apache/pinot/client/ConnectionFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb25GYWN0b3J5LmphdmE=) | `50.00% <66.66%> (+3.84%)` | :arrow_up: |
   | [...inot/client/JsonAsyncHttpPinotClientTransport.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0pzb25Bc3luY0h0dHBQaW5vdENsaWVudFRyYW5zcG9ydC5qYXZh) | `58.06% <72.72%> (-1.94%)` | :arrow_down: |
   | [...ient/JsonAsyncHttpPinotClientTransportFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0pzb25Bc3luY0h0dHBQaW5vdENsaWVudFRyYW5zcG9ydEZhY3RvcnkuamF2YQ==) | `78.57% <76.92%> (+11.90%)` | :arrow_up: |
   | [...altime/ServerSegmentCompletionProtocolHandler.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VydmVyL3JlYWx0aW1lL1NlcnZlclNlZ21lbnRDb21wbGV0aW9uUHJvdG9jb2xIYW5kbGVyLmphdmE=) | `49.52% <100.00%> (+0.98%)` | :arrow_up: |
   | [...a/manager/realtime/RealtimeSegmentDataManager.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9kYXRhL21hbmFnZXIvcmVhbHRpbWUvUmVhbHRpbWVTZWdtZW50RGF0YU1hbmFnZXIuamF2YQ==) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [...ot/plugin/minion/tasks/SegmentConversionUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtcGx1Z2lucy9waW5vdC1taW5pb24tdGFza3MvcGlub3QtbWluaW9uLWJ1aWx0aW4tdGFza3Mvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3Bpbm90L3BsdWdpbi9taW5pb24vdGFza3MvU2VnbWVudENvbnZlcnNpb25VdGlscy5qYXZh) | `32.14% <0.00%> (-20.80%)` | :arrow_down: |
   | [...org/apache/pinot/core/minion/rollup/MergeType.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9taW5pb24vcm9sbHVwL01lcmdlVHlwZS5qYXZh) | `60.00% <0.00%> (-20.00%)` | :arrow_down: |
   | [.../tasks/BaseMultipleSegmentsConversionExecutor.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtcGx1Z2lucy9waW5vdC1taW5pb24tdGFza3MvcGlub3QtbWluaW9uLWJ1aWx0aW4tdGFza3Mvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3Bpbm90L3BsdWdpbi9taW5pb24vdGFza3MvQmFzZU11bHRpcGxlU2VnbWVudHNDb252ZXJzaW9uRXhlY3V0b3IuamF2YQ==) | `81.01% <0.00%> (-8.82%)` | :arrow_down: |
   | ... and [50 more](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [637cc34...67d3d3d](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] codecov-commenter edited a comment on pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#issuecomment-853476127






-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] apucher commented on pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
apucher commented on pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#issuecomment-854265623


   appreciated. added deprecation annotations and comments


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#discussion_r645062551



##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/ConnectionFactory.java
##########
@@ -40,20 +37,20 @@ private ConnectionFactory() {
    * @return A connection that connects to the brokers in the given Helix cluster
    */
   public static Connection fromZookeeper(String zkUrl) {
-    return fromZookeeper(zkUrl, null);
+    return fromZookeeper(zkUrl, new JsonAsyncHttpPinotClientTransportFactory().buildTransport());

Review comment:
       Consider keeping a static default `PinotClientTransport` to be reused?

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(SSLContext sslContext, Map<String, String> headers, String scheme) {

Review comment:
       Annotate all arguments with nullable

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;

Review comment:
       `_httpClient`, `_headers` and `_scheme` can be private final, `_sslContext` can be local variable 

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransportFactory.java
##########
@@ -18,19 +18,46 @@
  */
 package org.apache.pinot.client;
 
+import java.util.HashMap;
 import java.util.Map;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
+
 
 /**
  * Pinot client transport factory for JSON encoded BrokerResults through HTTP.
  */
-class JsonAsyncHttpPinotClientTransportFactory implements PinotClientTransportFactory {
+public class JsonAsyncHttpPinotClientTransportFactory implements PinotClientTransportFactory {
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;

Review comment:
       private

##########
File path: pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java
##########
@@ -64,6 +65,7 @@ public static void init(PinotConfiguration uploaderConfig) {
       _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);

Review comment:
       Do we need this extra config? If https is enabled, can we directly set https as the scheme?

##########
File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
##########
@@ -158,8 +159,17 @@ protected void startController(Map<String, Object> properties) {
 
     ControllerConf config = new ControllerConf(properties);
 
-    _controllerPort = Integer.valueOf(config.getControllerPort());
-    _controllerBaseApiUrl = "http://localhost:" + _controllerPort;
+    String controllerScheme = "http";
+    if (StringUtils.isNotBlank(config.getControllerVipProtocol())) {
+      controllerScheme = config.getControllerVipProtocol();
+    }
+
+    _controllerPort = DEFAULT_CONTROLLER_PORT;
+    if (StringUtils.isNotBlank(config.getControllerPort())) {

Review comment:
       I think controller port is mandatory

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -131,6 +131,27 @@ protected void startBrokers(int numBrokers, int basePort, String zkStr)
     _brokerBaseApiUrl = "http://localhost:" + _brokerPorts.get(0);
   }
 
+  protected void startBrokerHttps()
+      throws Exception {
+    _brokerStarters = new ArrayList<>();
+    _brokerPorts = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultBrokerConfiguration().toMap();
+    properties.put(Broker.CONFIG_OF_BROKER_TIMEOUT_MS, 60 * 1000L);
+    properties.put(Broker.CONFIG_OF_DELAY_SHUTDOWN_TIME_MS, 0);
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideBrokerConf(configuration);
+
+    HelixBrokerStarter brokerStarter =
+        new HelixBrokerStarter(configuration, getHelixClusterName(), getZkUrl(), LOCAL_HOST);
+    brokerStarter.start();
+    _brokerStarters.add(brokerStarter);
+
+    _brokerPorts.add(DEFAULT_BROKER_PORT);

Review comment:
       Don't hard-code the broker port. It might be occupied in certain environment. You may check the open port similar to the `startBrokers()`

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthTlsRealtimeIntegrationTest.java
##########
@@ -0,0 +1,260 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.integration.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.base.Preconditions;
+import groovy.lang.IntRange;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.pinot.client.Connection;
+import org.apache.pinot.client.ConnectionFactory;
+import org.apache.pinot.client.JsonAsyncHttpPinotClientTransportFactory;
+import org.apache.pinot.client.Request;
+import org.apache.pinot.client.ResultSetGroup;
+import org.apache.pinot.common.utils.FileUploadDownloadClient;
+import org.apache.pinot.core.common.MinionConstants;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableTaskConfig;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.spi.utils.builder.TableNameBuilder;
+import org.apache.pinot.util.TestUtils;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.apache.pinot.integration.tests.BasicAuthTestUtils.AUTH_HEADER;
+
+
+public class BasicAuthTlsRealtimeIntegrationTest extends BaseClusterIntegrationTest {

Review comment:
       Should we replace the `BasicAuthRealtimeIntegrationTest` with this one? I think this one covers all the test cases in the other one?
   Currently the integration test suite already takes more than 1 hour to finish

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -196,6 +217,24 @@ protected void startServers(int numServers, PinotConfiguration configuration, in
     }
   }
 
+  protected void startServerHttps() {
+    FileUtils.deleteQuietly(new File(Server.DEFAULT_INSTANCE_BASE_DIR));
+    _serverStarters = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultServerConfiguration().toMap();
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideServerConf(configuration);

Review comment:
       Do we need to set extra properties like `startServers()`?

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(SSLContext sslContext, Map<String, String> headers, String scheme) {
     _headers = headers;
+    _scheme = scheme;

Review comment:
       Use default scheme (HTTP) if the given scheme is null

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -79,7 +79,7 @@
  */
 public abstract class ClusterTest extends ControllerTest {
   private static final Logger LOGGER = LoggerFactory.getLogger(ClusterTest.class);
-  private static final int DEFAULT_BROKER_PORT = 18099;
+  protected static final int DEFAULT_BROKER_PORT = 18099;

Review comment:
       Don't expose this, we should check the actual broker port instead of using this default port because the default port might not be the actual port




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] apucher commented on a change in pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
apucher commented on a change in pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#discussion_r645198813



##########
File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
##########
@@ -158,8 +159,17 @@ protected void startController(Map<String, Object> properties) {
 
     ControllerConf config = new ControllerConf(properties);
 
-    _controllerPort = Integer.valueOf(config.getControllerPort());
-    _controllerBaseApiUrl = "http://localhost:" + _controllerPort;
+    String controllerScheme = "http";
+    if (StringUtils.isNotBlank(config.getControllerVipProtocol())) {
+      controllerScheme = config.getControllerVipProtocol();
+    }
+
+    _controllerPort = DEFAULT_CONTROLLER_PORT;
+    if (StringUtils.isNotBlank(config.getControllerPort())) {

Review comment:
       this has changed with the TLS listener spec PR. if `controller.port` is set we turn it into a spec, but it's optional as long as there's a spec.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#discussion_r645188315



##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,49 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.annotation.Nullable;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  private final Map<String, String> _headers;
+  private final String _scheme;
+
+  private final AsyncHttpClient _httpClient;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _headers = new HashMap<>();
+    _scheme = CommonConstants.HTTP_PROTOCOL;
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(@Nullable SSLContext sslContext, Map<String, String> headers,

Review comment:
       (nit) Shall we put the nullable `sslContext` as the last parameter?

##########
File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
##########
@@ -158,8 +159,17 @@ protected void startController(Map<String, Object> properties) {
 
     ControllerConf config = new ControllerConf(properties);
 
-    _controllerPort = Integer.valueOf(config.getControllerPort());
-    _controllerBaseApiUrl = "http://localhost:" + _controllerPort;
+    String controllerScheme = "http";
+    if (StringUtils.isNotBlank(config.getControllerVipProtocol())) {
+      controllerScheme = config.getControllerVipProtocol();
+    }
+
+    _controllerPort = DEFAULT_CONTROLLER_PORT;
+    if (StringUtils.isNotBlank(config.getControllerPort())) {

Review comment:
       ^^

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthTlsRealtimeIntegrationTest.java
##########
@@ -0,0 +1,260 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.integration.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.base.Preconditions;
+import groovy.lang.IntRange;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.pinot.client.Connection;
+import org.apache.pinot.client.ConnectionFactory;
+import org.apache.pinot.client.JsonAsyncHttpPinotClientTransportFactory;
+import org.apache.pinot.client.Request;
+import org.apache.pinot.client.ResultSetGroup;
+import org.apache.pinot.common.utils.FileUploadDownloadClient;
+import org.apache.pinot.core.common.MinionConstants;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableTaskConfig;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.spi.utils.builder.TableNameBuilder;
+import org.apache.pinot.util.TestUtils;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.apache.pinot.integration.tests.BasicAuthTestUtils.AUTH_HEADER;
+
+
+public class BasicAuthTlsRealtimeIntegrationTest extends BaseClusterIntegrationTest {

Review comment:
       If the `BasicAuthRealtimeIntegrationTest` is fully covered by this test, let's at least exclude it from the CI run (check `pom.xml` for `pinot-integration-tests`) to reduce the run time. We can keep both of them for debugging purpose

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -131,6 +131,27 @@ protected void startBrokers(int numBrokers, int basePort, String zkStr)
     _brokerBaseApiUrl = "http://localhost:" + _brokerPorts.get(0);
   }
 
+  protected void startBrokerHttps()
+      throws Exception {
+    _brokerStarters = new ArrayList<>();
+    _brokerPorts = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultBrokerConfiguration().toMap();
+    properties.put(Broker.CONFIG_OF_BROKER_TIMEOUT_MS, 60 * 1000L);
+    properties.put(Broker.CONFIG_OF_DELAY_SHUTDOWN_TIME_MS, 0);
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideBrokerConf(configuration);
+
+    HelixBrokerStarter brokerStarter =
+        new HelixBrokerStarter(configuration, getHelixClusterName(), getZkUrl(), LOCAL_HOST);
+    brokerStarter.start();
+    _brokerStarters.add(brokerStarter);
+
+    _brokerPorts.add(DEFAULT_BROKER_PORT);

Review comment:
       I see. Then probably add some comments describing why this needs to be hard-coded to prevent people changing it and running into problems

##########
File path: pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java
##########
@@ -64,6 +65,7 @@ public static void init(PinotConfiguration uploaderConfig) {
       _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);

Review comment:
       I don't quite follow the logic here. Is it possible that we don't enable `CONFIG_OF_CONTROLLER_HTTPS_ENABLED` but config the protocol to be `HTTPS`?
   In line 198, when `_controllerHttpsPort` is set, it automatically use `HTTPS`




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] apucher commented on pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
apucher commented on pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#issuecomment-854265623


   appreciated. added deprecation annotations and comments


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] apucher commented on a change in pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
apucher commented on a change in pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#discussion_r645170448



##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -79,7 +79,7 @@
  */
 public abstract class ClusterTest extends ControllerTest {
   private static final Logger LOGGER = LoggerFactory.getLogger(ClusterTest.class);
-  private static final int DEFAULT_BROKER_PORT = 18099;
+  protected static final int DEFAULT_BROKER_PORT = 18099;

Review comment:
       see above

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -196,6 +217,24 @@ protected void startServers(int numServers, PinotConfiguration configuration, in
     }
   }
 
+  protected void startServerHttps() {
+    FileUtils.deleteQuietly(new File(Server.DEFAULT_INSTANCE_BASE_DIR));
+    _serverStarters = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultServerConfiguration().toMap();
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideServerConf(configuration);

Review comment:
       turns out the test code already sets default values for pinot server in involved ways. imo pinot's test code should be cleaned up, but that's another story

##########
File path: pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java
##########
@@ -64,6 +65,7 @@ public static void init(PinotConfiguration uploaderConfig) {
       _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);

Review comment:
       unfortunately, the way `ServerSegmentCompletionProtocolHandler` is written and used, there's no sane way to pass "non-specific" configs. Afaik LinkedIn has some internal dependencies on this behavior, so I can't change it either.




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
Jackie-Jiang commented on a change in pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#discussion_r645062551



##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/ConnectionFactory.java
##########
@@ -40,20 +37,20 @@ private ConnectionFactory() {
    * @return A connection that connects to the brokers in the given Helix cluster
    */
   public static Connection fromZookeeper(String zkUrl) {
-    return fromZookeeper(zkUrl, null);
+    return fromZookeeper(zkUrl, new JsonAsyncHttpPinotClientTransportFactory().buildTransport());

Review comment:
       Consider keeping a static default `PinotClientTransport` to be reused?

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(SSLContext sslContext, Map<String, String> headers, String scheme) {

Review comment:
       Annotate all arguments with nullable

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;

Review comment:
       `_httpClient`, `_headers` and `_scheme` can be private final, `_sslContext` can be local variable 

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransportFactory.java
##########
@@ -18,19 +18,46 @@
  */
 package org.apache.pinot.client;
 
+import java.util.HashMap;
 import java.util.Map;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
+
 
 /**
  * Pinot client transport factory for JSON encoded BrokerResults through HTTP.
  */
-class JsonAsyncHttpPinotClientTransportFactory implements PinotClientTransportFactory {
+public class JsonAsyncHttpPinotClientTransportFactory implements PinotClientTransportFactory {
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;

Review comment:
       private

##########
File path: pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java
##########
@@ -64,6 +65,7 @@ public static void init(PinotConfiguration uploaderConfig) {
       _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);

Review comment:
       Do we need this extra config? If https is enabled, can we directly set https as the scheme?

##########
File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
##########
@@ -158,8 +159,17 @@ protected void startController(Map<String, Object> properties) {
 
     ControllerConf config = new ControllerConf(properties);
 
-    _controllerPort = Integer.valueOf(config.getControllerPort());
-    _controllerBaseApiUrl = "http://localhost:" + _controllerPort;
+    String controllerScheme = "http";
+    if (StringUtils.isNotBlank(config.getControllerVipProtocol())) {
+      controllerScheme = config.getControllerVipProtocol();
+    }
+
+    _controllerPort = DEFAULT_CONTROLLER_PORT;
+    if (StringUtils.isNotBlank(config.getControllerPort())) {

Review comment:
       I think controller port is mandatory

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -131,6 +131,27 @@ protected void startBrokers(int numBrokers, int basePort, String zkStr)
     _brokerBaseApiUrl = "http://localhost:" + _brokerPorts.get(0);
   }
 
+  protected void startBrokerHttps()
+      throws Exception {
+    _brokerStarters = new ArrayList<>();
+    _brokerPorts = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultBrokerConfiguration().toMap();
+    properties.put(Broker.CONFIG_OF_BROKER_TIMEOUT_MS, 60 * 1000L);
+    properties.put(Broker.CONFIG_OF_DELAY_SHUTDOWN_TIME_MS, 0);
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideBrokerConf(configuration);
+
+    HelixBrokerStarter brokerStarter =
+        new HelixBrokerStarter(configuration, getHelixClusterName(), getZkUrl(), LOCAL_HOST);
+    brokerStarter.start();
+    _brokerStarters.add(brokerStarter);
+
+    _brokerPorts.add(DEFAULT_BROKER_PORT);

Review comment:
       Don't hard-code the broker port. It might be occupied in certain environment. You may check the open port similar to the `startBrokers()`

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthTlsRealtimeIntegrationTest.java
##########
@@ -0,0 +1,260 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.integration.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.base.Preconditions;
+import groovy.lang.IntRange;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.pinot.client.Connection;
+import org.apache.pinot.client.ConnectionFactory;
+import org.apache.pinot.client.JsonAsyncHttpPinotClientTransportFactory;
+import org.apache.pinot.client.Request;
+import org.apache.pinot.client.ResultSetGroup;
+import org.apache.pinot.common.utils.FileUploadDownloadClient;
+import org.apache.pinot.core.common.MinionConstants;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableTaskConfig;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.spi.utils.builder.TableNameBuilder;
+import org.apache.pinot.util.TestUtils;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.apache.pinot.integration.tests.BasicAuthTestUtils.AUTH_HEADER;
+
+
+public class BasicAuthTlsRealtimeIntegrationTest extends BaseClusterIntegrationTest {

Review comment:
       Should we replace the `BasicAuthRealtimeIntegrationTest` with this one? I think this one covers all the test cases in the other one?
   Currently the integration test suite already takes more than 1 hour to finish

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -196,6 +217,24 @@ protected void startServers(int numServers, PinotConfiguration configuration, in
     }
   }
 
+  protected void startServerHttps() {
+    FileUtils.deleteQuietly(new File(Server.DEFAULT_INSTANCE_BASE_DIR));
+    _serverStarters = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultServerConfiguration().toMap();
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideServerConf(configuration);

Review comment:
       Do we need to set extra properties like `startServers()`?

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(SSLContext sslContext, Map<String, String> headers, String scheme) {
     _headers = headers;
+    _scheme = scheme;

Review comment:
       Use default scheme (HTTP) if the given scheme is null

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -79,7 +79,7 @@
  */
 public abstract class ClusterTest extends ControllerTest {
   private static final Logger LOGGER = LoggerFactory.getLogger(ClusterTest.class);
-  private static final int DEFAULT_BROKER_PORT = 18099;
+  protected static final int DEFAULT_BROKER_PORT = 18099;

Review comment:
       Don't expose this, we should check the actual broker port instead of using this default port because the default port might not be the actual port

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,49 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.annotation.Nullable;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  private final Map<String, String> _headers;
+  private final String _scheme;
+
+  private final AsyncHttpClient _httpClient;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _headers = new HashMap<>();
+    _scheme = CommonConstants.HTTP_PROTOCOL;
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(@Nullable SSLContext sslContext, Map<String, String> headers,

Review comment:
       (nit) Shall we put the nullable `sslContext` as the last parameter?

##########
File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
##########
@@ -158,8 +159,17 @@ protected void startController(Map<String, Object> properties) {
 
     ControllerConf config = new ControllerConf(properties);
 
-    _controllerPort = Integer.valueOf(config.getControllerPort());
-    _controllerBaseApiUrl = "http://localhost:" + _controllerPort;
+    String controllerScheme = "http";
+    if (StringUtils.isNotBlank(config.getControllerVipProtocol())) {
+      controllerScheme = config.getControllerVipProtocol();
+    }
+
+    _controllerPort = DEFAULT_CONTROLLER_PORT;
+    if (StringUtils.isNotBlank(config.getControllerPort())) {

Review comment:
       ^^

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthTlsRealtimeIntegrationTest.java
##########
@@ -0,0 +1,260 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.integration.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.base.Preconditions;
+import groovy.lang.IntRange;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.pinot.client.Connection;
+import org.apache.pinot.client.ConnectionFactory;
+import org.apache.pinot.client.JsonAsyncHttpPinotClientTransportFactory;
+import org.apache.pinot.client.Request;
+import org.apache.pinot.client.ResultSetGroup;
+import org.apache.pinot.common.utils.FileUploadDownloadClient;
+import org.apache.pinot.core.common.MinionConstants;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableTaskConfig;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.spi.utils.builder.TableNameBuilder;
+import org.apache.pinot.util.TestUtils;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.apache.pinot.integration.tests.BasicAuthTestUtils.AUTH_HEADER;
+
+
+public class BasicAuthTlsRealtimeIntegrationTest extends BaseClusterIntegrationTest {

Review comment:
       If the `BasicAuthRealtimeIntegrationTest` is fully covered by this test, let's at least exclude it from the CI run (check `pom.xml` for `pinot-integration-tests`) to reduce the run time. We can keep both of them for debugging purpose

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -131,6 +131,27 @@ protected void startBrokers(int numBrokers, int basePort, String zkStr)
     _brokerBaseApiUrl = "http://localhost:" + _brokerPorts.get(0);
   }
 
+  protected void startBrokerHttps()
+      throws Exception {
+    _brokerStarters = new ArrayList<>();
+    _brokerPorts = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultBrokerConfiguration().toMap();
+    properties.put(Broker.CONFIG_OF_BROKER_TIMEOUT_MS, 60 * 1000L);
+    properties.put(Broker.CONFIG_OF_DELAY_SHUTDOWN_TIME_MS, 0);
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideBrokerConf(configuration);
+
+    HelixBrokerStarter brokerStarter =
+        new HelixBrokerStarter(configuration, getHelixClusterName(), getZkUrl(), LOCAL_HOST);
+    brokerStarter.start();
+    _brokerStarters.add(brokerStarter);
+
+    _brokerPorts.add(DEFAULT_BROKER_PORT);

Review comment:
       I see. Then probably add some comments describing why this needs to be hard-coded to prevent people changing it and running into problems

##########
File path: pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java
##########
@@ -64,6 +65,7 @@ public static void init(PinotConfiguration uploaderConfig) {
       _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);

Review comment:
       I don't quite follow the logic here. Is it possible that we don't enable `CONFIG_OF_CONTROLLER_HTTPS_ENABLED` but config the protocol to be `HTTPS`?
   In line 198, when `_controllerHttpsPort` is set, it automatically use `HTTPS`




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] apucher merged pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
apucher merged pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010


   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] apucher commented on a change in pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
apucher commented on a change in pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#discussion_r645209149



##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,49 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.annotation.Nullable;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  private final Map<String, String> _headers;
+  private final String _scheme;
+
+  private final AsyncHttpClient _httpClient;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _headers = new HashMap<>();
+    _scheme = CommonConstants.HTTP_PROTOCOL;
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(@Nullable SSLContext sslContext, Map<String, String> headers,

Review comment:
       done




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] codecov-commenter commented on pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#issuecomment-853476127


   # [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#7010](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a3d6be1) into [master](https://codecov.io/gh/apache/incubator-pinot/commit/637cc34941372c7b1154534e8bdf52df504189b1?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (637cc34) will **decrease** coverage by `7.71%`.
   > The diff coverage is `58.53%`.
   
   > :exclamation: Current head a3d6be1 differs from pull request most recent head 8f97bd7. Consider uploading reports for the commit 8f97bd7 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/incubator-pinot/pull/7010/graphs/tree.svg?width=650&height=150&src=pr&token=4ibza2ugkz&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #7010      +/-   ##
   ============================================
   - Coverage     73.10%   65.38%   -7.72%     
     Complexity       12       12              
   ============================================
     Files          1451     1450       -1     
     Lines         71826    71851      +25     
     Branches      10412    10416       +4     
   ============================================
   - Hits          52508    46983    -5525     
   - Misses        15781    21469    +5688     
   + Partials       3537     3399     -138     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | integration | `?` | |
   | unittests | `65.38% <58.53%> (-0.02%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...main/java/org/apache/pinot/core/util/TlsUtils.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS91dGlsL1Rsc1V0aWxzLmphdmE=) | `17.80% <ø> (ø)` | |
   | [...va/org/apache/pinot/spi/utils/CommonConstants.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3Qtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9zcGkvdXRpbHMvQ29tbW9uQ29uc3RhbnRzLmphdmE=) | `29.82% <ø> (ø)` | |
   | [...ava/org/apache/pinot/client/ConnectionFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0Nvbm5lY3Rpb25GYWN0b3J5LmphdmE=) | `18.18% <33.33%> (-27.98%)` | :arrow_down: |
   | [...altime/ServerSegmentCompletionProtocolHandler.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VydmVyL3JlYWx0aW1lL1NlcnZlclNlZ21lbnRDb21wbGV0aW9uUHJvdG9jb2xIYW5kbGVyLmphdmE=) | `6.66% <33.33%> (-41.88%)` | :arrow_down: |
   | [...ient/JsonAsyncHttpPinotClientTransportFactory.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0pzb25Bc3luY0h0dHBQaW5vdENsaWVudFRyYW5zcG9ydEZhY3RvcnkuamF2YQ==) | `50.00% <53.84%> (-16.67%)` | :arrow_down: |
   | [...inot/client/JsonAsyncHttpPinotClientTransport.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY2xpZW50cy9waW5vdC1qYXZhLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY2xpZW50L0pzb25Bc3luY0h0dHBQaW5vdENsaWVudFRyYW5zcG9ydC5qYXZh) | `18.75% <61.53%> (-41.25%)` | :arrow_down: |
   | [...ot/core/query/pruner/ColumnValueSegmentPruner.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3QvY29yZS9xdWVyeS9wcnVuZXIvQ29sdW1uVmFsdWVTZWdtZW50UHJ1bmVyLmphdmE=) | `85.71% <100.00%> (-7.21%)` | :arrow_down: |
   | [...a/org/apache/pinot/minion/metrics/MinionMeter.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25NZXRlci5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../apache/pinot/common/metrics/BrokerQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9jb21tb24vbWV0cmljcy9Ccm9rZXJRdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../apache/pinot/minion/metrics/MinionQueryPhase.java](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGlub3QtbWluaW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9waW5vdC9taW5pb24vbWV0cmljcy9NaW5pb25RdWVyeVBoYXNlLmphdmE=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | ... and [343 more](https://codecov.io/gh/apache/incubator-pinot/pull/7010/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [637cc34...8f97bd7](https://codecov.io/gh/apache/incubator-pinot/pull/7010?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] apucher commented on a change in pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
apucher commented on a change in pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#discussion_r645170179



##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/ConnectionFactory.java
##########
@@ -40,20 +37,20 @@ private ConnectionFactory() {
    * @return A connection that connects to the brokers in the given Helix cluster
    */
   public static Connection fromZookeeper(String zkUrl) {
-    return fromZookeeper(zkUrl, null);
+    return fromZookeeper(zkUrl, new JsonAsyncHttpPinotClientTransportFactory().buildTransport());

Review comment:
       done. lazy default instance

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;

Review comment:
       done. all final

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransportFactory.java
##########
@@ -18,19 +18,46 @@
  */
 package org.apache.pinot.client;
 
+import java.util.HashMap;
 import java.util.Map;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
+
 
 /**
  * Pinot client transport factory for JSON encoded BrokerResults through HTTP.
  */
-class JsonAsyncHttpPinotClientTransportFactory implements PinotClientTransportFactory {
+public class JsonAsyncHttpPinotClientTransportFactory implements PinotClientTransportFactory {
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;

Review comment:
       done

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(SSLContext sslContext, Map<String, String> headers, String scheme) {

Review comment:
       added annotation to sslContext

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(SSLContext sslContext, Map<String, String> headers, String scheme) {
     _headers = headers;
+    _scheme = scheme;

Review comment:
       now requires explicit non-null value

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthTlsRealtimeIntegrationTest.java
##########
@@ -0,0 +1,260 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.integration.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.base.Preconditions;
+import groovy.lang.IntRange;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.pinot.client.Connection;
+import org.apache.pinot.client.ConnectionFactory;
+import org.apache.pinot.client.JsonAsyncHttpPinotClientTransportFactory;
+import org.apache.pinot.client.Request;
+import org.apache.pinot.client.ResultSetGroup;
+import org.apache.pinot.common.utils.FileUploadDownloadClient;
+import org.apache.pinot.core.common.MinionConstants;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableTaskConfig;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.spi.utils.builder.TableNameBuilder;
+import org.apache.pinot.util.TestUtils;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.apache.pinot.integration.tests.BasicAuthTestUtils.AUTH_HEADER;
+
+
+public class BasicAuthTlsRealtimeIntegrationTest extends BaseClusterIntegrationTest {

Review comment:
       imo since this is a cross-integration test we should at least be able to tell which aspect broke.
   
   Pinot isn't very helpful debugging these issues. If we remove the auth realtime test, we'll end up trouble shooting two enormous aspects - tls AND auth - when a breaking change happens.

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -131,6 +131,27 @@ protected void startBrokers(int numBrokers, int basePort, String zkStr)
     _brokerBaseApiUrl = "http://localhost:" + _brokerPorts.get(0);
   }
 
+  protected void startBrokerHttps()
+      throws Exception {
+    _brokerStarters = new ArrayList<>();
+    _brokerPorts = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultBrokerConfiguration().toMap();
+    properties.put(Broker.CONFIG_OF_BROKER_TIMEOUT_MS, 60 * 1000L);
+    properties.put(Broker.CONFIG_OF_DELAY_SHUTDOWN_TIME_MS, 0);
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideBrokerConf(configuration);
+
+    HelixBrokerStarter brokerStarter =
+        new HelixBrokerStarter(configuration, getHelixClusterName(), getZkUrl(), LOCAL_HOST);
+    brokerStarter.start();
+    _brokerStarters.add(brokerStarter);
+
+    _brokerPorts.add(DEFAULT_BROKER_PORT);

Review comment:
       I get your point, however, the broker's TLS listener spec requires hard-coding port numbers anyways




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] apucher commented on a change in pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
apucher commented on a change in pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#discussion_r645205644



##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -131,6 +131,27 @@ protected void startBrokers(int numBrokers, int basePort, String zkStr)
     _brokerBaseApiUrl = "http://localhost:" + _brokerPorts.get(0);
   }
 
+  protected void startBrokerHttps()
+      throws Exception {
+    _brokerStarters = new ArrayList<>();
+    _brokerPorts = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultBrokerConfiguration().toMap();
+    properties.put(Broker.CONFIG_OF_BROKER_TIMEOUT_MS, 60 * 1000L);
+    properties.put(Broker.CONFIG_OF_DELAY_SHUTDOWN_TIME_MS, 0);
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideBrokerConf(configuration);
+
+    HelixBrokerStarter brokerStarter =
+        new HelixBrokerStarter(configuration, getHelixClusterName(), getZkUrl(), LOCAL_HOST);
+    brokerStarter.start();
+    _brokerStarters.add(brokerStarter);
+
+    _brokerPorts.add(DEFAULT_BROKER_PORT);

Review comment:
       added

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthTlsRealtimeIntegrationTest.java
##########
@@ -0,0 +1,260 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.integration.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.base.Preconditions;
+import groovy.lang.IntRange;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.pinot.client.Connection;
+import org.apache.pinot.client.ConnectionFactory;
+import org.apache.pinot.client.JsonAsyncHttpPinotClientTransportFactory;
+import org.apache.pinot.client.Request;
+import org.apache.pinot.client.ResultSetGroup;
+import org.apache.pinot.common.utils.FileUploadDownloadClient;
+import org.apache.pinot.core.common.MinionConstants;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableTaskConfig;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.spi.utils.builder.TableNameBuilder;
+import org.apache.pinot.util.TestUtils;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.apache.pinot.integration.tests.BasicAuthTestUtils.AUTH_HEADER;
+
+
+public class BasicAuthTlsRealtimeIntegrationTest extends BaseClusterIntegrationTest {

Review comment:
       added, plus some javadoc




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org


[GitHub] [incubator-pinot] apucher commented on a change in pull request #7010: Cross-integration test of Realtime & Basic Auth & TLS

Posted by GitBox <gi...@apache.org>.
apucher commented on a change in pull request #7010:
URL: https://github.com/apache/incubator-pinot/pull/7010#discussion_r645170179



##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/ConnectionFactory.java
##########
@@ -40,20 +37,20 @@ private ConnectionFactory() {
    * @return A connection that connects to the brokers in the given Helix cluster
    */
   public static Connection fromZookeeper(String zkUrl) {
-    return fromZookeeper(zkUrl, null);
+    return fromZookeeper(zkUrl, new JsonAsyncHttpPinotClientTransportFactory().buildTransport());

Review comment:
       done. lazy default instance

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;

Review comment:
       done. all final

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransportFactory.java
##########
@@ -18,19 +18,46 @@
  */
 package org.apache.pinot.client;
 
+import java.util.HashMap;
 import java.util.Map;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
+
 
 /**
  * Pinot client transport factory for JSON encoded BrokerResults through HTTP.
  */
-class JsonAsyncHttpPinotClientTransportFactory implements PinotClientTransportFactory {
+public class JsonAsyncHttpPinotClientTransportFactory implements PinotClientTransportFactory {
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;

Review comment:
       done

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(SSLContext sslContext, Map<String, String> headers, String scheme) {

Review comment:
       added annotation to sslContext

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,47 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  AsyncHttpClient _httpClient;
+
+  Map<String, String> _headers = new HashMap<>();
+  String _scheme = CommonConstants.HTTP_PROTOCOL;
+  SSLContext _sslContext = null;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(SSLContext sslContext, Map<String, String> headers, String scheme) {
     _headers = headers;
+    _scheme = scheme;

Review comment:
       now requires explicit non-null value

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthTlsRealtimeIntegrationTest.java
##########
@@ -0,0 +1,260 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.integration.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.base.Preconditions;
+import groovy.lang.IntRange;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.pinot.client.Connection;
+import org.apache.pinot.client.ConnectionFactory;
+import org.apache.pinot.client.JsonAsyncHttpPinotClientTransportFactory;
+import org.apache.pinot.client.Request;
+import org.apache.pinot.client.ResultSetGroup;
+import org.apache.pinot.common.utils.FileUploadDownloadClient;
+import org.apache.pinot.core.common.MinionConstants;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableTaskConfig;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.spi.utils.builder.TableNameBuilder;
+import org.apache.pinot.util.TestUtils;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.apache.pinot.integration.tests.BasicAuthTestUtils.AUTH_HEADER;
+
+
+public class BasicAuthTlsRealtimeIntegrationTest extends BaseClusterIntegrationTest {

Review comment:
       imo since this is a cross-integration test we should at least be able to tell which aspect broke.
   
   Pinot isn't very helpful debugging these issues. If we remove the auth realtime test, we'll end up trouble shooting two enormous aspects - tls AND auth - when a breaking change happens.

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -131,6 +131,27 @@ protected void startBrokers(int numBrokers, int basePort, String zkStr)
     _brokerBaseApiUrl = "http://localhost:" + _brokerPorts.get(0);
   }
 
+  protected void startBrokerHttps()
+      throws Exception {
+    _brokerStarters = new ArrayList<>();
+    _brokerPorts = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultBrokerConfiguration().toMap();
+    properties.put(Broker.CONFIG_OF_BROKER_TIMEOUT_MS, 60 * 1000L);
+    properties.put(Broker.CONFIG_OF_DELAY_SHUTDOWN_TIME_MS, 0);
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideBrokerConf(configuration);
+
+    HelixBrokerStarter brokerStarter =
+        new HelixBrokerStarter(configuration, getHelixClusterName(), getZkUrl(), LOCAL_HOST);
+    brokerStarter.start();
+    _brokerStarters.add(brokerStarter);
+
+    _brokerPorts.add(DEFAULT_BROKER_PORT);

Review comment:
       I get your point, however, the broker's TLS listener spec requires hard-coding port numbers anyways

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -79,7 +79,7 @@
  */
 public abstract class ClusterTest extends ControllerTest {
   private static final Logger LOGGER = LoggerFactory.getLogger(ClusterTest.class);
-  private static final int DEFAULT_BROKER_PORT = 18099;
+  protected static final int DEFAULT_BROKER_PORT = 18099;

Review comment:
       see above

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -196,6 +217,24 @@ protected void startServers(int numServers, PinotConfiguration configuration, in
     }
   }
 
+  protected void startServerHttps() {
+    FileUtils.deleteQuietly(new File(Server.DEFAULT_INSTANCE_BASE_DIR));
+    _serverStarters = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultServerConfiguration().toMap();
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideServerConf(configuration);

Review comment:
       turns out the test code already sets default values for pinot server in involved ways. imo pinot's test code should be cleaned up, but that's another story

##########
File path: pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java
##########
@@ -64,6 +65,7 @@ public static void init(PinotConfiguration uploaderConfig) {
       _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);

Review comment:
       unfortunately, the way `ServerSegmentCompletionProtocolHandler` is written and used, there's no sane way to pass "non-specific" configs. Afaik LinkedIn has some internal dependencies on this behavior, so I can't change it either.

##########
File path: pinot-controller/src/test/java/org/apache/pinot/controller/helix/ControllerTest.java
##########
@@ -158,8 +159,17 @@ protected void startController(Map<String, Object> properties) {
 
     ControllerConf config = new ControllerConf(properties);
 
-    _controllerPort = Integer.valueOf(config.getControllerPort());
-    _controllerBaseApiUrl = "http://localhost:" + _controllerPort;
+    String controllerScheme = "http";
+    if (StringUtils.isNotBlank(config.getControllerVipProtocol())) {
+      controllerScheme = config.getControllerVipProtocol();
+    }
+
+    _controllerPort = DEFAULT_CONTROLLER_PORT;
+    if (StringUtils.isNotBlank(config.getControllerPort())) {

Review comment:
       this has changed with the TLS listener spec PR. if `controller.port` is set we turn it into a spec, but it's optional as long as there's a spec.

##########
File path: pinot-core/src/main/java/org/apache/pinot/server/realtime/ServerSegmentCompletionProtocolHandler.java
##########
@@ -64,6 +65,7 @@ public static void init(PinotConfiguration uploaderConfig) {
       _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);

Review comment:
       `CONFIG_OF_CONTROLLER_HTTPS_ENABLED` really is a feature flag that configures a hand-rolled TLS key and truststore. it also requires a dedicated https port (there may be only one)

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/ClusterTest.java
##########
@@ -131,6 +131,27 @@ protected void startBrokers(int numBrokers, int basePort, String zkStr)
     _brokerBaseApiUrl = "http://localhost:" + _brokerPorts.get(0);
   }
 
+  protected void startBrokerHttps()
+      throws Exception {
+    _brokerStarters = new ArrayList<>();
+    _brokerPorts = new ArrayList<>();
+
+    Map<String, Object> properties = getDefaultBrokerConfiguration().toMap();
+    properties.put(Broker.CONFIG_OF_BROKER_TIMEOUT_MS, 60 * 1000L);
+    properties.put(Broker.CONFIG_OF_DELAY_SHUTDOWN_TIME_MS, 0);
+
+    PinotConfiguration configuration = new PinotConfiguration(properties);
+    overrideBrokerConf(configuration);
+
+    HelixBrokerStarter brokerStarter =
+        new HelixBrokerStarter(configuration, getHelixClusterName(), getZkUrl(), LOCAL_HOST);
+    brokerStarter.start();
+    _brokerStarters.add(brokerStarter);
+
+    _brokerPorts.add(DEFAULT_BROKER_PORT);

Review comment:
       added

##########
File path: pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/BasicAuthTlsRealtimeIntegrationTest.java
##########
@@ -0,0 +1,260 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.integration.tests;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.base.Preconditions;
+import groovy.lang.IntRange;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.pinot.client.Connection;
+import org.apache.pinot.client.ConnectionFactory;
+import org.apache.pinot.client.JsonAsyncHttpPinotClientTransportFactory;
+import org.apache.pinot.client.Request;
+import org.apache.pinot.client.ResultSetGroup;
+import org.apache.pinot.common.utils.FileUploadDownloadClient;
+import org.apache.pinot.core.common.MinionConstants;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.config.table.TableTaskConfig;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.env.PinotConfiguration;
+import org.apache.pinot.spi.utils.JsonUtils;
+import org.apache.pinot.spi.utils.builder.TableNameBuilder;
+import org.apache.pinot.util.TestUtils;
+import org.testng.Assert;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import static org.apache.pinot.integration.tests.BasicAuthTestUtils.AUTH_HEADER;
+
+
+public class BasicAuthTlsRealtimeIntegrationTest extends BaseClusterIntegrationTest {

Review comment:
       added, plus some javadoc

##########
File path: pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/JsonAsyncHttpPinotClientTransport.java
##########
@@ -23,30 +23,49 @@
 import com.fasterxml.jackson.databind.node.JsonNodeFactory;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import com.ning.http.client.AsyncHttpClient;
+import com.ning.http.client.AsyncHttpClientConfig;
 import com.ning.http.client.Response;
+import java.util.HashMap;
 import java.util.Map;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
+import javax.annotation.Nullable;
+import javax.net.ssl.SSLContext;
+import org.apache.pinot.spi.utils.CommonConstants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
 /**
  * JSON encoded Pinot client transport over AsyncHttpClient.
  */
-class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
+public class JsonAsyncHttpPinotClientTransport implements PinotClientTransport {
   private static final Logger LOGGER = LoggerFactory.getLogger(JsonAsyncHttpPinotClientTransport.class);
   private static final ObjectReader OBJECT_READER = new ObjectMapper().reader();
 
-  AsyncHttpClient _httpClient = new AsyncHttpClient();
-  Map<String, String> _headers;
+  private final Map<String, String> _headers;
+  private final String _scheme;
+
+  private final AsyncHttpClient _httpClient;
 
   public JsonAsyncHttpPinotClientTransport() {
+    _headers = new HashMap<>();
+    _scheme = CommonConstants.HTTP_PROTOCOL;
+    _httpClient = new AsyncHttpClient();
   }
 
-  public JsonAsyncHttpPinotClientTransport(Map<String, String> headers) {
+  public JsonAsyncHttpPinotClientTransport(@Nullable SSLContext sslContext, Map<String, String> headers,

Review comment:
       done




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org