List of usage examples for java.util.concurrent ConcurrentHashMap ConcurrentHashMap
public ConcurrentHashMap(Map<? extends K, ? extends V> m)
From source file:com.mike.aframe.http.KJStringParams.java
protected void init() { urlParams = new ConcurrentHashMap<String, String>(6); }
From source file:org.spring.cache.impl.MyMapCache.java
/** * Create a new ConcurrentMapCache with the specified name. * @param name the name of the cache/*from w ww. j a v a2s.c om*/ */ public MyMapCache(String name) { this(name, new ConcurrentHashMap<Object, Object>(256), true); }
From source file:gridool.dht.impl.BabuDiskIndexDirectory.java
public BabuDiskIndexDirectory(LockManager lockManager) { super(lockManager); this.map = new ConcurrentHashMap<String, DiskIndex>(16); }
From source file:ch.algotrader.esper.EngineManagerImpl.java
public EngineManagerImpl(final Map<String, Engine> engineMap) { this.engineMap = new ConcurrentHashMap<>( engineMap != null ? engineMap : Collections.<String, Engine>emptyMap()); }
From source file:com.liferay.portal.velocity.FastExtendedProperties.java
@Override public Object clone() { FastExtendedProperties fastExtendedProperties = (FastExtendedProperties) super.clone(); fastExtendedProperties._map = new ConcurrentHashMap<Object, Object>(_map); return fastExtendedProperties; }
From source file:com.sm.store.cluster.Utils.java
public static String validateId(List<ClusterNodes> nodes) { StringBuilder sb = new StringBuilder(); ConcurrentMap<Integer, Short> map = new ConcurrentHashMap<Integer, Short>(nodes.size()); for (ClusterNodes node : nodes) { for (int i = 0; i < node.getPartitionArray().length; i++) { if (map.putIfAbsent(node.getPartitionArray()[i], node.getId()) != null) sb.append(" id =" + node.getId()); }// w w w . ja v a 2s . c o m } return sb.toString(); }
From source file:de.zib.vold.security.GridMapUserDetailsService.java
public GridMapUserDetailsService() { admins = new ConcurrentHashMap<String, String>(1); users = new ConcurrentHashMap<String, String>(1); }
From source file:com.aba.industry.fetch.client.impl.StaticDataExportBlueprintYamlService.java
public StaticDataExportBlueprintYamlService() throws IOException { Yaml yaml = new Yaml(); InputStream bpsIS = StaticDataExportBlueprintYamlService.class.getResourceAsStream("/blueprints.yaml"); blueprints = yaml.loadAs(bpsIS, Blueprints.class); blueprints.setBlueprints(new ConcurrentHashMap<>(blueprints.getBlueprints())); }
From source file:io.confluent.kafkarest.AvroRestProducer.java
public AvroRestProducer(KafkaProducer<Object, Object> producer, KafkaAvroSerializer keySerializer, KafkaAvroSerializer valueSerializer) { this.producer = producer; this.keySerializer = keySerializer; this.valueSerializer = valueSerializer; this.schemaIdCache = new ConcurrentHashMap<>(100); }
From source file:org.solmix.runtime.support.spring.ContainerEntityResolver.java
public ContainerEntityResolver(ClassLoader loader, EntityResolver dr, EntityResolver sr) { super(dr, sr); classLoader = loader;// ww w . jav a2 s . c om dtdResolver = dr; schemaResolver = sr; try { Properties mappings = PropertiesLoaderUtils.loadAllProperties("META-INF/spring.schemas", classLoader); schemaMappings = new ConcurrentHashMap<String, String>(mappings.size()); CollectionUtils.mergePropertiesIntoMap(mappings, schemaMappings); } catch (IOException e) { //ignore } }