Package org.apache.cassandra.streaming.messages

Examples of org.apache.cassandra.streaming.messages.StreamInitMessage


            // streaming connections are per-session and have a fixed version.  we can't do anything with a wrong-version stream connection, so drop it.
            if (version != StreamMessage.CURRENT_VERSION)
                throw new IOException(String.format("Received stream using protocol version %d (my version %d). Terminating connection", version, MessagingService.current_version));

            DataInput input = new DataInputStream(socket.getInputStream());
            StreamInitMessage init = StreamInitMessage.serializer.deserialize(input, version);

            // The initiator makes two connections, one for incoming and one for outgoing.
            // The receiving side distinguish two connections by looking at StreamInitMessage#isForOutgoing.
            // Note: we cannot use the same socket for incoming and outgoing streams because we want to
            // parallelize said streams and the socket is blocking, so we might deadlock.
View Full Code Here


                 : in;
        }

        public void sendInitMessage(boolean isForOutgoing) throws IOException
        {
            StreamInitMessage message = new StreamInitMessage(FBUtilities.getBroadcastAddress(), session.planId(), session.description(), isForOutgoing);
            getWriteChannel().write(message.createMessage(false, protocolVersion));
        }
View Full Code Here

                 : in;
        }

        public void sendInitMessage(Socket socket, boolean isForOutgoing) throws IOException
        {
            StreamInitMessage message = new StreamInitMessage(FBUtilities.getBroadcastAddress(), session.planId(), session.description(), isForOutgoing);
            ByteBuffer messageBuf = message.createMessage(false, protocolVersion);
            while (messageBuf.hasRemaining())
                getWriteChannel(socket).write(messageBuf);
        }
View Full Code Here

                 : in;
        }

        public void sendInitMessage(Socket socket, boolean isForOutgoing) throws IOException
        {
            StreamInitMessage message = new StreamInitMessage(FBUtilities.getBroadcastAddress(), session.planId(), session.description(), isForOutgoing);
            ByteBuffer messageBuf = message.createMessage(false, protocolVersion);
            while (messageBuf.hasRemaining())
                getWriteChannel(socket).write(messageBuf);
        }
View Full Code Here

            // streaming connections are per-session and have a fixed version.  we can't do anything with a wrong-version stream connection, so drop it.
            if (version != StreamMessage.CURRENT_VERSION)
                throw new IOException(String.format("Received stream using protocol version %d (my version %d). Terminating connection", version, MessagingService.current_version));

            DataInput input = new DataInputStream(socket.getInputStream());
            StreamInitMessage init = StreamInitMessage.serializer.deserialize(input, version);

            // We will use the current socket to incoming stream. So if the other side is the
            // stream initiator, we must first create an outgoing stream, after which real streaming
            // will start. If we were the initiator however, this socket will just be our incoming
            // stream, everything is setup and we can initiate real streaming by sending the prepare message.
View Full Code Here

                 : in;
        }

        public void sendInitMessage(boolean sentByInitiator) throws IOException
        {
            StreamInitMessage message = new StreamInitMessage(FBUtilities.getBroadcastAddress(), session.planId(), session.description(), sentByInitiator);
            getWriteChannel().write(message.createMessage(false, protocolVersion));
        }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.streaming.messages.StreamInitMessage

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.