Search in sources :

Example 1 with CACHEABLE

use of org.molgenis.data.RepositoryCapability.CACHEABLE in project molgenis by molgenis.

the class L1CacheRepositoryDecorator method deleteAll.

@Override
public void deleteAll(Stream<Object> ids) {
    evictBiDiReferencedEntityTypes();
    if (cacheable) {
        EntityType entityType = getEntityType();
        ids = ids.peek(id -> l1Cache.putDeletion(EntityKey.create(entityType, id)));
    }
    delegate().deleteAll(ids);
}
Also used : EntityType(org.molgenis.data.meta.model.EntityType) Spliterators.spliteratorUnknownSize(java.util.Spliterators.spliteratorUnknownSize) java.util(java.util) org.molgenis.data(org.molgenis.data) Iterators.partition(com.google.common.collect.Iterators.partition) ORDERED(java.util.Spliterator.ORDERED) WRITABLE(org.molgenis.data.RepositoryCapability.WRITABLE) CACHEABLE(org.molgenis.data.RepositoryCapability.CACHEABLE) Attribute(org.molgenis.data.meta.model.Attribute) EntityType(org.molgenis.data.meta.model.EntityType) Iterators(com.google.common.collect.Iterators) Collectors.toList(java.util.stream.Collectors.toList) Lists(com.google.common.collect.Lists) Stream(java.util.stream.Stream) Lists.newArrayList(com.google.common.collect.Lists.newArrayList) SORTED(java.util.Spliterator.SORTED) Collectors.toMap(java.util.stream.Collectors.toMap) StreamSupport.stream(java.util.stream.StreamSupport.stream) Objects.requireNonNull(java.util.Objects.requireNonNull)

Aggregations

Iterators (com.google.common.collect.Iterators)1 Iterators.partition (com.google.common.collect.Iterators.partition)1 Lists (com.google.common.collect.Lists)1 Lists.newArrayList (com.google.common.collect.Lists.newArrayList)1 java.util (java.util)1 Objects.requireNonNull (java.util.Objects.requireNonNull)1 ORDERED (java.util.Spliterator.ORDERED)1 SORTED (java.util.Spliterator.SORTED)1 Spliterators.spliteratorUnknownSize (java.util.Spliterators.spliteratorUnknownSize)1 Collectors.toList (java.util.stream.Collectors.toList)1 Collectors.toMap (java.util.stream.Collectors.toMap)1 Stream (java.util.stream.Stream)1 StreamSupport.stream (java.util.stream.StreamSupport.stream)1 org.molgenis.data (org.molgenis.data)1 CACHEABLE (org.molgenis.data.RepositoryCapability.CACHEABLE)1 WRITABLE (org.molgenis.data.RepositoryCapability.WRITABLE)1 Attribute (org.molgenis.data.meta.model.Attribute)1 EntityType (org.molgenis.data.meta.model.EntityType)1