BinaryMetadataTransport: do not cache local node id, it can change after client reconnect.
@@ -68,9 +68,6 @@ final class BinaryMetadataTransport {
/** */
private final IgniteLogger log;
- /** */
- private final UUID locNodeId;
-
/** */
private final boolean clientNode;
@@ -117,8 +114,6 @@ final class BinaryMetadataTransport {
discoMgr = ctx.discovery();
- locNodeId = ctx.localNodeId();
-
clientNode = ctx.clientNode();
discoMgr.setCustomEventListener(MetadataUpdateProposedMessage.class, new MetadataUpdateProposedListener());
@@ -170,7 +165,7 @@ final class BinaryMetadataTransport {
unlabeledFutures.add(resFut);
if (!stopping)
- discoMgr.sendCustomEvent(new MetadataUpdateProposedMessage(metadata, locNodeId));
+ discoMgr.sendCustomEvent(new MetadataUpdateProposedMessage(metadata, ctx.localNodeId()));
else
resFut.onDone(MetadataUpdateResult.createUpdateDisabledResult());
}
@@ -299,7 +294,7 @@ final class BinaryMetadataTransport {
acceptedVer = msg.acceptedVersion();
}
- if (locNodeId.equals(msg.origNodeId())) {
+ if (ctx.localNodeId().equals(msg.origNodeId())) {
MetadataUpdateResultFuture fut = unlabeledFutures.poll();
if (msg.rejected())
@@ -540,12 +535,16 @@ final class BinaryMetadataTransport {
this.ver = ver;
}
- /** */
+ /**
+ * @return Type ID.
+ */
int typeId() {
return typeId;
}
- /** */
+ /**
+ * @return Version.
+ */
int version() {
return ver;
}
@@ -627,7 +626,6 @@ final class BinaryMetadataTransport {
* Listener is registered on each client node and listens for metadata responses from cluster.
*/
private final class MetadataResponseListener implements GridMessageListener {
-
/** {@inheritDoc} */
@Override public void onMessage(UUID nodeId, Object msg, byte plc) {
assert msg instanceof MetadataResponseMessage : msg;
@@ -674,8 +672,6 @@ final class BinaryMetadataTransport {
fut.onDone(MetadataUpdateResult.createFailureResult(new BinaryObjectException(e)));
}
}
-
-
}
/**
