} else if (type == TransactionEventRecord.Type.ROLLBACK.get()) { rollbackCount++; transactionMap.remove(trans); } else if (type == TransactionEventRecord.Type.COMMIT.get()) { commitCount++; @SuppressWarnings("unchecked") Collection<FlumeEventPointer> pointers = (Collection<FlumeEventPointer>) transactionMap.remove(trans); if (((Commit) record).getType() == TransactionEventRecord.Type.TAKE.get()) { if (inflightTakes.containsKey(trans)) {
} else if (type == TransactionEventRecord.Type.ROLLBACK.get()) { rollbackCount++; transactionMap.remove(trans); } else if (type == TransactionEventRecord.Type.COMMIT.get()) { commitCount++; @SuppressWarnings("unchecked") Collection<FlumeEventPointer> pointers = (Collection<FlumeEventPointer>) transactionMap.remove(trans); if (((Commit) record).getType() == TransactionEventRecord.Type.TAKE.get()) {
public void unregisterValidationEventHandler(final ValidationEventLocator locator, final ValidationEventHandler handler) { handlersMap.remove(locator, handler); }
public Collection<V> remove(K key) { return (Collection<V>) m_impl.remove(key); }
/** * Associates issue types to custom fields. This should be called after the parse of all entities is done to give * all the custom field values (there may be more than just <CustomFieldValue> entities) a chance to register * themselves. */ public void registerIssueTypesInUse() { for (String oldIssueId : issueToIssueTypeCache.keySet()) { // Find all the customFields associated with this issue // We remove the values as we go because we know we will only need them once, and we want to free up memory. final Collection customFields = (Collection) issueToCustomFieldMap.remove(oldIssueId); if (customFields != null) { for (final Object customField : customFields) { final String customFieldId = (String) customField; // register that this custom field uses the given issue type. final String oldIssueTypeId = issueToIssueTypeCache.get(oldIssueId); issueTypesInUse.put(customFieldId, oldIssueTypeId); // Also store a map to remember the Issue Type for each Issue. issueToIssueTypeMap.put(oldIssueId, oldIssueTypeId); } } } //clear the cache...it's no longer needed now! issueToIssueTypeCache.clear(); }
private void replaceHeader(String name, Object value) { if (responseExpirationCalculator == null || !responseExpirationCalculator.addHeader(name, value)) { headers.remove(name); headers.put(name, value); } }
private void removeAt(String path, Object value) { if (path == null) { throw new NullPointerException("Path cannot be null."); } if (path.length() == 0) { throw new IllegalArgumentException("Path cannot be empty"); } Map map = locateMapAt(path, false); String key = path.substring(path.lastIndexOf(SEGMENT_SEPARATOR) + 1, path.length()); if (map == null) { return; } multiValueMapForLocated.remove(key, value); if (multiValueMap.containsKey(key)) { map.put(key, ((StackReversedIteration) multiValueMap.get(key)).peek()); } else { map.remove(key); } }
public static void removeRolesFor(INamespace namespace) { List<Pair<IConcept, RoleDescriptor>> toRemove = new ArrayList<>(); for (Object o : roles.values()) { RoleDescriptor rd = (RoleDescriptor) o; if (rd.namespaceId.equals(namespace.getId())) { toRemove.add(new Pair<>(rd.role, rd)); } } for (Pair<IConcept, RoleDescriptor> r : toRemove) { roles.remove(r.getFirst(), r.getSecond()); } }
multiMap.put( "Sean" , "Java" ); multiMap.put( "Sean" , ".NET" ); multiMap.remove( "Sean" , "C/C++" );
public void cleanupLocalContext() { if (localContexts.empty()) { throw new IllegalStateException("Local contexts stack is empty"); } ArrayStack removeEntries = (ArrayStack)localContexts.pop(); while (!removeEntries.isEmpty()) { if (removeEntries.peek() instanceof PathValue) { PathValue entry = (PathValue)removeEntries.pop(); removeAt(entry.getPath(), entry.getValue()); } else { KeyValue entry = (KeyValue)removeEntries.pop(); Object key = entry.getKey(); Object value = entry.getValue(); multiValueMap.remove(key, value); if (multiValueMap.containsKey(key)) { singleValueMap.put(key, ((StackReversedIteration) multiValueMap.get(key)).peek()); } else { singleValueMap.remove(key); } } } }
} else if (type == TransactionEventRecord.Type.ROLLBACK.get()) { rollbackCount++; transactionMap.remove(trans); } else if (type == TransactionEventRecord.Type.COMMIT.get()) { commitCount++; @SuppressWarnings("unchecked") Collection<FlumeEventPointer> pointers = (Collection<FlumeEventPointer>) transactionMap.remove(trans); if (((Commit) record).getType() == TransactionEventRecord.Type.TAKE.get()) { if (inflightTakes.containsKey(trans)) {
} else if (type == TransactionEventRecord.Type.ROLLBACK.get()) { rollbackCount++; transactionMap.remove(trans); } else if (type == TransactionEventRecord.Type.COMMIT.get()) { commitCount++; @SuppressWarnings("unchecked") Collection<FlumeEventPointer> pointers = (Collection<FlumeEventPointer>) transactionMap.remove(trans); if (((Commit) record).getType() == TransactionEventRecord.Type.TAKE.get()) {