public void clear() { core.clear(); }
/** * Clears all entries. */ public void reset() { entries.clear(); }
@Override public void clear() { this.map.clear(); }
/** * Uninstalls the package from the system in a way, that will allow its discovery through {@link * PackageManager#MATCH_UNINSTALLED_PACKAGES}. */ public void deletePackage(String packageName) { deletedPackages.add(packageName); packageInfos.remove(packageName); mapForPackage(activityFilters, packageName).clear(); mapForPackage(serviceFilters, packageName).clear(); mapForPackage(providerFilters, packageName).clear(); mapForPackage(receiverFilters, packageName).clear(); }
public void testTailMapClearThrough() { final SortedMap<K, V> map; try { map = makePopulatedMap(); } catch (UnsupportedOperationException e) { return; } int oldSize = map.size(); if (map.size() < 2 || !supportsClear) { return; } Iterator<Entry<K, V>> iterator = map.entrySet().iterator(); iterator.next(); // advance Entry<K, V> secondEntry = iterator.next(); K key = secondEntry.getKey(); SortedMap<K, V> subMap = map.tailMap(key); int subMapSize = subMap.size(); subMap.clear(); assertEquals(map.size(), oldSize - subMapSize); assertTrue(subMap.isEmpty()); } }
@Override public void clear() { checkInit(); delegate.clear(); }
@Override @SuppressWarnings("unchecked") public void clear() { write(); subMap.clear(); }
protected static void clearPackagePreferredActivitiesInternal( String packageName, SortedMap<ComponentName, List<IntentFilter>> preferredActivitiesMap) { mapForPackage(preferredActivitiesMap, packageName).clear(); }
/** * Flush pending updates to cached map. */ private void flushPending() { if (F.isEmpty(pending)) return; for (Map.Entry<Integer, Map<KeyCacheObject, MvccTxEntry>> entry : pending.entrySet()) { Map<KeyCacheObject, MvccTxEntry> vals = entry.getValue(); cached.putAll(vals); } pending.clear(); }
/** * Clear the current state of hbck. */ private void clearState() { // Make sure regionInfo is empty before starting fixes = 0; regionInfoMap.clear(); emptyRegionInfoQualifiers.clear(); tableStates.clear(); errors.clear(); tablesInfo.clear(); orphanHdfsDirs.clear(); skippedRegions.clear(); }
@Override public void fail(Object msgId) { TransactionAttempt tx = (TransactionAttempt) msgId; TransactionStatus stored = _activeTx.remove(tx.getTransactionId()); LOG.debug("Fail. [tx_attempt = {}], [tx_status = {}], [{}]", tx, stored, this); if (stored != null && tx.equals(stored.attempt)) { _activeTx.tailMap(tx.getTransactionId()).clear(); sync(); } }
@Override public synchronized void fail(Object msgId) { TransactionAttempt tx = (TransactionAttempt) msgId; TransactionStatus stored = _activeTx.remove(tx.getTransactionId()); if (stored != null && tx.equals(stored.attempt)) { _activeTx.tailMap(tx.getTransactionId()).clear(); sync(); } }
@Override public synchronized void fail(Object msgId) { TransactionAttempt tx = (TransactionAttempt) msgId; TransactionStatus stored = _activeTx.remove(tx.getTransactionId()); if (stored != null && tx.equals(stored.attempt)) { _activeTx.tailMap(tx.getTransactionId()).clear(); sync(); } }
private void resetSpoutState() { outputCollector.init(currState.getCurrBatchId(), downstreamTasks); committingBatches.clear(); moveToNextBatch(); }
/** * Fill our map with content of the pb we read off disk * @param fip protobuf message to read */ void parsePB(final HFileProtos.FileInfoProto fip) { this.map.clear(); for (BytesBytesPair pair: fip.getMapEntryList()) { this.map.put(pair.getFirst().toByteArray(), pair.getSecond().toByteArray()); } } }
rangesByLowerBound.subMap(lbToAdd, ubToAdd).clear();
public void testSubRowClearAndPut() { table = create("foo", 1, 'a', "bar", 1, 'b', "foo", 3, 'c'); SortedMap<Integer, Character> row = (SortedMap<Integer, Character>) table.row("foo"); SortedMap<Integer, Character> subRow = row.tailMap(2); assertEquals(ImmutableMap.of(1, 'a', 3, 'c'), row); assertEquals(ImmutableMap.of(3, 'c'), subRow); table.remove("foo", 3); assertEquals(ImmutableMap.of(1, 'a'), row); assertEquals(ImmutableMap.of(), subRow); table.remove("foo", 1); assertEquals(ImmutableMap.of(), row); assertEquals(ImmutableMap.of(), subRow); table.put("foo", 2, 'b'); assertEquals(ImmutableMap.of(2, 'b'), row); assertEquals(ImmutableMap.of(2, 'b'), subRow); row.clear(); assertEquals(ImmutableMap.of(), row); assertEquals(ImmutableMap.of(), subRow); table.put("foo", 5, 'x'); assertEquals(ImmutableMap.of(5, 'x'), row); assertEquals(ImmutableMap.of(5, 'x'), subRow); } }
public void testClearSubMapOfRowMap() { TreeBasedTable<String, String, String> table = TreeBasedTable.create(); table.put("a", "b", "c"); table.put("c", "b", "a"); table.put("b", "b", "x"); table.put("b", "c", "y"); table.put("b", "x", "n"); table.put("a", "a", "d"); table.row("b").subMap("c", "x").clear(); assertEquals(table.row("b"), ImmutableMap.of("b", "x", "x", "n")); table.row("b").subMap("b", "y").clear(); assertEquals(table.row("b"), ImmutableMap.of()); assertFalse(table.backingMap.containsKey("b")); } }
rangesByLowerBound.subMap(rangeToRemove.lowerBound, rangeToRemove.upperBound).clear();
entriesByLowerBound.subMap(rangeToRemove.lowerBound, rangeToRemove.upperBound).clear();