Github user paul-rogers commented on a diff in the pull request:
https://github.com/apache/drill/pull/565#discussion_r82268707
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/auth/AbstractDrillLoginService.java
---
@@ -46,8 +46,11 @@ protected DrillClient createDrillClient(final String
userName, final String pass
try {
// Create a DrillClient
- drillClient = new DrillClient(drillbitContext.getConfig(),
- drillbitContext.getClusterCoordinator(),
drillbitContext.getAllocator());
+ drillClient = DrillClient.newBuilder()
+ .setConfig(drillbitContext.getConfig())
+ .setClusterCoordinator(drillbitContext.getClusterCoordinator())
+ .setAllocator(drillbitContext.getAllocator())
+ .build();
--- End diff --
Should the builder be extended to also (optionally) do connect? Or, return
a connect builder?
Here I'm thinking that it would be helpful to have a single builder gather
things like the user name property and the connection string (which would seem
to be a DrillClient parameter but is actually a connection property.)
That is, either:
DrillClient.builder( ) ...
.withUser( userName )
.connectTo( "myHost", 1234 )
.build( );
Or
DrillClient.builder( ) ...
.buildClient( )
.withUser( userName )
.connectTo( "myHost", 1234 )
.connect( );
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---