com.bagri.server.hazelcast.predicate.MemberPredicate 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 com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.Member;
import com.hazelcast.core.Partition;
import com.hazelcast.core.PartitionService;
import com.hazelcast.query.Predicate;
public class MemberPredicate implements Predicate {
/**
*
*/
private static final long serialVersionUID = 1L;
private PartitionService partService;
private Member member;
private Predicate predicate;
public MemberPredicate() {
//
}
public MemberPredicate(PartitionService partService, Member member, Predicate predicate) {
this.partService = partService;
this.member = member;
this.predicate = predicate;
}
@Override
public boolean apply(Map.Entry mapEntry) {
if (member.equals(partService.getPartition(mapEntry.getKey()).getOwner())) {
return predicate.apply(mapEntry);
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy