src/java/org/apache/cassandra/streaming/StreamingRepairTask.java
// wrap a given callback so as to unregister the streaming repair task on completion
wrap a given callback so as to unregister the streaming repair task on completion
wrap a given callback so as to unregister the streaming repair task on completion
private static Runnable wrapCallback(final Runnable callback, final UUID taskid, final boolean isLocalTask)
    {
        return new Runnable()
        {
            private final AtomicInteger outstanding = new AtomicInteger(isLocalTask ? 2 : 1);
            public void run()
            {
                if (outstanding.decrementAndGet() > 0)
                    return;
                tasks.remove(taskid);
                if (callback != null)
                    callback.run();
            }
        };
    }
private static Runnable wrapCallback ( final Runnable callback , final UUID taskid , final boolean isLocalTask ) { return new Runnable ( ) { private final AtomicInteger outstanding = new AtomicInteger ( isLocalTask ? 2 : 1 ) ; public void run ( ) { if ( outstanding . decrementAndGet ( ) > 0 ) return ; tasks . remove ( taskid ) ; if ( callback != null ) callback . run ( ) ; } } ; }
wrap a given callback so as to unregister the streaming repair task on completion
wrap a given callback so as to unregister the streaming repair task on completion
// we expect one callback for the receive, and one for the send // waiting on more calls