@Override public ImmutableSet<T> newWithAll(Iterable<? extends T> elements) { MutableSet<T> result = UnifiedSet.newSet(elements); result.addAll(this); return result.toImmutable(); }
@Override public ImmutableSet<T> newWithAll(Iterable<? extends T> elements) { MutableSet<T> result = UnifiedSet.newSet(elements); result.addAll(this); return result.toImmutable(); }
void addKnownItems(String user, Collection<String> items) { if (!items.isEmpty()) { MutableSet<String> knownItemsForUser = doGetKnownItems(user); if (knownItemsForUser == null) { try (AutoLock al = knownItemsLock.autoWriteLock()) { // Check again knownItemsForUser = knownItems.computeIfAbsent(user, k -> UnifiedSet.newSet()); } } synchronized (knownItemsForUser) { knownItemsForUser.addAll(items); } } }
public void retainRecentAndItemIDs(Collection<String> items) { Y.retainRecentAndIDs(items); try (AutoLock al = expectedItemIDsLock.autoWriteLock()) { expectedItemIDs.clear(); expectedItemIDs.addAll(items); Y.removeAllIDsFrom(expectedItemIDs); } }
public void retainRecentAndUserIDs(Collection<String> users) { X.retainRecentAndIDs(users); try (AutoLock al = expectedUserIDsLock.autoWriteLock()) { expectedUserIDs.clear(); expectedUserIDs.addAll(users); X.removeAllIDsFrom(expectedUserIDs); } }
/** * Retains only users that are expected to appear * in the upcoming model updates, or, that have arrived recently. This also clears the * recent known users data structure. * * @param users users that should be retained, which are coming in the new model updates */ void retainRecentAndUserIDs(Collection<String> users) { X.retainRecentAndIDs(users); try (AutoLock al = expectedUserIDsLock.autoWriteLock()) { expectedUserIDs.clear(); expectedUserIDs.addAll(users); X.removeAllIDsFrom(expectedUserIDs); } }
/** * Retains only items that are expected to appear * in the upcoming model updates, or, that have arrived recently. This also clears the * recent known items data structure. * * @param items items that should be retained, which are coming in the new model updates */ void retainRecentAndItemIDs(Collection<String> items) { Y.retainRecentAndIDs(items); try (AutoLock al = expectedItemIDsLock.autoWriteLock()) { expectedItemIDs.clear(); expectedItemIDs.addAll(items); Y.removeAllIDsFrom(expectedItemIDs); } }
@Override public ImmutableSet<T> newWithAll(Iterable<? extends T> elements) { MutableSet<T> result = UnifiedSet.newSet(elements); result.addAll(this); return result.toImmutable(); }
public void retainRecentAndUserIDs(Collection<String> users) { X.retainRecentAndIDs(users); try (AutoLock al = expectedUserIDsLock.autoWriteLock()) { expectedUserIDs.clear(); expectedUserIDs.addAll(users); X.removeAllIDsFrom(expectedUserIDs); } }
public void retainRecentAndItemIDs(Collection<String> items) { Y.retainRecentAndIDs(items); try (AutoLock al = expectedItemIDsLock.autoWriteLock()) { expectedItemIDs.clear(); expectedItemIDs.addAll(items); Y.removeAllIDsFrom(expectedItemIDs); } }
drops.addAll(physicalSchemaToSchemaMap.keysView().flatCollect(new Function<PhysicalSchema, RichIterable<DbCleanCommand>>() { @Override
drops.addAll(physicalSchemaToSchemaMap.keysView().flatCollect(new Function<PhysicalSchema, RichIterable<DbCleanCommand>>() { @Override