Switch SqlGetIndicesAction after merge

Merging picked up a change that starts to migrate away from Streamable
and we have to handle it.

Original commit: elastic/x-pack-elasticsearch@fa3489e128
This commit is contained in:
Nik Everett 2017-09-20 12:29:42 -04:00
parent 2df8b0c144
commit b8f5720283
2 changed files with 10 additions and 14 deletions

View File

@ -77,9 +77,8 @@ public class SqlGetIndicesAction
this.indices = indices; this.indices = indices;
} }
@Override Request(StreamInput in) throws IOException {
public void readFrom(StreamInput in) throws IOException { super(in);
super.readFrom(in);
indicesOptions = IndicesOptions.readIndicesOptions(in); indicesOptions = IndicesOptions.readIndicesOptions(in);
indices = in.readStringArray(); indices = in.readStringArray();
} }
@ -190,7 +189,7 @@ public class SqlGetIndicesAction
ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters, ClusterService clusterService, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver, CatalogHolder catalog, SqlLicenseChecker licenseChecker) { IndexNameExpressionResolver indexNameExpressionResolver, CatalogHolder catalog, SqlLicenseChecker licenseChecker) {
super(settings, NAME, transportService, clusterService, threadPool, actionFilters, super(settings, NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, Request::new); Request::new, indexNameExpressionResolver);
this.catalogSupplier = catalog.catalogSupplier; this.catalogSupplier = catalog.catalogSupplier;
this.licenseChecker = licenseChecker; this.licenseChecker = licenseChecker;
} }

View File

@ -6,16 +6,17 @@
package org.elasticsearch.xpack.sql.plugin; package org.elasticsearch.xpack.sql.plugin;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.io.stream.Writeable.Reader;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskId;
import org.elasticsearch.test.AbstractStreamableTestCase; import org.elasticsearch.test.AbstractWireSerializingTestCase;
import org.elasticsearch.test.EqualsHashCodeTestUtils.MutateFunction;
import org.elasticsearch.xpack.sql.plugin.SqlGetIndicesAction.Request; import org.elasticsearch.xpack.sql.plugin.SqlGetIndicesAction.Request;
import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import java.util.function.Supplier; import java.util.function.Supplier;
public class SqlGetIndicesRequestTests extends AbstractStreamableTestCase<SqlGetIndicesAction.Request> { public class SqlGetIndicesRequestTests extends AbstractWireSerializingTestCase<SqlGetIndicesAction.Request> {
@Override @Override
protected Request createTestInstance() { protected Request createTestInstance() {
Request request = new Request(randomIndicesOptions(), randomIndices()); Request request = new Request(randomIndicesOptions(), randomIndices());
@ -26,16 +27,12 @@ public class SqlGetIndicesRequestTests extends AbstractStreamableTestCase<SqlGet
} }
@Override @Override
protected Request createBlankInstance() { protected Reader<Request> instanceReader() {
return new Request(); return Request::new;
} }
@Override @Override
protected MutateFunction<Request> getMutateFunction() { protected Request mutateInstance(Request request) throws IOException {
return SqlGetIndicesRequestTests::mutate;
}
private static Request mutate(Request request) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
Supplier<Request> supplier = randomFrom( Supplier<Request> supplier = randomFrom(
() -> { () -> {