From 84593f0d7c7eb2d61cc22c93fa10dd4578e2da13 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Thu, 15 May 2014 15:54:50 +0200 Subject: [PATCH] Added meta data and routing version to cluster state's pretty print --- src/main/java/org/elasticsearch/cluster/ClusterState.java | 2 ++ .../org/elasticsearch/cluster/routing/RoutingTable.java | 2 +- .../cluster/service/InternalClusterService.java | 6 ++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/elasticsearch/cluster/ClusterState.java b/src/main/java/org/elasticsearch/cluster/ClusterState.java index 2ce671f934d..f7e8f86962b 100644 --- a/src/main/java/org/elasticsearch/cluster/ClusterState.java +++ b/src/main/java/org/elasticsearch/cluster/ClusterState.java @@ -239,6 +239,8 @@ public class ClusterState implements ToXContent { public String prettyPrint() { StringBuilder sb = new StringBuilder(); + sb.append("version: ").append(version).append("\n"); + sb.append("meta data version: ").append(metaData.version()).append("\n"); sb.append(nodes().prettyPrint()); sb.append(routingTable().prettyPrint()); sb.append(readOnlyRoutingNodes().prettyPrint()); diff --git a/src/main/java/org/elasticsearch/cluster/routing/RoutingTable.java b/src/main/java/org/elasticsearch/cluster/routing/RoutingTable.java index 5a21c2ea888..b7648716587 100644 --- a/src/main/java/org/elasticsearch/cluster/routing/RoutingTable.java +++ b/src/main/java/org/elasticsearch/cluster/routing/RoutingTable.java @@ -447,7 +447,7 @@ public class RoutingTable implements Iterable { } public String prettyPrint() { - StringBuilder sb = new StringBuilder("routing_table:\n"); + StringBuilder sb = new StringBuilder("routing_table (version ").append(version).append("):\n"); for (Map.Entry entry : indicesRouting.entrySet()) { sb.append(entry.getValue().prettyPrint()).append('\n'); } diff --git a/src/main/java/org/elasticsearch/cluster/service/InternalClusterService.java b/src/main/java/org/elasticsearch/cluster/service/InternalClusterService.java index 40ad8b13f41..686f55f1b45 100644 --- a/src/main/java/org/elasticsearch/cluster/service/InternalClusterService.java +++ b/src/main/java/org/elasticsearch/cluster/service/InternalClusterService.java @@ -379,10 +379,8 @@ public class InternalClusterService extends AbstractLifecycleComponent