Package java.util.concurrent

Examples of java.util.concurrent.ConcurrentHashMap.entrySet()


     * find and remove stale ReplicationResponseRepositoryEntries
     */
    protected void doCleanup() {
        ArrayList idsToRemove = new ArrayList(100);
        ConcurrentHashMap myMap = this.getRepository();
        Set entries = myMap.entrySet();
        //if (_logger.isLoggable(Level.FINEST)) {
        //    _logger.finest("doCleanup:entries count = " + entries.size());
        //}
        Iterator it = entries.iterator();
        while(it.hasNext()) {
View Full Code Here


        processExpiredReplicaRemovals();
    }

    public void processExpiredReplicaRemovals() {
        ConcurrentHashMap removalsCache = getReplicatedSessionRemovals();
        Set<Map.Entry> mapEntries = removalsCache.entrySet();
        long timeNow = System.currentTimeMillis();
        for(Iterator<Map.Entry> it = mapEntries.iterator(); it.hasNext();) {
            Map.Entry nextEntry = it.next();
            ReplicationStateRemovedEntry nextRemoval
                = (ReplicationStateRemovedEntry)nextEntry.getValue();
View Full Code Here

        for (String group : this.consumerTable.keySet()) {
            final ConsumerGroupInfo info = this.consumerTable.get(group);
            if (info != null) {
                ConcurrentHashMap<Channel, ClientChannelInfo> cloneChannels =
                        new ConcurrentHashMap(info.getChannelInfoTable());
                for (Map.Entry<Channel, ClientChannelInfo> entry : cloneChannels.entrySet()) {
                    ClientChannelInfo clientChannelInfo = entry.getValue();
                    long diff = System.currentTimeMillis() - clientChannelInfo.getLastUpdateTimestamp();
                    if (diff > ChannelExpiredTimeout) {
                        log.warn(
                            "SCAN: remove expired channel from ConsumerManager consumerTable. channel={}, consumerGroup={}",
View Full Code Here

        throw new RuntimeException("Waited too much");
      }
    } while(map.keySet().size() < N_THREADS);
   
    Set<Integer> distinctPorts = new HashSet<Integer>();
    for(Object entry: map.entrySet()) {
      PortLock pLock = (PortLock)((Map.Entry)entry).getValue();
      distinctPorts.add(pLock.getPort());
      pLock.release();
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.