Skip to content

Commit

Permalink
Fix with getting connectionInfo from operation service node
Browse files Browse the repository at this point in the history
(cherry picked from commit bb05224)
  • Loading branch information
Kirill380 committed Apr 27, 2017
1 parent e5d5b3e commit 637b42b
Showing 1 changed file with 12 additions and 9 deletions.
Expand Up @@ -149,27 +149,30 @@ protected Set<ProtocolConnectionData> filterProtocolInstances(List<ProtocolVersi
for (TransportMetaData md : node.getTransports()) { for (TransportMetaData md : node.getTransports()) {
if (md.getId() == key.getProtocolId() && md.getMinSupportedVersion() <= key.getVersion() if (md.getId() == key.getProtocolId() && md.getMinSupportedVersion() <= key.getVersion()
&& key.getVersion() <= md.getMaxSupportedVersion()) { && key.getVersion() <= md.getMaxSupportedVersion()) {
result.add(toProtocolConnectionData(node, md, key.getVersion())); result.addAll(toProtocolConnectionData(node, md, key.getVersion()));
} }
} }
} }
} }
return result; return result;
} }


private ProtocolConnectionData toProtocolConnectionData(OperationsNodeInfo node, private Set<ProtocolConnectionData> toProtocolConnectionData(OperationsNodeInfo node,
TransportMetaData md, TransportMetaData md,
int version) { int version) {
byte[] connectionData = null; byte[] connectionData = null;
Set<ProtocolConnectionData> result = new HashSet<>();
for (VersionConnectionInfoPair pair : md.getConnectionInfo()) { for (VersionConnectionInfoPair pair : md.getConnectionInfo()) {
if (version == pair.getVersion()) { if (version == pair.getVersion()) {
connectionData = pair.getConenctionInfo().array(); result.add(new ProtocolConnectionData(ServerNameUtil.crc32(node.getConnectionInfo()),
new ProtocolVersionId(md.getId(), version),
pair.getConenctionInfo().array())
);

} }
} }
return new ProtocolConnectionData(
ServerNameUtil.crc32(node.getConnectionInfo()), return result;
new ProtocolVersionId(md.getId(), version),
connectionData);
} }




Expand Down

0 comments on commit 637b42b

Please sign in to comment.