Minor fix: renaming read/writeNamedWritableList() to read/writeNamedWriteabelList() for consistency
The method for reading and writing single instances is called `read/writeNamedWriteable()`, so the list version should be spelled the same.
This commit is contained in:
parent
7653376ece
commit
b2606d98df
|
@ -515,7 +515,7 @@ public abstract class StreamInput extends InputStream {
|
||||||
* Reads a list of {@link NamedWriteable} from the current stream, by first reading its size and then
|
* Reads a list of {@link NamedWriteable} from the current stream, by first reading its size and then
|
||||||
* reading the individual objects using {@link #readNamedWriteable()}.
|
* reading the individual objects using {@link #readNamedWriteable()}.
|
||||||
*/
|
*/
|
||||||
public <C> List<C> readNamedWritableList() throws IOException {
|
public <C> List<C> readNamedWriteableList() throws IOException {
|
||||||
List<C> list = new ArrayList<>();
|
List<C> list = new ArrayList<>();
|
||||||
int size = readInt();
|
int size = readInt();
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
|
|
|
@ -463,7 +463,7 @@ public abstract class StreamOutput extends OutputStream {
|
||||||
* Writes a list of {@link NamedWriteable} to the current stream, by first writing its size and then iterating over the objects
|
* Writes a list of {@link NamedWriteable} to the current stream, by first writing its size and then iterating over the objects
|
||||||
* in the list
|
* in the list
|
||||||
*/
|
*/
|
||||||
public void writeNamedWritableList(List<? extends NamedWriteable> list) throws IOException {
|
public void writeNamedWriteableList(List<? extends NamedWriteable> list) throws IOException {
|
||||||
writeInt(list.size());
|
writeInt(list.size());
|
||||||
for (NamedWriteable obj : list) {
|
for (NamedWriteable obj : list) {
|
||||||
writeNamedWriteable(obj);
|
writeNamedWriteable(obj);
|
||||||
|
|
|
@ -144,7 +144,7 @@ public class AndQueryBuilder extends AbstractQueryBuilder<AndQueryBuilder> {
|
||||||
@Override
|
@Override
|
||||||
public AndQueryBuilder readFrom(StreamInput in) throws IOException {
|
public AndQueryBuilder readFrom(StreamInput in) throws IOException {
|
||||||
AndQueryBuilder andQueryBuilder = new AndQueryBuilder();
|
AndQueryBuilder andQueryBuilder = new AndQueryBuilder();
|
||||||
List<QueryBuilder> queryBuilders = in.readNamedWritableList();
|
List<QueryBuilder> queryBuilders = in.readNamedWriteableList();
|
||||||
for (QueryBuilder queryBuilder : queryBuilders) {
|
for (QueryBuilder queryBuilder : queryBuilders) {
|
||||||
andQueryBuilder.add(queryBuilder);
|
andQueryBuilder.add(queryBuilder);
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ public class AndQueryBuilder extends AbstractQueryBuilder<AndQueryBuilder> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
out.writeNamedWritableList(this.filters);
|
out.writeNamedWriteableList(this.filters);
|
||||||
out.writeOptionalString(queryName);
|
out.writeOptionalString(queryName);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -350,13 +350,13 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> imp
|
||||||
@Override
|
@Override
|
||||||
public BoolQueryBuilder readFrom(StreamInput in) throws IOException {
|
public BoolQueryBuilder readFrom(StreamInput in) throws IOException {
|
||||||
BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();
|
BoolQueryBuilder boolQueryBuilder = new BoolQueryBuilder();
|
||||||
List<QueryBuilder> queryBuilders = in.readNamedWritableList();
|
List<QueryBuilder> queryBuilders = in.readNamedWriteableList();
|
||||||
boolQueryBuilder.mustClauses.addAll(queryBuilders);
|
boolQueryBuilder.mustClauses.addAll(queryBuilders);
|
||||||
queryBuilders = in.readNamedWritableList();
|
queryBuilders = in.readNamedWriteableList();
|
||||||
boolQueryBuilder.mustNotClauses.addAll(queryBuilders);
|
boolQueryBuilder.mustNotClauses.addAll(queryBuilders);
|
||||||
queryBuilders = in.readNamedWritableList();
|
queryBuilders = in.readNamedWriteableList();
|
||||||
boolQueryBuilder.shouldClauses.addAll(queryBuilders);
|
boolQueryBuilder.shouldClauses.addAll(queryBuilders);
|
||||||
queryBuilders = in.readNamedWritableList();
|
queryBuilders = in.readNamedWriteableList();
|
||||||
boolQueryBuilder.filterClauses.addAll(queryBuilders);
|
boolQueryBuilder.filterClauses.addAll(queryBuilders);
|
||||||
boolQueryBuilder.boost = in.readFloat();
|
boolQueryBuilder.boost = in.readFloat();
|
||||||
boolQueryBuilder.adjustPureNegative = in.readBoolean();
|
boolQueryBuilder.adjustPureNegative = in.readBoolean();
|
||||||
|
@ -369,10 +369,10 @@ public class BoolQueryBuilder extends AbstractQueryBuilder<BoolQueryBuilder> imp
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
out.writeNamedWritableList(this.mustClauses);
|
out.writeNamedWriteableList(this.mustClauses);
|
||||||
out.writeNamedWritableList(this.mustNotClauses);
|
out.writeNamedWriteableList(this.mustNotClauses);
|
||||||
out.writeNamedWritableList(this.shouldClauses);
|
out.writeNamedWriteableList(this.shouldClauses);
|
||||||
out.writeNamedWritableList(this.filterClauses);
|
out.writeNamedWriteableList(this.filterClauses);
|
||||||
out.writeFloat(this.boost);
|
out.writeFloat(this.boost);
|
||||||
out.writeBoolean(this.adjustPureNegative);
|
out.writeBoolean(this.adjustPureNegative);
|
||||||
out.writeBoolean(this.disableCoord);
|
out.writeBoolean(this.disableCoord);
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class DisMaxQueryBuilder extends AbstractQueryBuilder<DisMaxQueryBuilder>
|
||||||
@Override
|
@Override
|
||||||
public DisMaxQueryBuilder readFrom(StreamInput in) throws IOException {
|
public DisMaxQueryBuilder readFrom(StreamInput in) throws IOException {
|
||||||
DisMaxQueryBuilder disMax = new DisMaxQueryBuilder();
|
DisMaxQueryBuilder disMax = new DisMaxQueryBuilder();
|
||||||
List<QueryBuilder> queryBuilders = in.readNamedWritableList();
|
List<QueryBuilder> queryBuilders = in.readNamedWriteableList();
|
||||||
disMax.queries.addAll(queryBuilders);
|
disMax.queries.addAll(queryBuilders);
|
||||||
disMax.tieBreaker = in.readFloat();
|
disMax.tieBreaker = in.readFloat();
|
||||||
disMax.queryName = in.readOptionalString();
|
disMax.queryName = in.readOptionalString();
|
||||||
|
@ -169,7 +169,7 @@ public class DisMaxQueryBuilder extends AbstractQueryBuilder<DisMaxQueryBuilder>
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
out.writeNamedWritableList(this.queries);
|
out.writeNamedWriteableList(this.queries);
|
||||||
out.writeFloat(tieBreaker);
|
out.writeFloat(tieBreaker);
|
||||||
out.writeOptionalString(queryName);
|
out.writeOptionalString(queryName);
|
||||||
out.writeFloat(boost);
|
out.writeFloat(boost);
|
||||||
|
|
|
@ -143,7 +143,7 @@ public class OrQueryBuilder extends AbstractQueryBuilder<OrQueryBuilder> {
|
||||||
@Override
|
@Override
|
||||||
public OrQueryBuilder readFrom(StreamInput in) throws IOException {
|
public OrQueryBuilder readFrom(StreamInput in) throws IOException {
|
||||||
OrQueryBuilder orQueryBuilder = new OrQueryBuilder();
|
OrQueryBuilder orQueryBuilder = new OrQueryBuilder();
|
||||||
List<QueryBuilder> queryBuilders = in.readNamedWritableList();
|
List<QueryBuilder> queryBuilders = in.readNamedWriteableList();
|
||||||
for (QueryBuilder queryBuilder : queryBuilders) {
|
for (QueryBuilder queryBuilder : queryBuilders) {
|
||||||
orQueryBuilder.add(queryBuilder);
|
orQueryBuilder.add(queryBuilder);
|
||||||
}
|
}
|
||||||
|
@ -154,7 +154,7 @@ public class OrQueryBuilder extends AbstractQueryBuilder<OrQueryBuilder> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
out.writeNamedWritableList(this.filters);
|
out.writeNamedWriteableList(this.filters);
|
||||||
out.writeOptionalString(queryName);
|
out.writeOptionalString(queryName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue