summaryrefslogtreecommitdiffstats
path: root/container-disc/src
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-12-01 18:33:01 -0800
committerGitHub <noreply@github.com>2018-12-01 18:33:01 -0800
commitdb32d4cb929c6931825875d80ef8d4ff2dc367e1 (patch)
treeb7237df951072a75d3d527b757f11e6b08214c3d /container-disc/src
parenta8277a3a486f7fd174e562bf174cfa72aede9cee (diff)
Revert "Bratseth/remove unused rpc server take 3"
Diffstat (limited to 'container-disc/src')
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java31
1 files changed, 2 insertions, 29 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java b/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java
index 8ab39ca8166..69a525a2c54 100644
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java
+++ b/container-disc/src/main/java/com/yahoo/container/jdisc/ConfiguredApplication.java
@@ -5,13 +5,13 @@ import com.google.common.collect.MapMaker;
import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Injector;
-import com.yahoo.cloud.config.SlobroksConfig;
import com.yahoo.component.provider.ComponentRegistry;
import com.yahoo.concurrent.DaemonThreadFactory;
import com.yahoo.config.ConfigInstance;
import com.yahoo.config.subscription.ConfigInterruptedException;
import com.yahoo.container.Container;
import com.yahoo.container.QrConfig;
+import com.yahoo.container.Server;
import com.yahoo.container.core.ChainsConfig;
import com.yahoo.container.core.config.HandlersConfigurerDi;
import com.yahoo.container.di.config.Subscriber;
@@ -30,14 +30,8 @@ import com.yahoo.jdisc.handler.RequestHandler;
import com.yahoo.jdisc.service.ClientProvider;
import com.yahoo.jdisc.service.ServerProvider;
import com.yahoo.jrt.ListenFailedException;
-import com.yahoo.jrt.Spec;
-import com.yahoo.jrt.Supervisor;
-import com.yahoo.jrt.Transport;
-import com.yahoo.jrt.slobrok.api.Register;
-import com.yahoo.jrt.slobrok.api.SlobrokList;
import com.yahoo.log.LogLevel;
import com.yahoo.log.LogSetup;
-import com.yahoo.net.HostName;
import com.yahoo.osgi.OsgiImpl;
import com.yahoo.vespa.config.ConfigKey;
import com.yahoo.yolean.Exceptions;
@@ -79,7 +73,6 @@ public final class ConfiguredApplication implements Application {
private final ContainerDiscApplication applicationWithLegacySetup;
private final OsgiFramework osgiFramework;
private final com.yahoo.jdisc.Timer timerSingleton;
-
//TODO: FilterChainRepository should instead always be set up in the model.
private final FilterChainRepository defaultFilterChainRepository =
new FilterChainRepository(new ChainsConfig(new ChainsConfig.Builder()),
@@ -94,7 +87,6 @@ public final class ConfiguredApplication implements Application {
private Thread reconfigurerThread;
private Thread portWatcher;
private QrConfig qrConfig;
- private Register slobrokRegistrator = null;
static {
LogSetup.initVespaLogging("Container");
@@ -130,9 +122,6 @@ public final class ConfiguredApplication implements Application {
@Override
public void start() {
qrConfig = getConfig(QrConfig.class);
- SlobroksConfig slobroksConfig = getConfig(SlobroksConfig.class);
- slobrokRegistrator = registerInSlobrok(slobroksConfig, qrConfig);
-
hackToInitializeServer(qrConfig);
ContainerBuilder builder = createBuilderWithGuiceBindings();
@@ -145,23 +134,10 @@ public final class ConfiguredApplication implements Application {
portWatcher.start();
}
- /** The container has no rpc methods, but we still need to register it in Slobrok to enable orchestration */
- private Register registerInSlobrok(SlobroksConfig slobrokConfig, QrConfig qrConfig) {
- SlobrokList slobrokList = new SlobrokList();
- slobrokList.setup(slobrokConfig.slobrok().stream().map(SlobroksConfig.Slobrok::connectionspec).toArray(String[]::new));
- Spec mySpec = new Spec(HostName.getLocalhost(), qrConfig.rpc().port());
- Register slobrokRegistrator = new Register(new Supervisor(new Transport()), slobrokList, mySpec);
- slobrokRegistrator.registerName(qrConfig.rpc().slobrokId());
- log.log(LogLevel.INFO,
- "Registered name '" + qrConfig.rpc().slobrokId() + "' at " + mySpec + " with: " + slobrokList);
- return slobrokRegistrator;
- }
- @SuppressWarnings("deprecation")
private static void hackToInitializeServer(QrConfig config) {
try {
- Container.get().setupFileAcquirer(config.filedistributor());
- com.yahoo.container.Server.get().initialize(config);
+ Server.get().initialize(config);
} catch (Exception e) {
log.log(LogLevel.ERROR, "Caught exception when initializing server. Exiting.", e);
Runtime.getRuntime().halt(1);
@@ -318,9 +294,6 @@ public final class ConfiguredApplication implements Application {
configurer.shutdown(new Deconstructor(false));
Container.get().shutdown();
- if (slobrokRegistrator != null)
- slobrokRegistrator.shutdown();
-
log.info("Stop: Finished");
}