K
- type of the entry keyV
- type of the entry valuepublic class PartitionPredicate<K,V> extends Object implements Predicate<K,V>, IdentifiedDataSerializable
Predicate
that restricts the execution of a Predicate to a single Partition.
This can help to speed up query execution since only a single instead of all partitions needs to be queried.
This predicate can only be used as an outer predicate.Constructor and Description |
---|
PartitionPredicate() |
PartitionPredicate(Object partitionKey,
Predicate<K,V> target)
Creates a new PartitionPredicate.
|
Modifier and Type | Method and Description |
---|---|
boolean |
apply(Map.Entry<K,V> mapEntry) |
int |
getFactoryId()
Returns DataSerializableFactory factory id for this class.
|
int |
getId()
Returns type identifier for this class.
|
Object |
getPartitionKey()
Returns the partition key that determines the partition the target
Predicate is going to execute on. |
Predicate<K,V> |
getTarget()
Returns the target
Predicate . |
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
String |
toString() |
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public PartitionPredicate()
public PartitionPredicate(Object partitionKey, Predicate<K,V> target)
partitionKey
- the partition keytarget
- the target Predicate
IllegalArgumentException
- if partitionId smaller than zeroNullPointerException
- if target Predicate is null
public Object getPartitionKey()
Predicate
is going to execute on.public Predicate<K,V> getTarget()
Predicate
.Predicate
.public int getFactoryId()
IdentifiedDataSerializable
getFactoryId
in interface IdentifiedDataSerializable
public int getId()
IdentifiedDataSerializable
getId
in interface IdentifiedDataSerializable
public void writeData(ObjectDataOutput out) throws IOException
DataSerializable
writeData
in interface DataSerializable
out
- outputIOException
public void readData(ObjectDataInput in) throws IOException
DataSerializable
readData
in interface DataSerializable
in
- inputIOException
Copyright © 2017 Hazelcast, Inc.. All Rights Reserved.