private synchronized String pollNameForRequest(){
  long start=System.currentTimeMillis();
  if (!queuedForRequest.isEmpty()) {
    List<NameForRequest> list=new ArrayList<>(queuedForRequest.values());
    Collections.sort(list);
    String name=list.get(0).name;
    queuedForRequest.remove(name);
    LOGGER.info("[" + (System.currentTimeMillis() - start) + "] Names Cached: "+ names.size()+ " Queued: "+ list.size()+ " "+ Helper.subList(list,0,10));
    if (!erroredNames.contains(name)) {
      return name;
    }
  }
  return null;
}

private synchronized String pollNameForRequest ( ) { long start = System . currentTimeMillis ( ) ; if ( ! queuedForRequest . isEmpty ( ) ) { List < NameForRequest > list = new ArrayList < > ( queuedForRequest . values ( ) ) ; Collections . sort ( list ) ; String name = list . get ( 0 ) . name ; queuedForRequest . remove ( name ) ; LOGGER . info ( "[" + ( System . currentTimeMillis ( ) - start ) + "] Names Cached: " + names . size ( ) + " Queued: " + list . size ( ) + " " + Helper . subList ( list , 0 , 10 ) ) ; if ( ! erroredNames . contains ( name ) ) { return name ; } } return null ; }
gets the name with the highest priority from the request queue .
