From 62a09fd20738219a1d1e726bff2953bffa70a481 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Mon, 30 Sep 2013 10:39:14 +0200 Subject: [PATCH] additional places not to do field conversions --- .../action/admin/cluster/node/info/NodesInfoResponse.java | 8 ++++---- .../action/admin/cluster/node/stats/NodeStats.java | 4 ++-- src/main/java/org/elasticsearch/monitor/fs/FsStats.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java index d44a6a96534..a081e7c2be0 100644 --- a/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java +++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/info/NodesInfoResponse.java @@ -71,7 +71,7 @@ public class NodesInfoResponse extends NodesOperationResponse implemen @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { - builder.field("cluster_name", getClusterName().value()); + builder.field("cluster_name", getClusterName().value(), XContentBuilder.FieldCaseConversion.NONE); builder.startObject("nodes"); for (NodeInfo nodeInfo : this) { @@ -90,14 +90,14 @@ public class NodesInfoResponse extends NodesOperationResponse implemen if (nodeInfo.getServiceAttributes() != null) { for (Map.Entry nodeAttribute : nodeInfo.getServiceAttributes().entrySet()) { - builder.field(nodeAttribute.getKey(), nodeAttribute.getValue()); + builder.field(nodeAttribute.getKey(), nodeAttribute.getValue(), XContentBuilder.FieldCaseConversion.NONE); } } if (!nodeInfo.getNode().attributes().isEmpty()) { builder.startObject("attributes"); for (Map.Entry attr : nodeInfo.getNode().attributes().entrySet()) { - builder.field(attr.getKey(), attr.getValue()); + builder.field(attr.getKey(), attr.getValue(), XContentBuilder.FieldCaseConversion.NONE); } builder.endObject(); } @@ -107,7 +107,7 @@ public class NodesInfoResponse extends NodesOperationResponse implemen builder.startObject("settings"); Settings settings = settingsFilter.filterSettings(nodeInfo.getSettings()); for (Map.Entry entry : settings.getAsMap().entrySet()) { - builder.field(entry.getKey(), entry.getValue()); + builder.field(entry.getKey(), entry.getValue(), XContentBuilder.FieldCaseConversion.NONE); } builder.endObject(); } diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java index b569c51ebf9..d7d5146db1f 100644 --- a/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java +++ b/src/main/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStats.java @@ -283,7 +283,7 @@ public class NodeStats extends NodeOperationResponse implements ToXContent { public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.field("timestamp", getTimestamp()); builder.field("name", getNode().name(), XContentBuilder.FieldCaseConversion.NONE); - builder.field("transport_address", getNode().address().toString()); + builder.field("transport_address", getNode().address().toString(), XContentBuilder.FieldCaseConversion.NONE); if (getHostname() != null) { builder.field("hostname", getHostname(), XContentBuilder.FieldCaseConversion.NONE); @@ -292,7 +292,7 @@ public class NodeStats extends NodeOperationResponse implements ToXContent { if (!getNode().attributes().isEmpty()) { builder.startObject("attributes"); for (Map.Entry attr : getNode().attributes().entrySet()) { - builder.field(attr.getKey(), attr.getValue()); + builder.field(attr.getKey(), attr.getValue(), XContentBuilder.FieldCaseConversion.NONE); } builder.endObject(); } diff --git a/src/main/java/org/elasticsearch/monitor/fs/FsStats.java b/src/main/java/org/elasticsearch/monitor/fs/FsStats.java index c4a332f5abb..017da6aef44 100644 --- a/src/main/java/org/elasticsearch/monitor/fs/FsStats.java +++ b/src/main/java/org/elasticsearch/monitor/fs/FsStats.java @@ -208,12 +208,12 @@ public class FsStats implements Iterable, Streamable, ToXContent { builder.startArray(Fields.DATA); for (Info info : infos) { builder.startObject(); - builder.field(Fields.PATH, info.path); + builder.field(Fields.PATH, info.path, XContentBuilder.FieldCaseConversion.NONE); if (info.mount != null) { - builder.field(Fields.MOUNT, info.mount); + builder.field(Fields.MOUNT, info.mount, XContentBuilder.FieldCaseConversion.NONE); } if (info.dev != null) { - builder.field(Fields.DEV, info.dev); + builder.field(Fields.DEV, info.dev, XContentBuilder.FieldCaseConversion.NONE); } if (info.total != -1) {