public class Routing
extends java.lang.Object
implements org.elasticsearch.common.io.stream.Streamable
Modifier and Type | Class and Description |
---|---|
static class |
Routing.RoutingLocationVisitor |
Constructor and Description |
---|
Routing(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<java.lang.Integer>>> locations) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsShards(java.lang.String nodeId)
returns true if the routing contains shards for any table of the given node
|
boolean |
equals(java.lang.Object o) |
static Routing |
forTableOnNode(TableIdent tableIdent,
java.lang.String nodeId)
Return a routing for the given table on the given node id.
|
static Routing |
fromStream(org.elasticsearch.common.io.stream.StreamInput in) |
int |
hashCode() |
boolean |
hasLocations() |
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<java.lang.Integer>>> |
locations() |
java.util.Set<java.lang.String> |
nodes() |
int |
numShards(java.lang.String nodeId)
get the number of shards in this routing for a node with given nodeId
|
void |
readFrom(org.elasticsearch.common.io.stream.StreamInput in) |
java.lang.String |
toString() |
void |
walkLocations(Routing.RoutingLocationVisitor visitor) |
void |
writeTo(org.elasticsearch.common.io.stream.StreamOutput out) |
public Routing(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<java.lang.Integer>>> locations)
public void walkLocations(Routing.RoutingLocationVisitor visitor)
public static Routing fromStream(org.elasticsearch.common.io.stream.StreamInput in) throws java.io.IOException
java.io.IOException
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<java.lang.Integer>>> locations()
Map<nodeName (string),
Map<indexName (string), List<ShardId (int)>>>
public boolean hasLocations()
public java.util.Set<java.lang.String> nodes()
public int numShards(java.lang.String nodeId)
public boolean containsShards(java.lang.String nodeId)
public java.lang.String toString()
toString
in class java.lang.Object
public void readFrom(org.elasticsearch.common.io.stream.StreamInput in) throws java.io.IOException
readFrom
in interface org.elasticsearch.common.io.stream.Streamable
java.io.IOException
public void writeTo(org.elasticsearch.common.io.stream.StreamOutput out) throws java.io.IOException
writeTo
in interface org.elasticsearch.common.io.stream.Streamable
java.io.IOException
public static Routing forTableOnNode(TableIdent tableIdent, java.lang.String nodeId)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object