Package org.apache.cassandra.io.util

Examples of org.apache.cassandra.io.util.FastByteArrayInputStream


                logger_.trace("Ignoring GossipDigestSynMessage because gossip is disabled");
            return;
        }

        byte[] bytes = message.getMessageBody();
        DataInputStream dis = new DataInputStream( new FastByteArrayInputStream(bytes) );

        try
        {
            GossipDigestSynMessage gDigestMessage = GossipDigestSynMessage.serializer().deserialize(dis, message.getVersion());
            /* If the message is from a different cluster throw it away. */
 
View Full Code Here


                logger_.trace("Ignoring GossipDigestAckMessage because gossip is disabled");
            return;
        }

        byte[] bytes = message.getMessageBody();
        DataInputStream dis = new DataInputStream( new FastByteArrayInputStream(bytes) );

        try
        {
            GossipDigestAckMessage gDigestAckMessage = GossipDigestAckMessage.serializer().deserialize(dis, message.getVersion());
            List<GossipDigest> gDigestList = gDigestAckMessage.getGossipDigestList();
View Full Code Here

    {
        if (logger.isDebugEnabled())
            logger.debug("Received a StreamRequestMessage from {}", message.getFrom());

        byte[] body = message.getMessageBody();
        FastByteArrayInputStream bufIn = new FastByteArrayInputStream(body);
        try
        {
            StreamRequestMessage srm = StreamRequestMessage.serializer().deserialize(new DataInputStream(bufIn), message.getVersion());
            if (logger.isDebugEnabled())
                logger.debug(srm.toString());
View Full Code Here

    private static Logger logger = LoggerFactory.getLogger(StreamReplyVerbHandler.class);

    public void doVerb(Message message, String id)
    {
        byte[] body = message.getMessageBody();
        FastByteArrayInputStream bufIn = new FastByteArrayInputStream(body);

        try
        {
            StreamReply reply = StreamReply.serializer.deserialize(new DataInputStream(bufIn), message.getVersion());
            logger.debug("Received StreamReply {}", reply);
View Full Code Here

   
    // other half of this transformation is in MigrationManager.
    public static Collection<Column> makeColumns(Message msg) throws IOException
    {
        Collection<Column> cols = new ArrayList<Column>();
        DataInputStream in = new DataInputStream(new FastByteArrayInputStream(msg.getMessageBody()));
        int count = in.readInt();
        for (int i = 0; i < count; i++)
        {
            byte[] name = new byte[in.readInt()];
            in.readFully(name);
View Full Code Here

    }

    public void preprocess(Message message)
    {
        byte[] body = message.getMessageBody();
        FastByteArrayInputStream bufIn = new FastByteArrayInputStream(body);
        try
        {
            ReadResponse result = ReadResponse.serializer().deserialize(new DataInputStream(bufIn), message.getVersion());
            if (logger.isDebugEnabled())
                logger.debug("Preprocessed {} response", result.isDigestQuery() ? "digest" : "data");
View Full Code Here

         */
        public void doVerb(Message message, String id)
        {
            byte[] bytes = message.getMessageBody();
           
            DataInputStream buffer = new DataInputStream(new FastByteArrayInputStream(bytes));
            try
            {
                TreeRequest remotereq = this.deserialize(buffer, message.getVersion());
                TreeRequest request = new TreeRequest(remotereq.sessionid, message.getFrom(), remotereq.range, remotereq.cf);

View Full Code Here

        }

        public void doVerb(Message message, String id)
        {
            byte[] bytes = message.getMessageBody();
            DataInputStream buffer = new DataInputStream(new FastByteArrayInputStream(bytes));

            try
            {
                // deserialize the remote tree, and register it
                Validator response = this.deserialize(buffer, message.getVersion());
View Full Code Here

            throw new RuntimeException("Cannot service reads while bootstrapping!");
        }

        try
        {
            FastByteArrayInputStream in = new FastByteArrayInputStream(message.getMessageBody());
            ReadCommand command = ReadCommand.serializer().deserialize(new DataInputStream(in), message.getVersion());
            Table table = Table.open(command.table);
            Row row = command.getRow(table);

            ReadResponse response = getResponse(command, row);
View Full Code Here

        }
    }

    public static RowMutation fromBytes(byte[] raw, int version) throws IOException
    {
        RowMutation rm = serializer_.deserialize(new DataInputStream(new FastByteArrayInputStream(raw)), version);
        boolean hasCounters = false;
        for (Map.Entry<Integer, ColumnFamily> entry : rm.modifications_.entrySet())
        {
            if (entry.getValue().metadata().getDefaultValidator().isCommutative())
            {
View Full Code Here

TOP

Related Classes of org.apache.cassandra.io.util.FastByteArrayInputStream

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.