public String getNamespace ( String ns ) throws TimeoutException , InterruptedException , MemcachedException { String key = this . keyProvider . process ( this . getNSKey ( ns ) ) ; byte [ ] keyBytes = ByteUtils . getBytes ( key ) ; ByteUtils . checkKey ( keyBytes ) ; Object item = this . fetch0 ( key , keyBytes , CommandType . GET_ONE , this . opTimeout , this . transcoder ) ; while ( item == null ) { item = String . valueOf ( System . nanoTime ( ) ) ; boolean added = this . add0 ( key , 0 , item , this . transcoder , this . opTimeout ) ; if ( ! added ) { item = this . fetch0 ( key , keyBytes , CommandType . GET_ONE , this . opTimeout , this . transcoder ) ; } } String namespace = item . toString ( ) ; if ( ! ByteUtils . isNumber ( namespace ) ) { throw new IllegalStateException ( "Namespace key already has value.The key is:" + key + ",and the value is:" + namespace ) ; } return namespace ; }
Returns the real namespace of ns .