Slackbot
08/30/2022, 7:00 PMAdam Peck
08/30/2022, 7:13 PMIf noproperty is set, the Router will also default to using the Rendezvous Hash Balancer.druid.router.avatica.balancer
Adam Peck
08/30/2022, 7:14 PMDidip Kerabat
08/30/2022, 7:15 PMDidip Kerabat
08/30/2022, 7:18 PMDidip Kerabat
08/30/2022, 7:27 PMString connectionId = getAvaticaConnectionId(requestMap);
targetServer = hostFinder.findServerAvatica(connectionId);
byte[] requestBytes = objectMapper.writeValueAsBytes(requestMap);
request.setAttribute(AVATICA_QUERY_ATTRIBUTE, requestBytes);
LOG.debug("Forwarding JDBC connection [%s] to broker [%s]", connectionId, targetServer.getHost());Didip Kerabat
08/30/2022, 7:29 PMDidip Kerabat
08/30/2022, 7:30 PMpublic Collection<Server> getAllServers()
{
return hostSelector.getAllBrokers().values().stream()
.flatMap(Collection::stream)
.collect(Collectors.toList());
}
and then
public Server findServerAvatica(String connectionId)
{
Server chosenServer = avaticaConnectionBalancer.pickServer(getAllServers(), connectionId);
}Adam Peck
08/30/2022, 7:32 PMDidip Kerabat
08/30/2022, 7:42 PMDidip Kerabat
08/30/2022, 7:43 PMdruid.host=xxx is ip address based.
That caused this code here:
public Collection<Server> getAllServers()
{
return hostSelector.getAllBrokers().values().stream()
.flatMap(Collection::stream)
.collect(Collectors.toList());
}
To possible contain non-existent IP addresses because sometimes pods disappeared and ZK somehow still keep track of that IP addresses.Didip Kerabat
08/30/2022, 7:44 PMAdam Peck
08/30/2022, 8:29 PMAbhishek Agarwal
08/31/2022, 6:04 AMDidip Kerabat
09/01/2022, 9:00 PMAbhishek Agarwal
09/02/2022, 9:53 AM