summaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/container/Server.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-11-29 20:55:08 -0800
committerJon Bratseth <bratseth@oath.com>2018-11-29 20:55:08 -0800
commit1f6befd078307c2862e4b0bd9d54c0658e49b9bd (patch)
tree542d4af90ffc46f6b1259074125fdfe4ee0a0951 /container-core/src/main/java/com/yahoo/container/Server.java
parentf72b86aac9ed460779080f22b3f84c8a75a317ab (diff)
Remove zombie code
Diffstat (limited to 'container-core/src/main/java/com/yahoo/container/Server.java')
-rw-r--r--container-core/src/main/java/com/yahoo/container/Server.java50
1 files changed, 5 insertions, 45 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/Server.java b/container-core/src/main/java/com/yahoo/container/Server.java
index 293e8b4674e..a4dec6de5a2 100644
--- a/container-core/src/main/java/com/yahoo/container/Server.java
+++ b/container-core/src/main/java/com/yahoo/container/Server.java
@@ -3,83 +3,43 @@ package com.yahoo.container;
import com.yahoo.config.subscription.ConfigSubscriber;
import com.yahoo.container.QrConfig.Rpc;
-import com.yahoo.container.osgi.ContainerRpcAdaptor;
/**
* The http server singleton managing listeners for various ports,
* and the threads used to respond to requests on the ports
*
* @author bratseth
+ * @deprecated
*/
@SuppressWarnings("deprecation")
+@Deprecated // TODO: Remove this when the last usage og getServerDiscriminator is removed
public class Server {
//TODO: Make this final again.
- private static Server instance = new Server();
- private ConfigSubscriber subscriber = new ConfigSubscriber();
-
- /** The OSGi container instance of this server */
- private Container container = Container.get();
+ private static final Server instance = new Server();
/** A short string which is different for all the qrserver instances on a given node. */
private String localServerDiscriminator = "qrserver.0";
- /** Creates a new server instance. Not usually useful, use get() to get the current server */
private Server() { }
- /** @deprecated returns 0 */
- @Deprecated
- public int searchQueriesInFlight() {
- return 0;
- }
-
- /**
- * An estimate of current number of connections. It is better to be
- * inaccurate than to acquire a lock per query fsync.
- *
- * @return The current number of open search connections
- */
- /** @deprecated returns 0 */
- @Deprecated
- public int getCurrentConnections() {
- return 0;
- }
-
public static Server get() {
return instance;
}
- private void initRpcServer(Rpc rpcConfig) {
- if (rpcConfig.enabled()) {
- ContainerRpcAdaptor rpcAdaptor = container.getRpcAdaptor();
- rpcAdaptor.listen(rpcConfig.port());
- rpcAdaptor.setSlobrokId(rpcConfig.slobrokId());
- }
- }
-
- /** Ugly hack, see Container.resetInstance */
- static void resetInstance() {
- instance = new Server();
- }
-
- // TODO: Make independent of config
public void initialize(QrConfig config) {
localServerDiscriminator = config.discriminator();
- container.setupFileAcquirer(config.filedistributor());
- initRpcServer(config.rpc());
}
/**
* A string unique for this QRS on this server.
*
* @return a server specific string
+ * @deprecated do not use
*/
+ @Deprecated
public String getServerDiscriminator() {
return localServerDiscriminator;
}
- public void shutdown() {
- if (subscriber!=null) subscriber.close();
- }
-
}