/** * Gets multiple items from the cache based on the given set of keys. Do not try to go remote or * laterally for this data. * <p> * @param keys * @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 */ public Map<K, ICacheElement<K, V>> localGetMultiple( Set<K> keys ) { return getMultiple( keys, true ); }
/** * Gets multiple items from the cache based on the given set of keys. * <p> * @param keys * @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 */ @Override public Map<K, ICacheElement<K, V>> getMultiple( Set<K> keys ) { return getMultiple( keys, false ); }
/** * Gets multiple items from the cache based on the given set of keys. * <p> * @param keys * @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 */ @Override public Map<K, ICacheElement<K, V>> getMultiple( Set<K> keys ) { return getMultiple( keys, false ); }
/** * Gets multiple items from the cache based on the given set of keys. Do not try to go remote or * laterally for this data. * <p> * @param keys * @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 */ public Map<K, ICacheElement<K, V>> localGetMultiple( Set<K> keys ) { return getMultiple( keys, true ); }
/** * Get multiple elements from the cache based on a set of cache keys. * <p> * This method returns the ICacheElement<K, V> wrapper which provides access to element info and other * attributes. * <p> * This returns a reference to the wrapper. Any modifications will be reflected in the cache. No * defensive copy is made. * <p> * This method is most useful if you want to determine things such as the how long the element * has been in the cache. * <p> * The last access time in the ElementAttributes should be current. * <p> * @param names set of Serializable cache keys * @return a map of K key to ICacheElement<K, V> element, or empty map if none of the keys are present */ @Override public Map<K, ICacheElement<K, V>> getCacheElements( Set<K> names ) { return this.getCacheControl().getMultiple( names ); }
/** * Get multiple elements from the cache based on a set of cache keys. * <p> * This method returns the ICacheElement<K, V> wrapper which provides access to element info and other * attributes. * <p> * This returns a reference to the wrapper. Any modifications will be reflected in the cache. No * defensive copy is made. * <p> * This method is most useful if you want to determine things such as the how long the element * has been in the cache. * <p> * The last access time in the ElementAttributes should be current. * <p> * @param names set of Serializable cache keys * @return a map of K key to ICacheElement<K, V> element, or empty map if none of the keys are present */ @Override public Map<K, ICacheElement<K, V>> getCacheElements( Set<K> names ) { return this.getCacheControl().getMultiple( names ); }
returnElements = c.getMultiple( keys );
returnElements = c.getMultiple( keys );
/** * Processes a get request. * <p> * If isAllowClusterGet is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param keys * @param requesterId * @return Map * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> processGetMultiple( String cacheName, Set<K> keys, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isAllowClusterGet(); if ( keepLocal ) { return cache.localGetMultiple( keys ); } else { return cache.getMultiple( keys ); } }
/** * Processes a get request. * <p> * If isAllowClusterGet is enabled we will treat this as a normal request of non-remote * origination. * <p> * @param cacheName * @param keys * @param requesterId * @return Map * @throws IOException */ @Override public Map<K, ICacheElement<K, V>> processGetMultiple( String cacheName, Set<K> keys, long requesterId ) throws IOException { CompositeCache<K, V> cache = getCacheManager().getCache( cacheName ); boolean keepLocal = !remoteHttpCacheServerAttributes.isAllowClusterGet(); if ( keepLocal ) { return cache.localGetMultiple( keys ); } else { return cache.getMultiple( keys ); } }