summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHarald Musum <musum@oath.com>2017-11-14 08:19:04 +0100
committerHarald Musum <musum@oath.com>2017-11-14 08:19:04 +0100
commit6a9c6010fb290a7343285b44827cb9a7fa558bff (patch)
treea9e2346b0c7f203ca9060868279690a2aa92591b /config
parent795122be6d0676bbedf99d2413d1db2c2b64098a (diff)
Register receiveFile with the client supervisor
Since the server will use the same connection to call receiveFile after the client have called serveFile we need to register the RPC method using the same supervisor as the client uses. Also some preparations for making the code more reusable for others.
Diffstat (limited to 'config')
-rw-r--r--config/src/main/java/com/yahoo/config/subscription/impl/MockConnection.java6
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/ConnectionPool.java4
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java6
3 files changed, 16 insertions, 0 deletions
diff --git a/config/src/main/java/com/yahoo/config/subscription/impl/MockConnection.java b/config/src/main/java/com/yahoo/config/subscription/impl/MockConnection.java
index bd9a49c2fe2..cb623437dba 100644
--- a/config/src/main/java/com/yahoo/config/subscription/impl/MockConnection.java
+++ b/config/src/main/java/com/yahoo/config/subscription/impl/MockConnection.java
@@ -3,6 +3,7 @@ package com.yahoo.config.subscription.impl;
import com.yahoo.jrt.Request;
import com.yahoo.jrt.RequestWaiter;
+import com.yahoo.jrt.Supervisor;
import com.yahoo.vespa.config.ConfigPayload;
import com.yahoo.vespa.config.Connection;
import com.yahoo.vespa.config.ConnectionPool;
@@ -96,6 +97,11 @@ public class MockConnection implements ConnectionPool, com.yahoo.vespa.config.Co
return numSpecs;
}
+ @Override
+ public Supervisor getSupervisor() {
+ return null;
+ }
+
public int getNumberOfRequests() {
return numberOfRequests;
}
diff --git a/config/src/main/java/com/yahoo/vespa/config/ConnectionPool.java b/config/src/main/java/com/yahoo/vespa/config/ConnectionPool.java
index 8ea2800e65e..5a6f8a8848b 100644
--- a/config/src/main/java/com/yahoo/vespa/config/ConnectionPool.java
+++ b/config/src/main/java/com/yahoo/vespa/config/ConnectionPool.java
@@ -1,6 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config;
+import com.yahoo.jrt.Supervisor;
+
/**
* @author hmusum
*/
@@ -15,4 +17,6 @@ public interface ConnectionPool {
Connection setNewCurrentConnection();
int getSize();
+
+ Supervisor getSupervisor();
}
diff --git a/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java b/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java
index bb8f7e9f9ce..efeaacf225b 100644
--- a/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java
+++ b/config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java
@@ -25,6 +25,7 @@ import java.util.logging.Logger;
* @author hmusum
*/
public class JRTConnectionPool implements ConnectionPool {
+
private static final Logger log = Logger.getLogger(JRTConnectionPool.class.getName());
private final Supervisor supervisor = new Supervisor(new Transport());
@@ -150,4 +151,9 @@ public class JRTConnectionPool implements ConnectionPool {
}
}
+ @Override
+ public Supervisor getSupervisor() {
+ return supervisor;
+ }
+
}