Package org.apache.cassandra.io.util

Examples of org.apache.cassandra.io.util.FastByteArrayOutputStream.toByteArray()


    Message makeGossipDigestAckMessage(GossipDigestAckMessage gDigestAckMessage, int version) throws IOException
    {
      FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        GossipDigestAckMessage.serializer().serialize(gDigestAckMessage, dos, version);
        return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.GOSSIP_DIGEST_ACK, bos.toByteArray(), version);
    }

    Message makeGossipDigestAck2Message(GossipDigestAck2Message gDigestAck2Message, int version) throws IOException
    {
      FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
View Full Code Here


    Message makeGossipDigestAck2Message(GossipDigestAck2Message gDigestAck2Message, int version) throws IOException
    {
      FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        GossipDigestAck2Message.serializer().serialize(gDigestAck2Message, dos, version);
        return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.GOSSIP_DIGEST_ACK2, bos.toByteArray(), version);
    }

    /**
     * Returns true if the chosen target was also a seed. False otherwise
     *
 
View Full Code Here

                            break;
                    }
                   
                    decompressor.end();
                   
                    queryString = new String(byteArray.toByteArray(), 0, byteArray.size(), "UTF-8");
                    break;
                case NONE:
                    try
                    {
                        queryString = ByteBufferUtil.string(query);
View Full Code Here

    {
        GossipDigestSynMessage gDigestMessage = new GossipDigestSynMessage(DatabaseDescriptor.getClusterName(), gDigests);
        FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream( bos );
        GossipDigestSynMessage.serializer().serialize(gDigestMessage, dos, version);
        return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.GOSSIP_DIGEST_SYN, bos.toByteArray(), version);
    }

    Message makeGossipDigestAckMessage(GossipDigestAckMessage gDigestAckMessage, int version) throws IOException
    {
      FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
View Full Code Here

    Message makeGossipDigestAckMessage(GossipDigestAckMessage gDigestAckMessage, int version) throws IOException
    {
      FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        GossipDigestAckMessage.serializer().serialize(gDigestAckMessage, dos, version);
        return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.GOSSIP_DIGEST_ACK, bos.toByteArray(), version);
    }

    Message makeGossipDigestAck2Message(GossipDigestAck2Message gDigestAck2Message, int version) throws IOException
    {
      FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
View Full Code Here

    Message makeGossipDigestAck2Message(GossipDigestAck2Message gDigestAck2Message, int version) throws IOException
    {
      FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        GossipDigestAck2Message.serializer().serialize(gDigestAck2Message, dos, version);
        return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.GOSSIP_DIGEST_ACK2, bos.toByteArray(), version);
    }
   
    Message makeGossipShutdownMessage(int version) throws IOException
    {
        FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
View Full Code Here

    Message makeGossipShutdownMessage(int version) throws IOException
    {
        FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(bos);
        GossipShutdownMessage.serializer().serialize(new GossipShutdownMessage(), dos, version);
        return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.GOSSIP_SHUTDOWN, bos.toByteArray(), version);
    }

    /**
     * Returns true if the chosen target was also a seed. False otherwise
     *
 
View Full Code Here

            try
            {
              FastByteArrayOutputStream bos = new FastByteArrayOutputStream();
                DataOutputStream dos = new DataOutputStream(bos);
                SERIALIZER.serialize(request, dos, version);
                return new Message(FBUtilities.getBroadcastAddress(), StorageService.Verb.TREE_REQUEST, bos.toByteArray(), version);
            }
            catch(IOException e)
            {
                throw new RuntimeException(e);
            }
View Full Code Here

        for (RowMutation mutation : schema)
            RowMutation.serializer().serialize(mutation, dout, version);

        dout.close();

        return bout.toByteArray();
    }

    /**
     * Deserialize migration message considering data compatibility starting from version 1.1
     *
 
View Full Code Here

                    String id = MessagingService.instance().addCallback(handler, message, destination);
                    dos.writeUTF(id);
                    if (logger.isDebugEnabled())
                        logger.debug("Adding FWD message to: " + destination + " with ID " + id);
                }
                message = message.withHeaderAdded(RowMutation.FORWARD_HEADER, bos.toByteArray());
                // send the combined message + forward headers
                String id = MessagingService.instance().sendRR(message, target, handler);
                if (logger.isDebugEnabled())
                    logger.debug("Sending message to: " + target + " with ID " + id);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.