Package com.hazelcast.nio

Examples of com.hazelcast.nio.Connection


    void handleEvent(Packet packet) {
        try {
            eventExecutor.execute(new RemoteEventPacketProcessor(packet));
        } catch (RejectedExecutionException e) {
            if (eventExecutor.isLive()) {
                Connection conn = packet.getConn();
                String endpoint = conn.getEndPoint() != null ? conn.getEndPoint().toString() : conn.toString();
                logFailure("EventQueue overloaded! Failed to process event packet sent from: %s",  endpoint);
            }
        }
    }
View Full Code Here


    @Override
    public void run() {
        NodeEngineImpl nodeEngine = (NodeEngineImpl) getNodeEngine();
        ConnectionManager connectionManager = nodeEngine.getNode().getConnectionManager();
        Connection connection = getConnection();
        connectionManager.destroyConnection(connection);

        ILogger logger = nodeEngine.getLogger("com.hazelcast.cluster");
        logger.warning("Node could not join cluster at node: " + connection.getEndPoint()
                + " Cause: the target cluster has a different group-name");

        Node node = nodeEngine.getNode();
        node.getJoiner().blacklist(getCallerAddress());
    }
View Full Code Here

        return validJoinRequest;
    }

    private void logIfConnectionToEndpointIsMissing(long now, MemberImpl member) {
        if ((now - member.getLastRead()) >= PING_INTERVAL && (now - member.getLastPing()) >= PING_INTERVAL) {
            Connection conn = node.connectionManager.getOrConnect(member.getAddress());
            if (conn == null || !conn.isAlive()) {
                logger.warning("This node does not have a connection to " + member);
            }
        }
    }
View Full Code Here

            }
            if (node.isMaster()) {
                setJoins.remove(new MemberInfo(deadAddress));
                resetMemberMasterConfirmations();
            }
            final Connection conn = node.connectionManager.getConnection(deadAddress);
            if (destroyConnection && conn != null) {
                node.connectionManager.destroyConnection(conn);
            }
            MemberImpl deadMember = getMember(deadAddress);
            if (deadMember != null) {
View Full Code Here

            if (node.isMaster() || target.equals(node.getMasterAddress())) {
                logger.warning("New join request has been received from an existing endpoint! => " + member
                        + " Removing old member and processing join request...");

                doRemoveAddress(target, false);
                Connection existing = node.connectionManager.getConnection(target);
                if (existing != connection) {
                    node.connectionManager.destroyConnection(existing);
                    node.connectionManager.registerConnection(target, connection);
                }
                return false;
View Full Code Here

            } else if (currentMaster.equals(callerAddress)) {
                    logger.info("Setting master to: " + masterAddress + ", since "
                            + currentMaster + " says it's not master anymore.");
                    setMasterAndJoin(masterAddress);
            } else {
                final Connection conn = node.connectionManager.getConnection(currentMaster);
                if (conn != null && conn.isAlive()) {
                    logger.info("Ignoring master response: " + masterAddress + " from: " + callerAddress
                            + ", since this node has an active master: " + currentMaster);
                    sendJoinRequest(currentMaster, true);
                } else {
                    logger.warning("Ambiguous master response, this node has a master: " + currentMaster
View Full Code Here

        }
    }

    protected final boolean isValid() {
        final ClusterServiceImpl clusterService = getService();
        final Connection conn = getConnection();
        final Address masterAddress = conn != null ? conn.getEndPoint() : null;
        boolean isLocal = conn == null;
        return isLocal
                || (masterAddress != null && masterAddress.equals(clusterService.getMasterAddress()));
    }
View Full Code Here

            if (targetAddress.equals(node.getThisAddress()) || isLocalAddress(targetAddress)) {
                node.setAsMaster();
                return;
            }
            long joinStartTime = Clock.currentTimeMillis();
            Connection connection;
            while (node.isActive() && !node.joined() && (Clock.currentTimeMillis() - joinStartTime < maxJoinMillis)) {
                connection = node.connectionManager.getOrConnect(targetAddress);
                if (connection == null) {
                    //noinspection BusyWait
                    Thread.sleep(JOIN_RETRY_WAIT_TIME);
View Full Code Here

                //noinspection BusyWait
                Thread.sleep(1500);
            } catch (InterruptedException e) {
                return;
            }
            final Connection conn = node.connectionManager.getConnection(possibleAddress);
            if (conn != null) {
                final JoinRequest response = node.clusterService.checkJoinInfo(possibleAddress);
                if (response != null && shouldMerge(response)) {
                    logger.warning(node.getThisAddress() + " is merging [tcp/ip] to " + possibleAddress);
                    setTargetAddress(possibleAddress);
View Full Code Here

TOP

Related Classes of com.hazelcast.nio.Connection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.