@Override @SuppressWarnings("unchecked") protected <K, V> CacheConfig<K, V> findCacheConfig(String cacheName, String simpleCacheName) { CacheConfig<K, V> config = cacheService.getCacheConfig(cacheName); if (config == null) { config = cacheService.findCacheConfig(simpleCacheName); if (config != null) { config.setManagerPrefix(cacheName.substring(0, cacheName.lastIndexOf(simpleCacheName))); } else { // if cache config is still not found, try to get it from a partition config = getCacheConfig(cacheName, simpleCacheName); } } if (config != null) { /* * Also create the cache config on other nodes to be sure that the * cache config is exist on all nodes. This is needed because even * though the cache config exists on this node (for example added * by an in-flight cache config creation operation), it still might * not exist on other nodes yet (but will be created eventually). */ createCacheConfig(cacheName, config); } return config; }
@Override @SuppressWarnings("unchecked") protected <K, V> CacheConfig<K, V> findCacheConfig(String cacheName, String simpleCacheName) { CacheConfig<K, V> config = cacheService.getCacheConfig(cacheName); if (config == null) { config = cacheService.findCacheConfig(simpleCacheName); if (config != null) { config.setManagerPrefix(cacheName.substring(0, cacheName.lastIndexOf(simpleCacheName))); } else { // if cache config is still not found, try to get it from a partition config = getCacheConfig(cacheName, simpleCacheName); } } if (config != null) { /* * Also create the cache config on other nodes to be sure that the * cache config is exist on all nodes. This is needed because even * though the cache config exists on this node (for example added * by an in-flight cache config creation operation), it still might * not exist on other nodes yet (but will be created eventually). */ createCacheConfig(cacheName, config); } return config; }
cacheConfig = service.findCacheConfig(simpleName); if (cacheConfig != null) { cacheConfig.setManagerPrefix(name.substring(0, name.lastIndexOf(simpleName))); CacheConfig existingCacheConfig = service.putCacheConfigIfAbsent(cacheConfig); if (existingCacheConfig != null) {
cacheConfig = service.findCacheConfig(simpleName); if (cacheConfig != null) { cacheConfig.setManagerPrefix(name.substring(0, name.lastIndexOf(simpleName))); CacheConfig existingCacheConfig = service.putCacheConfigIfAbsent(cacheConfig); if (existingCacheConfig != null) {
@SuppressWarnings("unchecked") protected <K, V, C extends Configuration<K, V>> CacheConfig<K, V> createCacheConfig(String cacheName, C configuration) { CacheConfig<K, V> cacheConfig; if (configuration instanceof CompleteConfiguration) { cacheConfig = new CacheConfig<K, V>((CompleteConfiguration<K, V>) configuration); } else { cacheConfig = new CacheConfig<K, V>(); cacheConfig.setStoreByValue(configuration.isStoreByValue()); Class<K> keyType = configuration.getKeyType(); Class<V> valueType = configuration.getValueType(); cacheConfig.setTypes(keyType, valueType); } cacheConfig.setName(cacheName); cacheConfig.setManagerPrefix(this.cacheNamePrefix); cacheConfig.setUriString(getURI().toString()); return cacheConfig; }
@SuppressWarnings("unchecked") protected <K, V, C extends Configuration<K, V>> CacheConfig<K, V> createCacheConfig(String cacheName, C configuration) { CacheConfig<K, V> cacheConfig; if (configuration instanceof CompleteConfiguration) { cacheConfig = new CacheConfig<K, V>((CompleteConfiguration<K, V>) configuration); } else { cacheConfig = new CacheConfig<K, V>(); cacheConfig.setStoreByValue(configuration.isStoreByValue()); Class<K> keyType = configuration.getKeyType(); Class<V> valueType = configuration.getValueType(); cacheConfig.setTypes(keyType, valueType); } cacheConfig.setName(cacheName); cacheConfig.setManagerPrefix(this.cacheNamePrefix); cacheConfig.setUriString(getURI().toString()); return cacheConfig; }
cacheSimpleConfig.setName("setupRef"); CacheConfig cacheConfig = new CacheConfig(cacheSimpleConfig); cacheConfig.setManagerPrefix(HazelcastCacheManager.CACHE_MANAGER_PREFIX); return new CacheProxy(cacheConfig, nodeEngine, this); } else { throw new CacheNotExistsException("Couldn't find cache config with name " + cacheNameWithPrefix); cacheConfig.setManagerPrefix(HazelcastCacheManager.CACHE_MANAGER_PREFIX);
cacheSimpleConfig.setName("setupRef"); CacheConfig cacheConfig = new CacheConfig(cacheSimpleConfig); cacheConfig.setManagerPrefix(HazelcastCacheManager.CACHE_MANAGER_PREFIX); return new CacheProxy(cacheConfig, nodeEngine, this); } else { throw new CacheNotExistsException("Couldn't find cache config with name " + cacheNameWithPrefix); cacheConfig.setManagerPrefix(HazelcastCacheManager.CACHE_MANAGER_PREFIX);
target.setManagerPrefix(getManagerPrefix()); target.setMergePolicy(getMergePolicy()); target.setName(getName());
target.setManagerPrefix(getManagerPrefix()); target.setMergePolicy(getMergePolicy()); target.setName(getName());
public void readData(ObjectDataInput in) throws IOException { config.setName(in.readUTF()); config.setManagerPrefix(in.readUTF()); config.setUriString(in.readUTF()); config.setBackupCount(in.readInt());
public void readData(ObjectDataInput in) throws IOException { config.setName(in.readUTF()); config.setManagerPrefix(in.readUTF()); config.setUriString(in.readUTF()); config.setBackupCount(in.readInt());