Package com.hazelcast.partition
Class PartitionAwareKey<K,P>
java.lang.Object
com.hazelcast.partition.PartitionAwareKey<K,P>
- Type Parameters:
K- the key typeP- the partitionKey type
- All Implemented Interfaces:
DataSerializable,PartitionAware<Object>
public final class PartitionAwareKey<K,P>
extends Object
implements PartitionAware<Object>, DataSerializable
A
PartitionAware key. This is useful in combination with a Map where you want to control the
partition of a key.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
PartitionAwareKey
Creates a new PartitionAwareKey.- Parameters:
key- the keypartitionKey- the partitionKey- Throws:
IllegalArgumentException- if key or partitionKey is null.
-
-
Method Details
-
getKey
Gets the key (not the partitionKey).- Returns:
- the key (not the partitionKey)
-
getPartitionKey
Description copied from interface:PartitionAwareThe key that will be used by Hazelcast to specify the partition. You should give the same key for objects that you want to be in the same partition.- Specified by:
getPartitionKeyin interfacePartitionAware<K>- Returns:
- the key that specifies the partition
-
writeData
Description copied from interface:DataSerializableWrites object fields to output stream- Specified by:
writeDatain interfaceDataSerializable- Parameters:
out- output- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializableReads fields from the input stream- Specified by:
readDatain interfaceDataSerializable- Parameters:
in- input- Throws:
IOException- if an I/O error occurs. In particular, anIOExceptionmay be thrown if the input stream has been closed.
-
equals
-
hashCode
public int hashCode() -
toString
-