/** * @param cacheName * @param key * @return ICacheElement<K, V> if found. * @throws IOException */ @Override public ICacheElement<K, V> get( String cacheName, K key ) throws IOException { return get( cacheName, key, getListenerId() ); }
/** * This issues a separate get for each item. * <p> * TODO We should change this. It should issue one request. * <p> * @param cacheName * @param keys * @param requesterId * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data in cache for any of these keys * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys, long requesterId ) throws IOException { Map<K, ICacheElement<K, V>> elements = new HashMap<K, ICacheElement<K, V>>(); if ( keys != null && !keys.isEmpty() ) { for (K key : keys) { ICacheElement<K, V> element = get( cacheName, key ); if ( element != null ) { elements.put( key, element ); } } } return elements; }
/** * This issues a separate get for each item. * <p> * TODO We should change this. It should issue one request. * <p> * @param cacheName * @param keys * @param requesterId * @return a map of K key to ICacheElement<K, V> element, or an empty map if there is no * data in cache for any of these keys * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> getMultiple( String cacheName, Set<K> keys, long requesterId ) throws IOException { Map<K, ICacheElement<K, V>> elements = new HashMap<K, ICacheElement<K, V>>(); if ( keys != null && !keys.isEmpty() ) { for (K key : keys) { ICacheElement<K, V> element = get( cacheName, key ); if ( element != null ) { elements.put( key, element ); } } } return elements; }
/** * @param cacheName * @param key * @return ICacheElement<K, V> if found. * @throws IOException */ @Override public ICacheElement<K, V> get( String cacheName, K key ) throws IOException { return get( cacheName, key, getListenerId() ); }
Object obj = service.get( region, key ); if ( show && obj != null )
Object obj = service.get( region, key ); if ( show && obj != null )
ICacheElement<String, String> result = service.get( "test", "key" );
ICacheElement<String, String> result = service.get( "test", "key" );