summaryrefslogtreecommitdiff
path: root/core/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java')
-rw-r--r--core/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java b/core/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java
index bcdb7a43fe..d516942845 100644
--- a/core/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java
+++ b/core/src/main/java/org/elasticsearch/cluster/routing/IndexShardRoutingTable.java
@@ -26,6 +26,7 @@ import org.elasticsearch.common.collect.MapBuilder;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.util.set.Sets;
+import org.elasticsearch.index.Index;
import org.elasticsearch.index.shard.ShardId;
import java.io.IOException;
@@ -617,11 +618,11 @@ public class IndexShardRoutingTable implements Iterable<ShardRouting> {
}
public static IndexShardRoutingTable readFrom(StreamInput in) throws IOException {
- String index = in.readString();
+ Index index = Index.readIndex(in);
return readFromThin(in, index);
}
- public static IndexShardRoutingTable readFromThin(StreamInput in, String index) throws IOException {
+ public static IndexShardRoutingTable readFromThin(StreamInput in, Index index) throws IOException {
int iShardId = in.readVInt();
Builder builder = new Builder(new ShardId(index, iShardId));
@@ -635,7 +636,7 @@ public class IndexShardRoutingTable implements Iterable<ShardRouting> {
}
public static void writeTo(IndexShardRoutingTable indexShard, StreamOutput out) throws IOException {
- out.writeString(indexShard.shardId().index().name());
+ out.writeString(indexShard.shardId().getIndex().getName());
writeToThin(indexShard, out);
}