From 1eee7f381ae98744f1017ce3997798728e34c752 Mon Sep 17 00:00:00 2001 From: kimchy Date: Mon, 18 Oct 2010 19:03:48 +0200 Subject: [PATCH] dont case node names and index names --- .../elasticsearch/common/xcontent/XContentBuilder.java | 6 ++++++ .../admin/cluster/node/info/RestNodesInfoAction.java | 2 +- .../admin/cluster/node/stats/RestNodesStatsAction.java | 2 +- .../admin/cluster/state/RestClusterStateAction.java | 8 ++++---- .../admin/indices/status/RestIndicesStatusAction.java | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java index 9daec3a1cef..56af0279360 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java @@ -161,6 +161,12 @@ public final class XContentBuilder { return this; } + public XContentBuilder startArray(String name, FieldCaseConversion conversion) throws IOException { + field(name, conversion); + startArray(); + return this; + } + public XContentBuilder startArray(String name) throws IOException { field(name); startArray(); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/node/info/RestNodesInfoAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/node/info/RestNodesInfoAction.java index 2d8b8a048f2..65f263a907e 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/node/info/RestNodesInfoAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/node/info/RestNodesInfoAction.java @@ -65,7 +65,7 @@ public class RestNodesInfoAction extends BaseRestHandler { builder.startObject("nodes"); for (NodeInfo nodeInfo : result) { - builder.startObject(nodeInfo.node().id()); + builder.startObject(nodeInfo.node().id(), XContentBuilder.FieldCaseConversion.NONE); builder.field("name", nodeInfo.node().name()); builder.field("transport_address", nodeInfo.node().address().toString()); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/node/stats/RestNodesStatsAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/node/stats/RestNodesStatsAction.java index 8d15f4865b0..aae5ec1e4c0 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/node/stats/RestNodesStatsAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/node/stats/RestNodesStatsAction.java @@ -57,7 +57,7 @@ public class RestNodesStatsAction extends BaseRestHandler { builder.startObject("nodes"); for (NodeStats nodeStats : result) { - builder.startObject(nodeStats.node().id()); + builder.startObject(nodeStats.node().id(), XContentBuilder.FieldCaseConversion.NONE); builder.field("name", nodeStats.node().name()); diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/state/RestClusterStateAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/state/RestClusterStateAction.java index 97558f3a64b..4ef71f84582 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/state/RestClusterStateAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/cluster/state/RestClusterStateAction.java @@ -117,7 +117,7 @@ public class RestClusterStateAction extends BaseRestHandler { if (!clusterStateRequest.filterNodes()) { builder.startObject("nodes"); for (DiscoveryNode node : state.nodes()) { - builder.startObject(node.id()); + builder.startObject(node.id(), XContentBuilder.FieldCaseConversion.NONE); builder.field("name", node.name()); builder.field("transport_address", node.address().toString()); @@ -138,7 +138,7 @@ public class RestClusterStateAction extends BaseRestHandler { builder.startObject("indices"); for (IndexMetaData indexMetaData : state.metaData()) { - builder.startObject(indexMetaData.index()); + builder.startObject(indexMetaData.index(), XContentBuilder.FieldCaseConversion.NONE); builder.startObject("settings"); Settings settings = settingsFilter.filterSettings(indexMetaData.settings()); @@ -179,7 +179,7 @@ public class RestClusterStateAction extends BaseRestHandler { builder.startObject("routing_table"); builder.startObject("indices"); for (IndexRoutingTable indexRoutingTable : state.routingTable()) { - builder.startObject(indexRoutingTable.index()); + builder.startObject(indexRoutingTable.index(), XContentBuilder.FieldCaseConversion.NONE); builder.startObject("shards"); for (IndexShardRoutingTable indexShardRoutingTable : indexRoutingTable) { builder.startArray(Integer.toString(indexShardRoutingTable.shardId().id())); @@ -206,7 +206,7 @@ public class RestClusterStateAction extends BaseRestHandler { builder.startObject("nodes"); for (RoutingNode routingNode : state.readOnlyRoutingNodes()) { - builder.startArray(routingNode.nodeId()); + builder.startArray(routingNode.nodeId(), XContentBuilder.FieldCaseConversion.NONE); for (ShardRouting shardRouting : routingNode) { jsonShardRouting(builder, shardRouting); } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/status/RestIndicesStatusAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/status/RestIndicesStatusAction.java index ec090ce3b8e..cbd3edc3fe3 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/status/RestIndicesStatusAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/rest/action/admin/indices/status/RestIndicesStatusAction.java @@ -74,7 +74,7 @@ public class RestIndicesStatusAction extends BaseRestHandler { builder.startObject("indices"); for (IndexStatus indexStatus : response.indices().values()) { - builder.startObject(indexStatus.index()); + builder.startObject(indexStatus.index(), XContentBuilder.FieldCaseConversion.NONE); builder.array("aliases", indexStatus.settings().getAsArray("index.aliases"));