return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
protected Multimap<String, Integer> create() { Multimap<String, Integer> unfiltered = HashMultimap.create(); unfiltered.put("foo", 55556); unfiltered.put("badkey", 1); return Multimaps.filterEntries(unfiltered, ENTRY_PREDICATE); }
private Multimap<String, Integer> createMultimap() { Multimap<String, Integer> unfiltered = HashMultimap.create(); unfiltered.put("zero", 55556); unfiltered.put("one", 55556); unfiltered.put("badkey", 1); return Multimaps.filterEntries(unfiltered, PREDICATE); }
checkNotNull(entryPredicate); if (unfiltered instanceof SetMultimap) { return filterEntries((SetMultimap<K, V>) unfiltered, entryPredicate);
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
@Override SetMultimap<String, Integer> filter(SetMultimap<String, Integer> multimap) { ImmutableSetMultimap<String, Integer> badEntries = ImmutableSetMultimap.of("foo", 314, "one", 159, "two", 265, "bar", 358); multimap.putAll(badEntries); multimap = Multimaps.filterEntries( multimap, Predicates.not( Predicates.in(ImmutableMap.of("one", 159, "two", 265).entrySet()))); return Multimaps.filterKeys( multimap, Predicates.not(Predicates.in(ImmutableSet.of("foo", "bar")))); } })
@Override SetMultimap<String, Integer> filter(SetMultimap<String, Integer> multimap) { ImmutableSetMultimap<String, Integer> badEntries = ImmutableSetMultimap.of("foo", 314, "one", 159, "two", 265, "bar", 358); multimap.putAll(badEntries); multimap = Multimaps.filterKeys( multimap, Predicates.not(Predicates.in(ImmutableSet.of("foo", "bar")))); return Multimaps.filterEntries( multimap, Predicates.not(Predicates.in(badEntries.entries()))); } })
checkNotNull(entryPredicate); if (unfiltered instanceof SetMultimap) { return filterEntries((SetMultimap<K, V>) unfiltered, entryPredicate);
@Override SetMultimap<String, Integer> filter(SetMultimap<String, Integer> multimap) { ImmutableSetMultimap<String, Integer> badEntries = ImmutableSetMultimap.of("foo", 314, "one", 159, "two", 265, "bar", 358); multimap.putAll(badEntries); return Multimaps.filterEntries( multimap, Predicates.not(Predicates.in(badEntries.entries()))); } })
public static void deleteAllTimestampsDefaultImpl(KeyValueService kvs, TableReference tableRef, Map<Cell, Long> maxTimestampByCell, boolean deleteSentinel) { if (maxTimestampByCell.isEmpty()) { return; } long maxTimestampExclusive = maxTimestampByCell.values().stream().max(Long::compare).get(); Multimap<Cell, Long> timestampsByCell = kvs.getAllTimestamps(tableRef, maxTimestampByCell.keySet(), maxTimestampExclusive); Multimap<Cell, Long> timestampsByCellExcludingSentinels = Multimaps.filterEntries(timestampsByCell, entry -> { long maxTimestampForCell = maxTimestampByCell.get(entry.getKey()); long timestamp = entry.getValue(); return timestamp < maxTimestampForCell && (deleteSentinel || timestamp != Value.INVALID_VALUE_TIMESTAMP); }); kvs.delete(tableRef, timestampsByCellExcludingSentinels); }
public static void deleteAllTimestampsDefaultImpl(KeyValueService kvs, TableReference tableRef, Map<Cell, Long> maxTimestampByCell, boolean deleteSentinel) { if (maxTimestampByCell.isEmpty()) { return; } long maxTimestampExclusive = maxTimestampByCell.values().stream().max(Long::compare).get(); Multimap<Cell, Long> timestampsByCell = kvs.getAllTimestamps(tableRef, maxTimestampByCell.keySet(), maxTimestampExclusive); Multimap<Cell, Long> timestampsByCellExcludingSentinels = Multimaps.filterEntries(timestampsByCell, entry -> { long maxTimestampForCell = maxTimestampByCell.get(entry.getKey()); long timestamp = entry.getValue(); return timestamp < maxTimestampForCell && (deleteSentinel || timestamp != Value.INVALID_VALUE_TIMESTAMP); }); kvs.delete(tableRef, timestampsByCellExcludingSentinels); }
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
return filterEntries(unfiltered, Maps.<V>valuePredicateOnEntries(valuePredicate));
protected Multimap<String, Integer> create() { Multimap<String, Integer> unfiltered = HashMultimap.create(); unfiltered.put("foo", 55556); unfiltered.put("badkey", 1); return Multimaps.filterEntries(unfiltered, ENTRY_PREDICATE); }
private Multimap<String, Integer> createMultimap() { Multimap<String, Integer> unfiltered = HashMultimap.create(); unfiltered.put("zero", 55556); unfiltered.put("one", 55556); unfiltered.put("badkey", 1); return Multimaps.filterEntries(unfiltered, PREDICATE); }
@Override SetMultimap<String, Integer> filter(SetMultimap<String, Integer> multimap) { ImmutableSetMultimap<String, Integer> badEntries = ImmutableSetMultimap.of("foo", 314, "one", 159, "two", 265, "bar", 358); multimap.putAll(badEntries); multimap = Multimaps.filterEntries(multimap, Predicates.not(Predicates.in(ImmutableMap.of("one", 159, "two", 265).entrySet()))); return Multimaps.filterKeys(multimap, Predicates.not(Predicates.in(ImmutableSet.of("foo", "bar")))); } })