protected Map < String , Object > getCached ( String keySpace , String columnFamily , String key ) throws StorageClientException { Map < String , Object > m = null ; String cacheKey = getCacheKey ( keySpace , columnFamily , key ) ; CacheHolder cacheHolder = getFromCacheInternal ( cacheKey ) ; if ( cacheHolder != null ) { m = cacheHolder . get ( ) ; if ( m != null ) { LOGGER . debug ( "Cache Hit {} {} {} " , new Object [ ] { cacheKey , cacheHolder , m } ) ; } } if ( m == null ) { m = client . get ( keySpace , columnFamily , key ) ; if ( m != null ) { LOGGER . debug ( "Cache Miss, Found Map {} {}" , cacheKey , m ) ; } putToCacheInternal ( cacheKey , new CacheHolder ( m ) , true ) ; } return m ; }
Try to retrieve an object from the cache . Has the side - effect of loading an uncached object into cache the first time .