public class IPDataPartitioner extends java.lang.Object implements DataPartitioner
Assumes an 8-bit partition size
Constructor and Description |
---|
IPDataPartitioner() |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.math.BigInteger> |
arrayToPartitions(java.util.List<?> elementList,
java.lang.String type)
Create partitions for an array of the same type of elements - used when a data value field is an array and we wish to encode these into the return value
|
java.lang.Object |
fromPartitions(java.util.List<java.math.BigInteger> parts,
int partsIndex,
java.lang.String type)
Method to reconstruct an Object given a List of its BigInteger partition elements and its type identifier.
|
int |
getBits(java.lang.String type)
Returns the number of bits of an object with the given type.
|
int |
getNumPartitions(java.lang.String type)
Method to get the number of partitions of the data object given the type.
|
java.util.List<java.math.BigInteger> |
getPaddedPartitions(java.lang.String type)
Method to get an empty set of partitions by data type - used for padding return array values.
|
java.util.List<java.math.BigInteger> |
toPartitions(java.lang.Object object,
java.lang.String type)
Method to partition the given Object into a List of BigInteger partition elements given its type identifier.
|
public java.util.List<java.math.BigInteger> toPartitions(java.lang.Object object, java.lang.String type)
DataPartitioner
If the Object does not have/need a specific type identifier, use null.
toPartitions
in interface DataPartitioner
public java.lang.Object fromPartitions(java.util.List<java.math.BigInteger> parts, int partsIndex, java.lang.String type)
DataPartitioner
If the Object does not have/need a specific type identifier, use null.
fromPartitions
in interface DataPartitioner
public int getBits(java.lang.String type)
DataPartitioner
getBits
in interface DataPartitioner
public java.util.List<java.math.BigInteger> getPaddedPartitions(java.lang.String type)
DataPartitioner
getPaddedPartitions
in interface DataPartitioner
public java.util.List<java.math.BigInteger> arrayToPartitions(java.util.List<?> elementList, java.lang.String type)
arrayToPartitions
in interface DataPartitioner
public int getNumPartitions(java.lang.String type)
DataPartitioner
getNumPartitions
in interface DataPartitioner