/** * @param msg Finish message. */ private void sendFinish(UserManagementOperationFinishedMessage msg) { try { ctx.io().sendToGridTopic(coordinator(), GridTopic.TOPIC_AUTH, msg, GridIoPolicy.SYSTEM_POOL); } catch (Exception e) { U.error(log, "Failed to send UserManagementOperationFinishedMessage [op=" + msg.operationId() + ", node=" + coordinator() + ", err=" + msg.errorMessage() + ']', e); } }
/** * @param nodeId Left node ID. */ private void onNodeLeft(UUID nodeId) { synchronized (mux) { if (!ctx.clientNode()) { for (UserOperationFinishFuture f : opFinishFuts.values()) f.onNodeLeft(nodeId); } // Found all auth requests that were be sent to left node. // Complete these futures with special exception to retry authentication. for (Iterator<Map.Entry<IgniteUuid, AuthenticateFuture>> it = authFuts.entrySet().iterator(); it.hasNext(); ) { AuthenticateFuture f = it.next().getValue(); if (F.eq(nodeId, f.nodeId())) { f.retry(true); f.onDone(); it.remove(); } } // Coordinator left if (F.eq(coordinator().id(), nodeId)) { // Refresh info about coordinator node. crdNode = null; if (curOpFinishMsg != null) sendFinish(curOpFinishMsg); } } }
/** * Checks whether local node is coordinator. Nodes that are leaving or failed * (but are still in topology) are removed from search. * * @return {@code true} if local node is coordinator. */ private boolean isLocalNodeCoordinator() { DiscoverySpi spi = ctx.discovery().getInjectedDiscoverySpi(); if (spi instanceof TcpDiscoverySpi) return ((TcpDiscoverySpi)spi).isLocalNodeCoordinator(); else return F.eq(ctx.localNodeId(), coordinator().id()); }
if (coordinator() == null) return; if (F.eq(coordinator().id(), ctx.localNodeId())) { if (!isEnabled) return; Boolean rmtEnabled = coordinator().attribute(IgniteNodeAttributes.ATTR_AUTHENTICATION_ENABLED);
/** * @param msg Finish message. */ private void sendFinish(UserManagementOperationFinishedMessage msg) { try { ctx.io().sendToGridTopic(coordinator(), GridTopic.TOPIC_AUTH, msg, GridIoPolicy.SYSTEM_POOL); } catch (Exception e) { U.error(log, "Failed to send UserManagementOperationFinishedMessage [op=" + msg.operationId() + ", node=" + coordinator() + ", err=" + msg.errorMessage() + ']', e); } }
/** * @param nodeId Left node ID. */ private void onNodeLeft(UUID nodeId) { synchronized (mux) { if (!ctx.clientNode()) { for (UserOperationFinishFuture f : opFinishFuts.values()) f.onNodeLeft(nodeId); } // Found all auth requests that were be sent to left node. // Complete these futures with special exception to retry authentication. for (Iterator<Map.Entry<IgniteUuid, AuthenticateFuture>> it = authFuts.entrySet().iterator(); it.hasNext(); ) { AuthenticateFuture f = it.next().getValue(); if (F.eq(nodeId, f.nodeId())) { f.retry(true); f.onDone(); it.remove(); } } // Coordinator left if (F.eq(coordinator().id(), nodeId)) { // Refresh info about coordinator node. crdNode = null; if (curOpFinishMsg != null) sendFinish(curOpFinishMsg); } } }
/** * Checks whether local node is coordinator. Nodes that are leaving or failed * (but are still in topology) are removed from search. * * @return {@code true} if local node is coordinator. */ private boolean isLocalNodeCoordinator() { DiscoverySpi spi = ctx.discovery().getInjectedDiscoverySpi(); if (spi instanceof TcpDiscoverySpi) return ((TcpDiscoverySpi)spi).isLocalNodeCoordinator(); else return F.eq(ctx.localNodeId(), coordinator().id()); }
if (coordinator() == null) return; if (F.eq(coordinator().id(), ctx.localNodeId())) { if (!isEnabled) return; Boolean rmtEnabled = coordinator().attribute(IgniteNodeAttributes.ATTR_AUTHENTICATION_ENABLED);