fix typo and make parseIndexConstraints method static in FieldStatsRequest
This commit is contained in:
parent
50b31ce620
commit
2f360ecc16
|
@ -90,7 +90,7 @@ public class FieldStatsRequest extends BroadcastRequest<FieldStatsRequest> {
|
||||||
break;
|
break;
|
||||||
case START_OBJECT:
|
case START_OBJECT:
|
||||||
if ("index_constraints".equals(fieldName)) {
|
if ("index_constraints".equals(fieldName)) {
|
||||||
parseIndexContraints(indexConstraints, parser);
|
parseIndexConstraints(indexConstraints, parser);
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalArgumentException("unknown field [" + fieldName + "]");
|
throw new IllegalArgumentException("unknown field [" + fieldName + "]");
|
||||||
}
|
}
|
||||||
|
@ -117,8 +117,8 @@ public class FieldStatsRequest extends BroadcastRequest<FieldStatsRequest> {
|
||||||
this.indexConstraints = indexConstraints.toArray(new IndexConstraint[indexConstraints.size()]);
|
this.indexConstraints = indexConstraints.toArray(new IndexConstraint[indexConstraints.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseIndexContraints(List<IndexConstraint> indexConstraints,
|
private static void parseIndexConstraints(List<IndexConstraint> indexConstraints,
|
||||||
XContentParser parser) throws IOException {
|
XContentParser parser) throws IOException {
|
||||||
Token token = parser.currentToken();
|
Token token = parser.currentToken();
|
||||||
assert token == Token.START_OBJECT;
|
assert token == Token.START_OBJECT;
|
||||||
String field = null;
|
String field = null;
|
||||||
|
@ -213,5 +213,4 @@ public class FieldStatsRequest extends BroadcastRequest<FieldStatsRequest> {
|
||||||
out.writeString(level);
|
out.writeString(level);
|
||||||
out.writeBoolean(useCache);
|
out.writeBoolean(useCache);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue