List of usage examples for java.util.concurrent ConcurrentHashMap ConcurrentHashMap
public ConcurrentHashMap()
From source file:com.vmware.o11n.plugin.powershell.config.impl.ConfigurationServiceImpl.java
private void load() { if (loaded) { return;// w w w . j a v a 2s . c o m } loaded = true; hostsById = new ConcurrentHashMap<String, PowerShellHostConfig>(); reload(); }
From source file:org.wso2.carbon.http2.transport.util.Http2ConnectionFactory.java
private Http2ConnectionFactory(TransportOutDescription transportOut) { this.trasportOut = transportOut; clientConnections = new ConcurrentHashMap<>(); this.workerGroup = new NioEventLoopGroup(); }
From source file:com.mobilehelix.appserver.push.PushManager.java
@PostConstruct public void init() { userPushMap = new ConcurrentHashMap<>(); idMap = new ConcurrentHashMap<>(); srandom = new SecureRandom(); }
From source file:com.micro.http.MicroRequestParams.java
/** * default boundary is auto generate {@link #getBoundary()} *//*from w w w.j a v a 2s. c o m*/ public MicroRequestParams() { super(); boundary = getBoundary(); urlParams = new ConcurrentHashMap<String, String>(); fileParams = new ConcurrentHashMap<String, ContentBody>(); multiPart = new MultipartEntity(HttpMultipartMode.STRICT, boundary, Charset.forName("UTF-8")); }
From source file:com.qwazr.search.index.IndexManager.java
private IndexManager(ExecutorService executorService, File rootDirectory) { this.executorService = executorService; this.rootDirectory = rootDirectory; schemaMap = new ConcurrentHashMap<String, SchemaInstance>(); File[] directories = rootDirectory.listFiles((FileFilter) DirectoryFileFilter.INSTANCE); if (directories == null) return;/*from w w w . ja v a 2s. c om*/ for (File schemaDirectory : directories) { try { schemaMap.put(schemaDirectory.getName(), new SchemaInstance(executorService, schemaDirectory)); } catch (ServerException | IOException | ReflectiveOperationException | InterruptedException | URISyntaxException e) { logger.error(e.getMessage(), e); } } }
From source file:ga.rugal.jpt.common.tracker.server.TrackedTorrent.java
/** * Create a new tracked torrent from meta-info binary data. * * @param torrent The meta-info byte data. * * @throws IOException When the info dictionary can't be * encoded and hashed back to create the torrent's SHA-1 hash. *//*from w w w .j a va 2 s . co m*/ public TrackedTorrent(byte[] torrent) throws IOException { super(torrent, false); this.peers = new ConcurrentHashMap<>(); this.answerPeers = SystemDefaultProperties.DEFAULT_ANSWER_NUM_PEERS; this.announceInterval = SystemDefaultProperties.DEFAULT_ANNOUNCE_INTERVAL_SECONDS; }
From source file:PalidromeArray.java
public PalidromeArray(BigInteger[] array) { this.totalLength = BigInteger.valueOf(array.length); this.halfLength = totalLength.divide(TWO); if (MathUtil.isOdd(totalLength)) { isEven = false;/*ww w. j a v a2 s. c o m*/ halfLength = halfLength.add(BigInteger.ONE); } this.array = new ConcurrentHashMap<BigInteger, BigInteger>(); BigInteger index = BigInteger.ZERO; for (BigInteger bi : array) { this.array.put(index, bi); index = index.add(BigInteger.ONE); } }
From source file:com.nginious.http.plugin.RollbackState.java
public RollbackState() { synchronized (lock) { if (state != null) { throw new RuntimeException("Only one rollback state allowed"); }//from w ww . j a v a 2 s. c o m state = this; } this.projectStates = new ConcurrentHashMap<String, String>(); this.checker = new RollbackStateChecker(); this.checkerThread = new Thread(this.checker); checkerThread.start(); }
From source file:com.w20e.socrates.process.RunnerFactoryImpl.java
/** * Creates a runner factory, with the given config root. * /*from w ww.j a v a 2s . c om*/ * @param cfgRoot * Configuration root for runner factory. */ public RunnerFactoryImpl(final String cfgRoot) { if ((new File(cfgRoot)).isDirectory()) { this.rootDir = cfgRoot; } else { LOGGER.severe("Config root is not a directory, using " + this.rootDir); } this.formatters = new HashMap<URI, Formatter>(); this.runners = new ConcurrentHashMap<URI, Runner>(); }
From source file:libepg.epg.section.SectionLoader.java
public Map<Integer, List<Section>> load() throws FileNotFoundException { //??/* w ww. ja v a 2s . com*/ if (!tsFile.isFile()) { throw new FileNotFoundException( "???? = " + tsFile.getAbsolutePath()); } LOG.info("?? = " + tsFile.getAbsolutePath()); final TsReader reader = new TsReader(tsFile, pids, readLimit); Map<Integer, List<TsPacketParcel>> pid_packets = reader.getPackets(); Map<Integer, List<Section>> pids_sections_temp = new ConcurrentHashMap<>(); for (Integer pidKey : pid_packets.keySet()) { LOG.info("?pid = " + Integer.toHexString(pidKey) + " pid = " + RESERVED_PROGRAM_ID.reverseLookUp(pidKey)); SectionReconstructor sectionMaker = new SectionReconstructor(pid_packets.get(pidKey), pidKey); List<Section> sections = sectionMaker.getSections(); if (sections != null) { LOG.info(" = " + sections.size()); pids_sections_temp.put(pidKey, sections); } } return Collections.unmodifiableMap(pids_sections_temp); }