Code example for ConcurrentMap

Methods: get, putIfAbsent

0
    @Override 
    public TUGIContainingTransport getTransport(TTransport trans) { 
 
      // UGI information is not available at connection setup time, it will be set later 
      // via set_ugi() rpc. 
      transMap.putIfAbsent(trans, new TUGIContainingTransport(trans,null)); 
      return transMap.get(trans); 
    } 
  } 
}