/** * Clear the map. * <p> * This clears each collection in the map, and so may be slow. */ public void clear() { // For gc, clear each list in the map Set pairs = super.entrySet(); Iterator pairsIterator = pairs.iterator(); while (pairsIterator.hasNext()) { Map.Entry keyValuePair = (Map.Entry) pairsIterator.next(); Collection coll = (Collection) keyValuePair.getValue(); coll.clear(); } super.clear(); }
protected void flowThrough(HashMap<Local, Set<NewExpr>> in, Unit unit, HashMap<Local, Set<NewExpr>> out) { Stmt s = (Stmt) unit; out.clear(); out.putAll(in); if (s instanceof DefinitionStmt) { DefinitionStmt ds = (DefinitionStmt) s; Value lhs = ds.getLeftOp(); Value rhs = ds.getRightOp(); if (lhs instanceof Local) { HashSet<NewExpr> lv = new HashSet<NewExpr>(); out.put((Local) lhs, lv); if (rhs instanceof NewExpr) { lv.add((NewExpr) rhs); } else if (rhs instanceof Local) { lv.addAll(in.get(rhs)); } else { lv.add(UNKNOWN); } } } }
/** * Clears the pool, removing all pooled instances. */ @Override public synchronized void clear() { Iterator<K> it = _pools.keySet().iterator(); while(it.hasNext()) { K key = it.next(); Stack<V> stack = _pools.get(key); destroyStack(key,stack); } _totIdle = 0; _pools.clear(); _activeCount.clear(); }
private void removeOldTempIndexes() { if (tempObjects != null) { metaObjects.putAll(tempObjects); for (PageIndex index: tempObjects.values()) { if (index.getTable().isTemporary()) { index.truncate(pageStoreSession); index.remove(pageStoreSession); } } pageStoreSession.commit(true); tempObjects = null; } metaObjects.clear(); metaObjects.put(-1, metaIndex); }
/** * Remove and hard close all the socket handlers managed by this SAM * STREAM session. * */ private void removeAllSocketHandlers() { synchronized (handlersMap) { for (Map.Entry<Integer, SAMStreamSessionSocketReader> e : handlersMap.entrySet()) { Integer id = e.getKey(); e.getValue().stopRunning(); sendersMap.get(id).shutDownGracefully(); } handlersMap.clear(); sendersMap.clear(); } }
builder.append("["); CHOOSE_RANDOM_REASONS.get().clear(); boolean badTarget = false; DatanodeStorageInfo firstChosen = null; if (includeType != null && entry.getKey() != includeType) { continue; chosenNode, blocksize, results, entry.getKey()); if (storage != null) { numOfReplicas--; int num = entry.getValue(); if (num == 1) { iter.remove();
nodeToBuckets.entrySet().iterator(); itr.hasNext();) { Map.Entry<InternalDistributedMember, HashMap<Integer, HashSet>> entry = itr.next(); HashMap<Integer, HashSet> bucketKeys = entry.getValue(); FetchBulkEntriesResponse fber = null; result = new HashSet(); for (Map.Entry<Integer, HashSet> e : bucketKeys.entrySet()) { result.clear(); oneBucketKeys.clear(); oneBucketKeys.put(e.getKey(), e.getValue()); try { if (entry.getKey().getVersionObject().compareTo(Version.GFE_80) < 0) { failures.putAll(nodeToBuckets.get(entry.getKey())); continue; if (fber.getFailedBucketIds() != null && !fber.getFailedBucketIds().isEmpty()) { for (int id : fber.getFailedBucketIds()) { failures.put(id, nodeToBuckets.get(entry.getKey()).get(id)); failures.put(e.getKey(), e.getValue());
mapEdges.put(newedge.getDestination(), new ArrayList<>(Collections.singletonList(newedge))); for (Entry<Statement, List<StatEdge>> entr : mapEdges.entrySet()) { if (entr.getKey() == next) { for (StatEdge edge : entr.getValue()) { edge.explicit = false; for (Entry<Statement, List<StatEdge>> entr : mapEdges.entrySet()) { if (entr.getKey().type != Statement.TYPE_DUMMYEXIT && (lstEdges == null || entr.getValue().size() > lstEdges.size())) { lstEdges = entr.getValue(); mapEdges.clear(); mapEdges.put(statedge.getDestination(), new ArrayList<>(Collections.singletonList(statedge)));
/** * Clear the map. * <p> * This clears each collection in the map, and so may be slow. */ public void clear() { // For gc, clear each list in the map Set pairs = super.entrySet(); Iterator pairsIterator = pairs.iterator(); while (pairsIterator.hasNext()) { Map.Entry keyValuePair = (Map.Entry) pairsIterator.next(); Collection coll = (Collection) keyValuePair.getValue(); coll.clear(); } super.clear(); }
String clientPortAddress = null; for (Entry<Object, Object> entry : zkProp.entrySet()) { String key = entry.getKey().toString().trim(); String value = entry.getValue().toString().trim(); if (key.equals("dataDir")) { dataDir = value; observers.put(Long.valueOf(sid), new QuorumServer(sid, hostname, port, electionPort, type)); } else { servers.put(Long.valueOf(sid), new QuorumServer(sid, hostname, port, electionPort, type)); throw new ConfigException("Server " + sid + "is in multiple groups"); else serverGroup.put(sid, gid); servers.clear(); } else if (servers.size() > 1) { if (servers.size() == 2) {
mincIdleThresholds.clear(); final MemoryManagementActions result = new MemoryManagementActions(); result.tabletsToMinorCompact = new ArrayList<>(); for (TabletInfo largest : lastEntry.getValue()) { toBeCompacted += largest.memTableSize; result.tabletsToMinorCompact.add(largest.extent); i++; largestMemTablets.remove(lastEntry.getKey());
private void buildImagesBucketList() { getThumbnail(); mBucketList.clear(); String bucketId = cursor.getString(bucketIdIndex); ImageBucket bucket = mBucketList.get(bucketId); if (bucket == null) { bucket = new ImageBucket(); mBucketList.put(bucketId, bucket); bucket.bucketList = new ArrayList<ImageItem>(); bucket.bucketName = bucketName; imageItem.setImageId(_id); imageItem.setImagePath(path); imageItem.setThumbnailPath(mThumbnailList.get(_id)); bucket.bucketList.add(imageItem);
private void getThumbnailColumnData(Cursor cur) { mThumbnailList.clear(); if (cur.moveToFirst()) { int image_id; int image_idColumn = cur.getColumnIndex(Thumbnails.IMAGE_ID); int dataColumn = cur.getColumnIndex(Thumbnails.DATA); String image_path; do { image_id = cur.getInt(image_idColumn); image_path = cur.getString(dataColumn); mThumbnailList.put("" + image_id, image_path); } while (cur.moveToNext()); } }
@Override protected void flowThrough(HashMap<Value, Integer> in, Unit u, HashMap<Value, Integer> out) { Stmt s = (Stmt) u; out.clear(); if (rhs instanceof Local) { Integer val = in.get(rhs); if (val != null) { out.put(lhs, val); out.put(lhs, thisRefNumber()); } else if (rhs instanceof ParameterRef) { out.put(lhs, parameterRefNumber((ParameterRef) rhs)); } else {