Github user joshelser commented on a diff in the pull request:
https://github.com/apache/phoenix/pull/236#discussion_r122076328
--- Diff:
phoenix-queryserver/src/main/java/org/apache/phoenix/queryserver/server/QueryServer.java
---
@@ -233,16 +240,29 @@ public int run(String[] args) throws Exception {
// Build and start the HttpServer
server = builder.build();
server.start();
+ registerToServiceProvider(hostname);
runningLatch.countDown();
server.join();
return 0;
} catch (Throwable t) {
LOG.fatal("Unrecoverable service error. Shutting down.", t);
this.t = t;
return -1;
+ } finally {
+ deRegister();
}
}
+ private void registerToServiceProvider(String hostName) throws Exception
{
+ PqsZookeeperConf pqsZookeeperConf = new
PqsZookeeperConfImpl(getConf());
--- End diff --
> implementation in load balancer module and interface def in query server
module
Correct.
> Then load the implementation in queryserver module via service loader
from loadbalancer module
Yup
> How do make query server dependent on load balancer module when load
balancer has a dependency on queryserver. Is there any plugin to load the jars
from loadbalancer into queryserver target
This is what ServiceLoader solves. Perhaps you do not understand how
ServiceLoader works? At compile time, PQS only knows about the interface. At
runtime, both the interface and the implementation are present. ServiceLoader
provides the implementation of the interface (based on the runtime classpath).
---
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.
---