saltosaurus commented on issue #10714:
URL: https://github.com/apache/pinot/issues/10714#issuecomment-1533125747

   Our configuration:
   
   `public DataSource pinotDatabase(PinotConfig pinotConfig) {
           Map<String, PinotClientProperties> clients = 
pinotConfig.getClients();
           Optional<PinotClientProperties> client = 
clients.values().stream().findFirst();
   
           String host;
           Properties props = new Properties();
           props.put("headers.Authorization", 
toBasicAuthToken(pinotConfig.getUsername(), pinotConfig.getPassword()));
           if (client.isPresent()) {
               PinotClientProperties clientProperties = client.get();
               host = String.format("jdbc:pinot://%s:%s", 
clientProperties.getHosts().get(0), client.get().getPort());
           } else {
               throw new DataLabException(false,
                       "Unable to find cluster name configured under key 
'pinot.clients' in application.yml.");
           }
   
           DriverManagerDataSource dataSource = new DriverManagerDataSource();
           dataSource.setUrl(host);
           dataSource.setDriverClassName("org.apache.pinot.client.PinotDriver");
           dataSource.setConnectionProperties(props);
           return dataSource;
       }`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to