Skip to content

Commit 06c7c4a

Browse files
committed
thrift definition params is conflict with c#'s keyword, rename to parameters, closes #392.
1 parent f66f021 commit 06c7c4a

File tree

5 files changed

+61
-79
lines changed

5 files changed

+61
-79
lines changed

.idea/modules/plugin-transport-thrift.iml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins/transport/thrift/elasticsearch.thrift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ enum Method {
1717
struct RestRequest {
1818
1: required Method method,
1919
2: required string uri
20-
3: optional map<string, string> params
20+
3: optional map<string, string> parameters
2121
4: optional map<string, string> headers
2222
5: optional binary body
2323
}

plugins/transport/thrift/src/main/gen-java/org/elasticsearch/thrift/Rest.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
/*
2-
* Licensed to Elastic Search and Shay Banon under one
3-
* or more contributor license agreements. See the NOTICE file
4-
* distributed with this work for additional information
5-
* regarding copyright ownership. Elastic Search licenses this
6-
* file to you under the Apache License, Version 2.0 (the
7-
* "License"); you may not use this file except in compliance
8-
* with the License. You may obtain a copy of the License at
9-
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
11-
*
12-
* Unless required by applicable law or agreed to in writing,
13-
* software distributed under the License is distributed on an
14-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15-
* KIND, either express or implied. See the License for the
16-
* specific language governing permissions and limitations
17-
* under the License.
18-
*/
19-
201
/**
212
* Autogenerated by Thrift
223
*

plugins/transport/thrift/src/main/gen-java/org/elasticsearch/thrift/RestRequest.java

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class RestRequest implements TBase<RestRequest, RestRequest._Fields>, jav
2020

2121
private static final TField METHOD_FIELD_DESC = new TField("method", TType.I32, (short) 1);
2222
private static final TField URI_FIELD_DESC = new TField("uri", TType.STRING, (short) 2);
23-
private static final TField PARAMS_FIELD_DESC = new TField("params", TType.MAP, (short) 3);
23+
private static final TField PARAMETERS_FIELD_DESC = new TField("parameters", TType.MAP, (short) 3);
2424
private static final TField HEADERS_FIELD_DESC = new TField("headers", TType.MAP, (short) 4);
2525
private static final TField BODY_FIELD_DESC = new TField("body", TType.STRING, (short) 5);
2626

@@ -29,7 +29,7 @@ public class RestRequest implements TBase<RestRequest, RestRequest._Fields>, jav
2929
*/
3030
public Method method;
3131
public String uri;
32-
public Map<String, String> params;
32+
public Map<String, String> parameters;
3333
public Map<String, String> headers;
3434
public ByteBuffer body;
3535

@@ -42,7 +42,7 @@ public enum _Fields implements TFieldIdEnum {
4242
*/
4343
METHOD((short) 1, "method"),
4444
URI((short) 2, "uri"),
45-
PARAMS((short) 3, "params"),
45+
PARAMETERS((short) 3, "parameters"),
4646
HEADERS((short) 4, "headers"),
4747
BODY((short) 5, "body");
4848

@@ -63,8 +63,8 @@ public static _Fields findByThriftId(int fieldId) {
6363
return METHOD;
6464
case 2: // URI
6565
return URI;
66-
case 3: // PARAMS
67-
return PARAMS;
66+
case 3: // PARAMETERS
67+
return PARAMETERS;
6868
case 4: // HEADERS
6969
return HEADERS;
7070
case 5: // BODY
@@ -118,7 +118,7 @@ public String getFieldName() {
118118
new EnumMetaData(TType.ENUM, Method.class)));
119119
tmpMap.put(_Fields.URI, new FieldMetaData("uri", TFieldRequirementType.REQUIRED,
120120
new FieldValueMetaData(TType.STRING)));
121-
tmpMap.put(_Fields.PARAMS, new FieldMetaData("params", TFieldRequirementType.OPTIONAL,
121+
tmpMap.put(_Fields.PARAMETERS, new FieldMetaData("parameters", TFieldRequirementType.OPTIONAL,
122122
new MapMetaData(TType.MAP,
123123
new FieldValueMetaData(TType.STRING),
124124
new FieldValueMetaData(TType.STRING))));
@@ -153,20 +153,20 @@ public RestRequest(RestRequest other) {
153153
if (other.isSetUri()) {
154154
this.uri = other.uri;
155155
}
156-
if (other.isSetParams()) {
157-
Map<String, String> __this__params = new HashMap<String, String>();
158-
for (Map.Entry<String, String> other_element : other.params.entrySet()) {
156+
if (other.isSetParameters()) {
157+
Map<String, String> __this__parameters = new HashMap<String, String>();
158+
for (Map.Entry<String, String> other_element : other.parameters.entrySet()) {
159159

160160
String other_element_key = other_element.getKey();
161161
String other_element_value = other_element.getValue();
162162

163-
String __this__params_copy_key = other_element_key;
163+
String __this__parameters_copy_key = other_element_key;
164164

165-
String __this__params_copy_value = other_element_value;
165+
String __this__parameters_copy_value = other_element_value;
166166

167-
__this__params.put(__this__params_copy_key, __this__params_copy_value);
167+
__this__parameters.put(__this__parameters_copy_key, __this__parameters_copy_value);
168168
}
169-
this.params = __this__params;
169+
this.parameters = __this__parameters;
170170
}
171171
if (other.isSetHeaders()) {
172172
Map<String, String> __this__headers = new HashMap<String, String>();
@@ -202,7 +202,7 @@ public RestRequest clone() {
202202
public void clear() {
203203
this.method = null;
204204
this.uri = null;
205-
this.params = null;
205+
this.parameters = null;
206206
this.headers = null;
207207
this.body = null;
208208
}
@@ -265,40 +265,40 @@ public void setUriIsSet(boolean value) {
265265
}
266266
}
267267

268-
public int getParamsSize() {
269-
return (this.params == null) ? 0 : this.params.size();
268+
public int getParametersSize() {
269+
return (this.parameters == null) ? 0 : this.parameters.size();
270270
}
271271

272-
public void putToParams(String key, String val) {
273-
if (this.params == null) {
274-
this.params = new HashMap<String, String>();
272+
public void putToParameters(String key, String val) {
273+
if (this.parameters == null) {
274+
this.parameters = new HashMap<String, String>();
275275
}
276-
this.params.put(key, val);
276+
this.parameters.put(key, val);
277277
}
278278

279-
public Map<String, String> getParams() {
280-
return this.params;
279+
public Map<String, String> getParameters() {
280+
return this.parameters;
281281
}
282282

283-
public RestRequest setParams(Map<String, String> params) {
284-
this.params = params;
283+
public RestRequest setParameters(Map<String, String> parameters) {
284+
this.parameters = parameters;
285285
return this;
286286
}
287287

288-
public void unsetParams() {
289-
this.params = null;
288+
public void unsetParameters() {
289+
this.parameters = null;
290290
}
291291

292292
/**
293-
* Returns true if field params is set (has been asigned a value) and false otherwise
293+
* Returns true if field parameters is set (has been asigned a value) and false otherwise
294294
*/
295-
public boolean isSetParams() {
296-
return this.params != null;
295+
public boolean isSetParameters() {
296+
return this.parameters != null;
297297
}
298298

299-
public void setParamsIsSet(boolean value) {
299+
public void setParametersIsSet(boolean value) {
300300
if (!value) {
301-
this.params = null;
301+
this.parameters = null;
302302
}
303303
}
304304

@@ -383,11 +383,11 @@ public void setFieldValue(_Fields field, Object value) {
383383
}
384384
break;
385385

386-
case PARAMS:
386+
case PARAMETERS:
387387
if (value == null) {
388-
unsetParams();
388+
unsetParameters();
389389
} else {
390-
setParams((Map<String, String>) value);
390+
setParameters((Map<String, String>) value);
391391
}
392392
break;
393393

@@ -422,8 +422,8 @@ public Object getFieldValue(_Fields field) {
422422
case URI:
423423
return getUri();
424424

425-
case PARAMS:
426-
return getParams();
425+
case PARAMETERS:
426+
return getParameters();
427427

428428
case HEADERS:
429429
return getHeaders();
@@ -448,8 +448,8 @@ public boolean isSet(_Fields field) {
448448
return isSetMethod();
449449
case URI:
450450
return isSetUri();
451-
case PARAMS:
452-
return isSetParams();
451+
case PARAMETERS:
452+
return isSetParameters();
453453
case HEADERS:
454454
return isSetHeaders();
455455
case BODY:
@@ -493,12 +493,12 @@ public boolean equals(RestRequest that) {
493493
return false;
494494
}
495495

496-
boolean this_present_params = true && this.isSetParams();
497-
boolean that_present_params = true && that.isSetParams();
498-
if (this_present_params || that_present_params) {
499-
if (!(this_present_params && that_present_params))
496+
boolean this_present_parameters = true && this.isSetParameters();
497+
boolean that_present_parameters = true && that.isSetParameters();
498+
if (this_present_parameters || that_present_parameters) {
499+
if (!(this_present_parameters && that_present_parameters))
500500
return false;
501-
if (!this.params.equals(that.params))
501+
if (!this.parameters.equals(that.parameters))
502502
return false;
503503
}
504504

@@ -556,12 +556,12 @@ public int compareTo(RestRequest other) {
556556
return lastComparison;
557557
}
558558
}
559-
lastComparison = Boolean.valueOf(isSetParams()).compareTo(typedOther.isSetParams());
559+
lastComparison = Boolean.valueOf(isSetParameters()).compareTo(typedOther.isSetParameters());
560560
if (lastComparison != 0) {
561561
return lastComparison;
562562
}
563-
if (isSetParams()) {
564-
lastComparison = TBaseHelper.compareTo(this.params, typedOther.params);
563+
if (isSetParameters()) {
564+
lastComparison = TBaseHelper.compareTo(this.parameters, typedOther.parameters);
565565
if (lastComparison != 0) {
566566
return lastComparison;
567567
}
@@ -612,17 +612,17 @@ public void read(TProtocol iprot) throws TException {
612612
TProtocolUtil.skip(iprot, field.type);
613613
}
614614
break;
615-
case 3: // PARAMS
615+
case 3: // PARAMETERS
616616
if (field.type == TType.MAP) {
617617
{
618618
TMap _map0 = iprot.readMapBegin();
619-
this.params = new HashMap<String, String>(2 * _map0.size);
619+
this.parameters = new HashMap<String, String>(2 * _map0.size);
620620
for (int _i1 = 0; _i1 < _map0.size; ++_i1) {
621621
String _key2;
622622
String _val3;
623623
_key2 = iprot.readString();
624624
_val3 = iprot.readString();
625-
this.params.put(_key2, _val3);
625+
this.parameters.put(_key2, _val3);
626626
}
627627
iprot.readMapEnd();
628628
}
@@ -680,12 +680,12 @@ public void write(TProtocol oprot) throws TException {
680680
oprot.writeString(this.uri);
681681
oprot.writeFieldEnd();
682682
}
683-
if (this.params != null) {
684-
if (isSetParams()) {
685-
oprot.writeFieldBegin(PARAMS_FIELD_DESC);
683+
if (this.parameters != null) {
684+
if (isSetParameters()) {
685+
oprot.writeFieldBegin(PARAMETERS_FIELD_DESC);
686686
{
687-
oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.params.size()));
688-
for (Map.Entry<String, String> _iter8 : this.params.entrySet()) {
687+
oprot.writeMapBegin(new TMap(TType.STRING, TType.STRING, this.parameters.size()));
688+
for (Map.Entry<String, String> _iter8 : this.parameters.entrySet()) {
689689
oprot.writeString(_iter8.getKey());
690690
oprot.writeString(_iter8.getValue());
691691
}
@@ -739,13 +739,13 @@ public String toString() {
739739
sb.append(this.uri);
740740
}
741741
first = false;
742-
if (isSetParams()) {
742+
if (isSetParameters()) {
743743
if (!first) sb.append(", ");
744-
sb.append("params:");
745-
if (this.params == null) {
744+
sb.append("parameters:");
745+
if (this.parameters == null) {
746746
sb.append("null");
747747
} else {
748-
sb.append(this.params);
748+
sb.append(this.parameters);
749749
}
750750
first = false;
751751
}

plugins/transport/thrift/src/main/java/org/elasticsearch/thrift/ThriftRestRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ThriftRestRequest extends AbstractRestRequest implements org.elasti
4141

4242
public ThriftRestRequest(org.elasticsearch.thrift.RestRequest request) {
4343
this.request = request;
44-
this.params = request.getParams() == null ? new HashMap<String, String>() : request.getParams();
44+
this.params = request.getParameters() == null ? new HashMap<String, String>() : request.getParameters();
4545

4646
int pathEndPos = request.getUri().indexOf('?');
4747
if (pathEndPos < 0) {

0 commit comments

Comments
 (0)