src/java/org/apache/cassandra/streaming/FileStreamTask.java
/**
     * Connects to the destination, with backoff for failed attempts.
     * TODO: all nodes on a cluster must currently use the same storage port
     * @throws IOException If all attempts fail.
     */
Connects to the destination, with backoff for failed attempts.
TODO: all nodes on a cluster must currently use the same storage port
@throws IOException If all attempts fail.
Connects to the destination with backoff for failed attempts . TODO : all nodes on a cluster must currently use the same storage port @throws IOException If all attempts fail .
private void connectAttempt() throws IOException
    {
        int attempts = 0;
        while (true)
        {
            try
            {
                socket = MessagingService.instance().getConnectionPool(to).newSocket();
                output = socket.getOutputStream();
                input = new DataInputStream(socket.getInputStream());
                break;
            }
            catch (IOException e)
            {
                if (++attempts >= MAX_CONNECT_ATTEMPTS)
                    throw e;
                long waitms = DatabaseDescriptor.getRpcTimeout() * (long)Math.pow(2, attempts);
                logger.warn("Failed attempt " + attempts + " to connect to " + to + " to stream " + header.file + ". Retrying in " + waitms + " ms. (" + e + ")");
                try
                {
                    Thread.sleep(waitms);
                }
                catch (InterruptedException wtf)
                {
                    throw new RuntimeException(wtf);
                }
            }
        }
    }
private void connectAttempt ( ) throws IOException { int attempts = 0 ; while ( true ) { try { socket = MessagingService . instance ( ) . getConnectionPool ( to ) . newSocket ( ) ; output = socket . getOutputStream ( ) ; input = new DataInputStream ( socket . getInputStream ( ) ) ; break ; } catch ( IOException e ) { if ( ++ attempts >= MAX_CONNECT_ATTEMPTS ) throw e ; long waitms = DatabaseDescriptor . getRpcTimeout ( ) * ( long ) Math . pow ( 2 , attempts ) ; logger . warn ( "Failed attempt " + attempts + " to connect to " + to + " to stream " + header . file + ". Retrying in " + waitms + " ms. (" + e + ")" ) ; try { Thread . sleep ( waitms ) ; } catch ( InterruptedException wtf ) { throw new RuntimeException ( wtf ) ; } } } }
Connects to the destination, with backoff for failed attempts.
Connects to the destination with backoff for failed attempts .