Class BaseEntityPartitioner<EK extends EntityKey<EK>>
java.lang.Object
io.datarouter.model.key.entity.base.BaseEntityPartitioner<EK>
- All Implemented Interfaces:
EntityPartitioner<EK>
- Direct Known Subclasses:
BaseByteArrayEntityPartitioner,BaseStringEntityPartitioner
public abstract class BaseEntityPartitioner<EK extends EntityKey<EK>> extends Object implements EntityPartitioner<EK>
-
Constructor Summary
Constructors Constructor Description BaseEntityPartitioner(int numPartitions) -
Method Summary
Modifier and Type Method Description List<Integer>getAllPartitions()List<byte[]>getAllPrefixes()byte[][]getAllPrefixesArray()byte[]getNextPrefix(int partition)intgetNumPartitions()intgetNumPrefixBytes()byte[]getPrefix(int partition)byte[]getPrefix(EK ek)booleanisLastPartition(int partition)intparsePartitionFromBytes(byte[] bytes)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.datarouter.model.key.entity.EntityPartitioner
getPartition, scanAllPartitions, scanAllPrefixes, scanPartitions, scanPrefixes
-
Constructor Details
-
BaseEntityPartitioner
public BaseEntityPartitioner(int numPartitions)
-
-
Method Details
-
getNumPartitions
public final int getNumPartitions()- Specified by:
getNumPartitionsin interfaceEntityPartitioner<EK extends EntityKey<EK>>
-
getAllPartitions
- Specified by:
getAllPartitionsin interfaceEntityPartitioner<EK extends EntityKey<EK>>
-
isLastPartition
public boolean isLastPartition(int partition)- Specified by:
isLastPartitionin interfaceEntityPartitioner<EK extends EntityKey<EK>>
-
getNumPrefixBytes
public int getNumPrefixBytes()- Specified by:
getNumPrefixBytesin interfaceEntityPartitioner<EK extends EntityKey<EK>>
-
getAllPrefixes
- Specified by:
getAllPrefixesin interfaceEntityPartitioner<EK extends EntityKey<EK>>
-
getAllPrefixesArray
public byte[][] getAllPrefixesArray()- Specified by:
getAllPrefixesArrayin interfaceEntityPartitioner<EK extends EntityKey<EK>>
-
getPrefix
public byte[] getPrefix(int partition)- Specified by:
getPrefixin interfaceEntityPartitioner<EK extends EntityKey<EK>>
-
getPrefix
- Specified by:
getPrefixin interfaceEntityPartitioner<EK extends EntityKey<EK>>
-
getNextPrefix
public byte[] getNextPrefix(int partition)- Specified by:
getNextPrefixin interfaceEntityPartitioner<EK extends EntityKey<EK>>
-
parsePartitionFromBytes
public int parsePartitionFromBytes(byte[] bytes)- Specified by:
parsePartitionFromBytesin interfaceEntityPartitioner<EK extends EntityKey<EK>>
-