diff options
author | Jon Bratseth <bratseth@oath.com> | 2018-08-09 13:15:43 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@oath.com> | 2018-08-09 13:15:43 +0200 |
commit | 1d9b5de7f789abfce05a0b8d47a6a714e487cd47 (patch) | |
tree | 283cc7abf1c83360869584393f2aae7596fa1487 /container-search/src/main/java/com/yahoo/fs4 | |
parent | e09bb9cd8d69b3008cc1ea95e2ef4c9aa85182af (diff) |
Test that distribution key is carried from direct search to rpc summary
Diffstat (limited to 'container-search/src/main/java/com/yahoo/fs4')
-rw-r--r-- | container-search/src/main/java/com/yahoo/fs4/mplex/Backend.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/container-search/src/main/java/com/yahoo/fs4/mplex/Backend.java b/container-search/src/main/java/com/yahoo/fs4/mplex/Backend.java index 68a13c06e32..3eabc3c6a6c 100644 --- a/container-search/src/main/java/com/yahoo/fs4/mplex/Backend.java +++ b/container-search/src/main/java/com/yahoo/fs4/mplex/Backend.java @@ -66,7 +66,7 @@ public class Backend implements ConnectionFactory { /** * For unit testing. do not use */ - protected Backend() { + protected Backend(Optional<Integer> distributionKey) { listeners = null; host = null; port = 0; @@ -74,7 +74,7 @@ public class Backend implements ConnectionFactory { packetDumper = null; address = null; connectionPool = new ConnectionPool(); - distributionKey = Optional.empty(); + this.distributionKey = distributionKey; } public Backend(String host, @@ -197,7 +197,7 @@ public class Backend implements ConnectionFactory { //============================================================ /** Opens a new channel to fdispatch. Analogous to the "Channel" concept as used in FS4. */ - public FS4Channel openChannel () { + public FS4Channel openChannel() { int cachedChannelId; synchronized (this) { if (channelId >= ((1 << 31) - 2)) { @@ -214,7 +214,7 @@ public class Backend implements ConnectionFactory { return chan; } - public FS4Channel openPingChannel () { + public FS4Channel openPingChannel() { FS4Channel chan = FS4Channel.createPingChannel(this); synchronized (pingChannels) { pingChannels.add(chan); @@ -251,7 +251,7 @@ public class Backend implements ConnectionFactory { * Return the first channel in the queue waiting for pings or * <code>null</code> if none. */ - public FS4Channel getPingChannel () { + public FS4Channel getPingChannel() { synchronized (pingChannels) { return (pingChannels.isEmpty()) ? null : pingChannels.getFirst(); } @@ -266,7 +266,7 @@ public class Backend implements ConnectionFactory { * or <code>null</code> if the channel is not in the * set of active channels. */ - public FS4Channel getChannel (int id) { + public FS4Channel getChannel(int id) { return getChannel(Integer.valueOf(id)); } @@ -280,7 +280,7 @@ public class Backend implements ConnectionFactory { * with this id or <code>null</code> if the channel is * not in the set of active channels. */ - protected FS4Channel removeChannel (Integer id) { + protected FS4Channel removeChannel(Integer id) { synchronized (activeChannels) { return activeChannels.remove(id); } @@ -295,7 +295,7 @@ public class Backend implements ConnectionFactory { * the queue of ping channels or <code>null</code> * if there are no active ping channels. */ - protected FS4Channel removePingChannel () { + protected FS4Channel removePingChannel() { synchronized (pingChannels) { if (pingChannels.isEmpty()) return null; |