public Map < String , Set < String > > getActiveDataCenterMap ( ) { Map < String , Set < String > > result = new HashMap <> ( ) ; ODistributedConfiguration cfg = getDistributedConfiguration ( ) ; Set < String > servers = cfg . getRegisteredServers ( ) ; for ( String server : servers ) { String dc = cfg . getDataCenterOfServer ( server ) ; Set < String > dcConfig = result . get ( dc ) ; if ( dcConfig == null ) { dcConfig = new HashSet <> ( ) ; result . put ( dc , dcConfig ) ; } dcConfig . add ( server ) ; } return result ; }
returns the data center map for current deploy . The keys are data center names the values are node names per data center