diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-16 23:38:24 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-10-17 10:52:58 +0200 |
commit | 65eb08a7ffd6690e5b500ac5dddcc2e9b92e0f7a (patch) | |
tree | 56dd62041a5a50f4bebc68270ba7ecac998f389a /messagebus/src/main | |
parent | b527d0d66226ee4a1d037df237c416e2e8ea46a0 (diff) |
Fully remove OOS stuff from java too.
Diffstat (limited to 'messagebus/src/main')
3 files changed, 3 insertions, 77 deletions
diff --git a/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetwork.java b/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetwork.java index bb0b7bdd878..99863b449be 100644 --- a/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetwork.java +++ b/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetwork.java @@ -56,7 +56,6 @@ public class RPCNetwork implements Network, MethodHandler { private static final Logger log = Logger.getLogger(RPCNetwork.class.getName()); private final AtomicBoolean destroyed = new AtomicBoolean(false); private final Identity identity; - private final OOSManager oosManager; private final Supervisor orb; private final RPCTargetPool targetPool; private final RPCServicePool servicePool; @@ -105,7 +104,6 @@ public class RPCNetwork implements Network, MethodHandler { task.jrtTask.scheduleNow(); register = new Register(orb, slobrokConfig.getSlobroks(), identity.getHostname(), listener.port()); mirror = new Mirror(orb, slobrokConfig.getSlobroks()); - oosManager = new OOSManager(orb, mirror, params.getOOSServerPattern()); } /** @@ -141,7 +139,7 @@ public class RPCNetwork implements Network, MethodHandler { @Override public boolean waitUntilReady(double seconds) { for (int i = 0; i < seconds * 100; ++i) { - if (mirror.ready() && oosManager.isReady()) { + if (mirror.ready()) { return true; } try { @@ -305,10 +303,6 @@ public class RPCNetwork implements Network, MethodHandler { * @return Any error encountered, or null. */ public Error resolveServiceAddress(RoutingNode recipient, String serviceName) { - if (oosManager.isOOS(serviceName)) { - return new Error(ErrorCode.SERVICE_OOS, - "The service '" + serviceName + "' has been marked as out of service."); - } RPCServiceAddress ret = servicePool.resolve(serviceName); if (ret == null) { return new Error(ErrorCode.NO_ADDRESS_FOR_SERVICE, @@ -402,15 +396,6 @@ public class RPCNetwork implements Network, MethodHandler { return orb; } - /** - * Returns the oos manager object so that it can be manually queried about out-of-service services. - * - * @return The oos manager. - */ - public OOSManager getOOSManager() { - return oosManager; - } - ExecutorService getExecutor() { return executor; } diff --git a/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetworkParams.java b/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetworkParams.java index d35fbc01d90..ae58afe6be0 100755 --- a/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetworkParams.java +++ b/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/RPCNetworkParams.java @@ -105,26 +105,6 @@ public class RPCNetworkParams { } /** - * Returns the config id pattern used to lookup OOS servers. - * - * @return The config id. - */ - public String getOOSServerPattern() { - return oosServerPattern; - } - - /** - * Sets the config id pattern used to lookup OOS servers. - * - * @param oosServerPattern The server pattern. - * @return This, to allow chaining. - */ - public RPCNetworkParams setOOSServerPattern(String oosServerPattern) { - this.oosServerPattern = oosServerPattern; - return this; - } - - /** * Returns the port to listen to. * * @return The port. diff --git a/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/test/TestServer.java b/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/test/TestServer.java index 1745babe5c3..f36f7612f0e 100644 --- a/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/test/TestServer.java +++ b/messagebus/src/main/java/com/yahoo/messagebus/network/rpc/test/TestServer.java @@ -38,15 +38,13 @@ public class TestServer { * @param name The service name prefix for this server. * @param table The routing table spec to be used, may be null for no routing. * @param slobrok The slobrok to register with (local). - * @param oosServerPattern the string pattern for oos servers, may be null for deactivate. * @param protocol The protocol that this server should support in addition to SimpleProtocol. */ - public TestServer(String name, RoutingTableSpec table, Slobrok slobrok, String oosServerPattern, Protocol protocol) { + public TestServer(String name, RoutingTableSpec table, Slobrok slobrok, Protocol protocol) { this(new MessageBusParams().addProtocol(new SimpleProtocol()), new RPCNetworkParams() .setIdentity(new Identity(name)) - .setSlobrokConfigId(getSlobrokConfig(slobrok)) - .setOOSServerPattern(oosServerPattern)); + .setSlobrokConfigId(getSlobrokConfig(slobrok))); if (protocol != null) { mb.putProtocol(protocol); } @@ -153,43 +151,6 @@ public class TestServer { return false; } - /** - * Wait for some service to go out-of-service. - * - * @param service The service to wait for. - * @return Whether or not the service went out-of-service. - */ - public boolean waitOOS(String service) { - return waitState(new OOSState().add(service, true)); - } - - /** - * Wait for a required OOS state. - * - * @param oosState The state to wait for. - * @return Whether or not the required state was reached. - */ - public boolean waitState(OOSState oosState) { - for (int i = 0; i < 1000 && !Thread.currentThread().isInterrupted(); ++i) { - boolean done = true; - for (String service : oosState.getServices()) { - if (net.getOOSManager().isOOS(service) != oosState.isOOS(service)) { - done = false; - } - } - if (done) { - return true; - } - try { - Thread.sleep(10); - } - catch (InterruptedException e) { - // ignore - } - } - return false; - } - public static class VersionedRPCNetwork extends RPCNetwork { private Version version = Vtag.currentVersion; |