summaryrefslogtreecommitdiffstats
path: root/container-search/src
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2020-01-20 10:55:20 +0100
committerJon Bratseth <bratseth@verizonmedia.com>2020-01-20 10:55:20 +0100
commit0074597688138ffc2d667481022d3a53998eb58d (patch)
tree3321642d8138c34cb7f2c38d09ef1c9a3dfeddac /container-search/src
parent19c9987d9e5e38996b51ca5d11f152a9392ddc83 (diff)
Add and propagate isBlockingWrite field
Diffstat (limited to 'container-search/src')
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/rpc/Client.java4
-rw-r--r--container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcPing.java9
2 files changed, 8 insertions, 5 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/Client.java b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/Client.java
index e54e2187818..bc0a38617ee 100644
--- a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/Client.java
+++ b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/Client.java
@@ -13,6 +13,7 @@ import java.util.Optional;
* @author bratseth
*/
interface Client {
+
/** Creates a connection to a particular node in this */
NodeConnection createConnection(String hostname, int port);
@@ -21,6 +22,7 @@ interface Client {
}
class ResponseOrError<T> {
+
final Optional<T> response;
final Optional<String> error;
@@ -93,6 +95,7 @@ interface Client {
}
class ProtobufResponse {
+
private final byte compression;
private final int uncompressedSize;
private final byte[] compressedPayload;
@@ -114,6 +117,7 @@ interface Client {
public byte[] compressedPayload() {
return compressedPayload;
}
+
}
}
diff --git a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcPing.java b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcPing.java
index 3c4735e57e2..e0f1dc5e675 100644
--- a/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcPing.java
+++ b/container-search/src/main/java/com/yahoo/search/dispatch/rpc/RpcPing.java
@@ -58,8 +58,7 @@ public class RpcPing implements Callable<Pong> {
var ping = SearchProtocol.MonitorRequest.newBuilder().build().toByteArray();
double timeoutSeconds = ((double) clusterMonitor.getConfiguration().getRequestTimeout()) / 1000.0;
Compressor.Compression compressionResult = resourcePool.compressor().compress(PING_COMPRESSION, ping);
- connection.request(RPC_METHOD, compressionResult.type(), ping.length, compressionResult.data(), rsp -> queue.add(rsp),
- timeoutSeconds);
+ connection.request(RPC_METHOD, compressionResult.type(), ping.length, compressionResult.data(), rsp -> queue.add(rsp), timeoutSeconds);
}
private Pong decodeReply(ProtobufResponse response) throws InvalidProtocolBufferException {
@@ -68,12 +67,12 @@ public class RpcPing implements Callable<Pong> {
var reply = SearchProtocol.MonitorReply.parseFrom(responseBytes);
if (reply.getDistributionKey() != node.key()) {
- return new Pong(ErrorMessage.createBackendCommunicationError(
- "Expected pong from node id " + node.key() + ", response is from id " + reply.getDistributionKey()));
+ return new Pong(ErrorMessage.createBackendCommunicationError("Expected pong from node id " + node.key() +
+ ", response is from id " + reply.getDistributionKey()));
} else if (!reply.getOnline()) {
return new Pong(ErrorMessage.createBackendCommunicationError("Node id " + node.key() + " reports being offline"));
} else {
- return new Pong(reply.getActiveDocs());
+ return new Pong(reply.getActiveDocs(), reply.getIsBlockingWrites());
}
}