public class HostToPartitionsMapping
extends java.lang.Object
implements java.io.Serializable
getCurrent().| Constructor and Description |
|---|
HostToPartitionsMapping(java.util.Map<java.net.InetAddress,java.util.Set<java.lang.Integer>> mapping) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int[] |
generateEvenItemDistribution(int numItems)
Generates the distribution of items to partition in such way that each host
has roughly even share of items.
|
static HostToPartitionsMapping |
getCurrent() |
static HostToPartitionsMapping |
getCurrent(java.lang.Iterable<com.scaleoutsoftware.soss.client.messaging.GatewayDescriptor> gatewayDescriptors)
Gets current partition mapping from the list of gateways provided by the server.
|
java.net.InetAddress |
getForPartition(int partition) |
java.util.Set<java.net.InetAddress> |
getHosts() |
java.util.Set<java.lang.Integer> |
getLocalPartitions() |
int |
getNumberOfHosts() |
java.util.Set<java.lang.Integer> |
getPartitions(java.net.InetAddress host) |
int |
hashCode() |
java.lang.String |
toString() |
public HostToPartitionsMapping(java.util.Map<java.net.InetAddress,java.util.Set<java.lang.Integer>> mapping)
public java.util.Set<java.lang.Integer> getLocalPartitions()
public java.net.InetAddress getForPartition(int partition)
public int getNumberOfHosts()
public java.util.Set<java.net.InetAddress> getHosts()
public java.util.Set<java.lang.Integer> getPartitions(java.net.InetAddress host)
public int[] generateEvenItemDistribution(int numItems)
numItems - number of items to distributepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static HostToPartitionsMapping getCurrent() throws com.scaleoutsoftware.soss.client.da.StateServerException
com.scaleoutsoftware.soss.client.da.StateServerExceptionpublic static HostToPartitionsMapping getCurrent(java.lang.Iterable<com.scaleoutsoftware.soss.client.messaging.GatewayDescriptor> gatewayDescriptors) throws com.scaleoutsoftware.soss.client.da.StateServerException
gatewayDescriptors - list of provided gateway descriptorscom.scaleoutsoftware.soss.client.da.StateServerException - if an error occurs connecting to ScaleOut StateServer.