@ Override public Map < SocketAddress , Map < String , String > > getStats ( final String arg ) { final Map < SocketAddress , Map < String , String > > rv = new HashMap < SocketAddress , Map < String , String > > ( ) ; CountDownLatch blatch = broadcastOp ( new BroadcastOpFactory ( ) { @ Override public Operation newOp ( final MemcachedNode n , final CountDownLatch latch ) { final SocketAddress sa = n . getSocketAddress ( ) ; rv . put ( sa , new HashMap < String , String > ( ) ) ; return opFact . stats ( arg , new StatsOperation . Callback ( ) { @ Override public void gotStat ( String name , String val ) { rv . get ( sa ) . put ( name , val ) ; } @ Override @ SuppressWarnings ( "synthetic-access" ) public void receivedStatus ( OperationStatus status ) { if ( ! status . isSuccess ( ) ) { getLogger ( ) . warn ( "Unsuccessful stat fetch: %s" , status ) ; } } @ Override public void complete ( ) { latch . countDown ( ) ; } } ) ; } } ) ; try { blatch . await ( operationTimeout , TimeUnit . MILLISECONDS ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( "Interrupted waiting for stats" , e ) ; } return rv ; }
Get a set of stats from all connections .