Package org.apache.cassandra.net

Examples of org.apache.cassandra.net.IAsyncCallback


    logger_.debug(" Run the consistency checks for " + columnFamily_);   
        ReadCommand readCommandDigestOnly = constructReadMessage(true);
    try
    {
      Message messageDigestOnly = readCommandDigestOnly.makeReadMessage();
      IAsyncCallback digestResponseHandler = new DigestResponseHandler();
      MessagingService.getMessagingInstance().sendRR(messageDigestOnly, replicas_.toArray(new EndPoint[0]), digestResponseHandler);
    }
    catch ( IOException ex )
    {
      logger_.info(LogUtil.throwableToString(ex));
View Full Code Here


    private void doReadRepair() throws IOException
    {
      IResponseResolver<Row> readResponseResolver = new ReadResponseResolver();
            /* Add the local storage endpoint to the replicas_ list */
            replicas_.add(StorageService.getLocalStorageEndPoint());
      IAsyncCallback responseHandler = new DataRepairHandler(ConsistencyManager.this.replicas_.size(), readResponseResolver)
      String table = DatabaseDescriptor.getTables().get(0);
            ReadCommand readCommand = constructReadMessage(false);
      // ReadMessage readMessage = new ReadMessage(table, row_.key(), columnFamily_);
            Message message = readCommand.makeReadMessage();
      MessagingService.getMessagingInstance().sendRR(message, replicas_.toArray( new EndPoint[0] ), responseHandler);     
View Full Code Here

                if (logger.isDebugEnabled())
                    logger.debug("Digest mismatch:", e);

                ReadCommand readCommand = (ReadCommand) command;
                final RowRepairResolver repairResolver = new RowRepairResolver(readCommand.table, readCommand.key);
                IAsyncCallback repairHandler = new AsyncRepairCallback(repairResolver, endpoints.size());

                Message messageRepair = readCommand.makeReadMessage();
                for (InetAddress endpoint : endpoints)
                    MessagingService.instance().sendRR(messageRepair, endpoint, repairHandler);
            }
View Full Code Here

        final String myVersion = DatabaseDescriptor.getDefsVersion().toString();
        final Map<InetAddress, UUID> versions = new ConcurrentHashMap<InetAddress, UUID>();
        final Set<InetAddress> liveHosts = Gossiper.instance.getLiveMembers();
        final CountDownLatch latch = new CountDownLatch(liveHosts.size());

        IAsyncCallback cb = new IAsyncCallback()
        {
            public void response(Message message)
            {
                // record the response from the remote node.
                logger.debug("Received schema check response from " + message.getFrom().getHostAddress());
View Full Code Here

                if (logger.isDebugEnabled())
                    logger.debug("Digest mismatch:", e);

                ReadCommand readCommand = (ReadCommand) command;
                final RowRepairResolver repairResolver = new RowRepairResolver(readCommand.table, readCommand.key, readCommand.filter());
                IAsyncCallback repairHandler = new AsyncRepairCallback(repairResolver, endpoints.size());

                MessageOut<ReadCommand> message = ((ReadCommand) command).createMessage();
                for (InetAddress endpoint : endpoints)
                    MessagingService.instance().sendRR(message, endpoint, repairHandler);
            }
View Full Code Here

                    {
                        rowsReplayed.incrementAndGet();
                        deleteHint(hostIdBytes, hint.name(), hint.maxTimestamp());
                    }
                };
                IAsyncCallback responseHandler = new WriteResponseHandler(endpoint, WriteType.UNLOGGED_BATCH, callback);
                MessagingService.instance().sendRR(message, endpoint, responseHandler);
            }

            // check if node is still alive and we should continue delivery process
            if (!FailureDetector.instance.isAlive(endpoint))
View Full Code Here

               
                ReadRepairMetrics.repairedBackground.mark();
               
                ReadCommand readCommand = (ReadCommand) command;
                final RowDataResolver repairResolver = new RowDataResolver(readCommand.table, readCommand.key, readCommand.filter());
                IAsyncCallback repairHandler = new AsyncRepairCallback(repairResolver, endpoints.size());

                MessageOut<ReadCommand> message = ((ReadCommand) command).createMessage();
                for (InetAddress endpoint : endpoints)
                    MessagingService.instance().sendRR(message, endpoint, repairHandler);
            }
View Full Code Here

            {
                logger.error("Can't send migration request: node {} is down.", endpoint);
                return;
            }

            IAsyncCallback cb = new IAsyncCallback()
            {
                public void response(Message message)
                {
                    try
                    {
View Full Code Here

            {
                logger.error("Can't send migration request: node {} is down.", endpoint);
                return;
            }

            IAsyncCallback cb = new IAsyncCallback()
            {
                @Override
                public void response(Message message)
                {
                    try
View Full Code Here

            public void makeSnapshots(Collection<InetAddress> endpoints)
            {
                try
                {
                    snapshotLatch = new CountDownLatch(endpoints.size());
                    IAsyncCallback callback = new IAsyncCallback()
                    {
                        @Override
                            public boolean isLatencyForSnitch()
                            {
                                return false;
View Full Code Here

TOP

Related Classes of org.apache.cassandra.net.IAsyncCallback

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.