com.bagri.server.hazelcast.predicate.PartitionPredicate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bagri-server-hazelcast Show documentation
Show all versions of bagri-server-hazelcast Show documentation
Bagri DB Cache: Hazelcast implementation
The newest version!
package com.bagri.server.hazelcast.predicate;
import java.util.Map;
import java.util.Set;
import com.hazelcast.core.PartitionService;
import com.hazelcast.query.Predicate;
public class PartitionPredicate implements Predicate {
/**
*
*/
private static final long serialVersionUID = 1L;
private PartitionService partService;
private Set partitions;
private Predicate predicate;
public PartitionPredicate() {
//
}
public PartitionPredicate(PartitionService partService, Set partitions, Predicate predicate) {
this.partService = partService;
this.partitions = partitions;
this.predicate = predicate;
}
@Override
public boolean apply(Map.Entry mapEntry) {
if (partitions.contains(partService.getPartition(mapEntry.getKey()).getPartitionId())) {
return predicate.apply(mapEntry);
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy