public int completed ( InetAddress request ) { String dc = DatabaseDescriptor . getEndpointSnitch ( ) . getDatacenter ( request ) ; Queue < InetAddress > requests = requestsByDatacenter . get ( dc ) ; assert requests != null ; assert request . equals ( requests . peek ( ) ) ; requests . poll ( ) ; if ( ! requests . isEmpty ( ) ) processor . process ( requests . peek ( ) ) ; return -- remaining ; }
Returns how many request remains