diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index 12533a389b5..4a9df6c9ccc 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -17,7 +17,7 @@ dependencies { compileOnly project(path: ':plugins:transport-nio', configuration: 'runtime') testCompile project(path: xpackModule('monitoring')) - testCompile project(path: xpackModule('sql:sql-proto')) + testCompile project(path: xpackModule('sql:sql-action')) testCompile project(path: xpackModule('core'), configuration: 'testArtifacts') diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java index 11ee0a6a001..9e33e145e24 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/AuthorizationServiceTests.java @@ -122,8 +122,8 @@ import org.elasticsearch.xpack.core.security.user.XPackUser; import org.elasticsearch.xpack.security.audit.AuditTrailService; import org.elasticsearch.xpack.security.authc.esnative.ReservedRealm; import org.elasticsearch.xpack.security.authz.store.CompositeRolesStore; -import org.elasticsearch.xpack.sql.plugin.SqlQueryAction; -import org.elasticsearch.xpack.sql.plugin.SqlQueryRequest; +import org.elasticsearch.xpack.sql.action.SqlQueryAction; +import org.elasticsearch.xpack.sql.action.SqlQueryRequest; import org.junit.Before; import org.mockito.Mockito; diff --git a/x-pack/plugin/sql/build.gradle b/x-pack/plugin/sql/build.gradle index 19dd1a08ec6..436837e85b4 100644 --- a/x-pack/plugin/sql/build.gradle +++ b/x-pack/plugin/sql/build.gradle @@ -24,7 +24,7 @@ dependencies { // exclude ASM to not affect featureAware task on Java 10+ exclude group: "org.ow2.asm" } - compile project('sql-proto') + compile project('sql-action') compile "org.elasticsearch.plugin:aggs-matrix-stats-client:${version}" compile "org.antlr:antlr4-runtime:4.5.3" testCompile "org.elasticsearch.test:framework:${version}" diff --git a/x-pack/plugin/sql/jdbc/build.gradle b/x-pack/plugin/sql/jdbc/build.gradle index e383e71cd4c..ca8d966a031 100644 --- a/x-pack/plugin/sql/jdbc/build.gradle +++ b/x-pack/plugin/sql/jdbc/build.gradle @@ -24,10 +24,10 @@ forbiddenApisMain { } dependencies { - compile (xpackProject('plugin:sql:sql-shared-client')) { + compile (xpackProject('plugin:sql:sql-client')) { transitive = false } - compile (xpackProject('plugin:sql:sql-shared-proto')) { + compile (xpackProject('plugin:sql:sql-proto')) { transitive = false } compile (project(':libs:x-content')) { @@ -39,12 +39,12 @@ dependencies { } dependencyLicenses { - mapping from: /sql-shared-proto.*/, to: 'elasticsearch' - mapping from: /sql-shared-client.*/, to: 'elasticsearch' + mapping from: /sql-proto.*/, to: 'elasticsearch' + mapping from: /sql-client.*/, to: 'elasticsearch' mapping from: /jackson-.*/, to: 'jackson' mapping from: /elasticsearch-core.*/, to: 'elasticsearch' - ignoreSha 'sql-shared-proto' - ignoreSha 'sql-shared-client' + ignoreSha 'sql-proto' + ignoreSha 'sql-client' ignoreSha 'elasticsearch' } diff --git a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/debug/Debug.java b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/debug/Debug.java index 41bc80c1040..ccba7429a4b 100644 --- a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/debug/Debug.java +++ b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/debug/Debug.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.xpack.sql.jdbc.debug; -import org.elasticsearch.xpack.sql.client.shared.SuppressForbidden; +import org.elasticsearch.xpack.sql.client.SuppressForbidden; import org.elasticsearch.xpack.sql.jdbc.JdbcException; import org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcConfiguration; @@ -39,10 +39,10 @@ import javax.sql.DataSource; * being global and not working well with encoding (hence why {@link DriverManager#getLogWriter()} was introduced) * and was changed again through {@link DataSource#getLogWriter()}. * However by then the damage was done and most drivers don't use either and have their own logging implementation. - * + * * This class tries to cater to both audiences - use the legacy, Writer way if needed though strive to use the * proper typical approach, that of specifying intention and output (file) in the URL. - * + * * For this reason the {@link System#out} and {@link System#err} are being refered in this class though are used only * when needed. */ @@ -65,7 +65,7 @@ public final class Debug { * {@link DriverManager#setLogWriter(PrintWriter)} and {@link DataSource#setLogWriter(PrintWriter)}. * The former is the 'legacy' way, having a global impact on all drivers while the latter allows per * instance configuration. - * + * * As both approaches are not widely used, Debug will take the principle of least surprise and pick its * own configuration first; if that does not exist it will fallback to the managed approaches (assuming they * are specified, otherwise logging is simply disabled). @@ -235,4 +235,4 @@ public final class Debug { private static PrintStream stderr() { return System.err; } -} \ No newline at end of file +} diff --git a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/debug/DebugLog.java b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/debug/DebugLog.java index 28444c1f8ee..e0962c5dcc1 100644 --- a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/debug/DebugLog.java +++ b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/debug/DebugLog.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.xpack.sql.jdbc.debug; -import org.elasticsearch.xpack.sql.client.shared.StringUtils; +import org.elasticsearch.xpack.sql.client.StringUtils; import java.io.PrintWriter; import java.lang.reflect.Array; @@ -56,16 +56,16 @@ final class DebugLog { t.printStackTrace(print); print.flush(); } - + private static String array(Object[] a) { if (a == null || a.length == 0) { - return StringUtils.EMPTY; + return StringUtils.EMPTY; } if (a.length == 1) { return handleArray(a[0]); } - + StringBuilder b = new StringBuilder(); int iMax = a.length - 1; for (int i = 0; ; i++) { @@ -97,4 +97,4 @@ final class DebugLog { } return String.valueOf(o); } -} \ No newline at end of file +} diff --git a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcConfiguration.java b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcConfiguration.java index 1d90c8c08ca..a2ab9060b5a 100644 --- a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcConfiguration.java +++ b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcConfiguration.java @@ -5,9 +5,9 @@ */ package org.elasticsearch.xpack.sql.jdbc.jdbc; -import org.elasticsearch.xpack.sql.client.shared.ConnectionConfiguration; -import org.elasticsearch.xpack.sql.client.shared.StringUtils; -import org.elasticsearch.xpack.sql.client.shared.Version; +import org.elasticsearch.xpack.sql.client.ConnectionConfiguration; +import org.elasticsearch.xpack.sql.client.StringUtils; +import org.elasticsearch.xpack.sql.client.Version; import org.elasticsearch.xpack.sql.jdbc.JdbcSQLException; import java.net.URI; @@ -22,8 +22,8 @@ import java.util.Set; import java.util.TimeZone; import java.util.concurrent.TimeUnit; -import static org.elasticsearch.xpack.sql.client.shared.UriUtils.parseURI; -import static org.elasticsearch.xpack.sql.client.shared.UriUtils.removeQuery; +import static org.elasticsearch.xpack.sql.client.UriUtils.parseURI; +import static org.elasticsearch.xpack.sql.client.UriUtils.removeQuery; /** / Supports the following syntax diff --git a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcDatabaseMetaData.java b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcDatabaseMetaData.java index fbbb030bc49..5cb63a33763 100644 --- a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcDatabaseMetaData.java +++ b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcDatabaseMetaData.java @@ -5,8 +5,8 @@ */ package org.elasticsearch.xpack.sql.jdbc.jdbc; -import org.elasticsearch.xpack.sql.client.shared.ObjectUtils; -import org.elasticsearch.xpack.sql.client.shared.Version; +import org.elasticsearch.xpack.sql.client.ObjectUtils; +import org.elasticsearch.xpack.sql.client.Version; import org.elasticsearch.xpack.sql.jdbc.JdbcSQLException; import org.elasticsearch.xpack.sql.jdbc.net.client.Cursor; import org.elasticsearch.xpack.sql.jdbc.net.protocol.ColumnInfo; diff --git a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcDriver.java b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcDriver.java index 3fdb002a0aa..2b68026b678 100644 --- a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcDriver.java +++ b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbc/JdbcDriver.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.xpack.sql.jdbc.jdbc; -import org.elasticsearch.xpack.sql.client.shared.Version; +import org.elasticsearch.xpack.sql.client.Version; import org.elasticsearch.xpack.sql.jdbc.JdbcSQLException; import org.elasticsearch.xpack.sql.jdbc.debug.Debug; @@ -127,4 +127,4 @@ public class JdbcDriver implements java.sql.Driver { private void close() { Debug.close(); } -} \ No newline at end of file +} diff --git a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbcx/JdbcDataSource.java b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbcx/JdbcDataSource.java index 595cd893ebc..bd2776e1335 100644 --- a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbcx/JdbcDataSource.java +++ b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/jdbcx/JdbcDataSource.java @@ -5,11 +5,11 @@ */ package org.elasticsearch.xpack.sql.jdbc.jdbcx; -import org.elasticsearch.xpack.sql.client.shared.ConnectionConfiguration; +import org.elasticsearch.xpack.sql.client.ConnectionConfiguration; import org.elasticsearch.xpack.sql.jdbc.debug.Debug; import org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcConfiguration; import org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcConnection; -import org.elasticsearch.xpack.sql.client.shared.Version; +import org.elasticsearch.xpack.sql.client.Version; import java.io.PrintWriter; import java.sql.Connection; @@ -117,4 +117,4 @@ public class JdbcDataSource implements DataSource, Wrapper { } throw new SQLException(); } -} \ No newline at end of file +} diff --git a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/net/client/JdbcHttpClient.java b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/net/client/JdbcHttpClient.java index 17afc34efff..e32aadcd7fa 100644 --- a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/net/client/JdbcHttpClient.java +++ b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/net/client/JdbcHttpClient.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.sql.jdbc.net.client; import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.xpack.sql.client.HttpClient; -import org.elasticsearch.xpack.sql.client.shared.Version; +import org.elasticsearch.xpack.sql.client.Version; import org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcConfiguration; import org.elasticsearch.xpack.sql.jdbc.net.protocol.ColumnInfo; import org.elasticsearch.xpack.sql.jdbc.net.protocol.InfoResponse; @@ -23,7 +23,7 @@ import java.sql.SQLException; import java.util.List; import java.util.stream.Collectors; -import static org.elasticsearch.xpack.sql.client.shared.StringUtils.EMPTY; +import static org.elasticsearch.xpack.sql.client.StringUtils.EMPTY; /** * JDBC specific HTTP client. diff --git a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfigurationTests.java b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfigurationTests.java index e15d011e387..c7f2b50ace0 100644 --- a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfigurationTests.java +++ b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfigurationTests.java @@ -11,8 +11,8 @@ import org.elasticsearch.xpack.sql.jdbc.jdbc.JdbcConfiguration; import java.sql.SQLException; import java.util.Properties; -import static org.elasticsearch.xpack.sql.client.shared.ConnectionConfiguration.CONNECT_TIMEOUT; -import static org.elasticsearch.xpack.sql.client.shared.ConnectionConfiguration.PAGE_TIMEOUT; +import static org.elasticsearch.xpack.sql.client.ConnectionConfiguration.CONNECT_TIMEOUT; +import static org.elasticsearch.xpack.sql.client.ConnectionConfiguration.PAGE_TIMEOUT; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.is; diff --git a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/VersionTests.java b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/VersionTests.java index 82cd623f115..03986e59544 100644 --- a/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/VersionTests.java +++ b/x-pack/plugin/sql/jdbc/src/test/java/org/elasticsearch/xpack/sql/jdbc/VersionTests.java @@ -6,7 +6,7 @@ package org.elasticsearch.xpack.sql.jdbc; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.sql.client.shared.Version; +import org.elasticsearch.xpack.sql.client.Version; public class VersionTests extends ESTestCase { public void testVersionIsCurrent() { diff --git a/x-pack/plugin/sql/sql-action/build.gradle b/x-pack/plugin/sql/sql-action/build.gradle new file mode 100644 index 00000000000..d8805d2e3db --- /dev/null +++ b/x-pack/plugin/sql/sql-action/build.gradle @@ -0,0 +1,152 @@ + +/* + * This project contains transport-level requests and responses that are shared between x-pack plugin and qa tests + */ + +import org.elasticsearch.gradle.precommit.PrecommitTasks + +apply plugin: 'elasticsearch.build' + +description = 'Request and response objects shared by the cli, jdbc ' + + 'and the Elasticsearch plugin' + +dependencies { + /* We'd like to just depend on xcontent but there are some bits of + * :server that we rely on.... */ + compile (project(':server')) { + transitive = false + } + compile (project(':libs:core')) { + transitive = false + } + compile (project(':libs:x-content')) { + transitive = false + } + compile xpackProject('plugin:sql:sql-proto') + compile "org.apache.lucene:lucene-core:${versions.lucene}" + compile 'joda-time:joda-time:2.9.9' + runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" + runtime "org.apache.logging.log4j:log4j-api:${versions.log4j}" + runtime "org.apache.logging.log4j:log4j-core:${versions.log4j}" + + testCompile "org.elasticsearch.test:framework:${version}" +} + +forbiddenApisMain { + //sql does not depend on server, so only jdk signatures should be checked + signaturesURLs = [PrecommitTasks.getResource('/forbidden/jdk-signatures.txt')] +} + +dependencyLicenses { + mapping from: /elasticsearch-core.*/, to: 'elasticsearch' + mapping from: /jackson-.*/, to: 'jackson' + mapping from: /lucene-.*/, to: 'lucene' + ignoreSha 'elasticsearch' + ignoreSha 'elasticsearch-core' +} + +thirdPartyAudit.excludes = [ + 'com.fasterxml.jackson.dataformat.yaml.YAMLFactory', + 'com.fasterxml.jackson.dataformat.yaml.YAMLMapper', + + // from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml) + 'com.fasterxml.jackson.databind.ObjectMapper', + 'org.fusesource.jansi.Ansi', + 'org.fusesource.jansi.AnsiRenderer$Code', + + // from log4j + 'com.conversantmedia.util.concurrent.DisruptorBlockingQueue', + 'com.conversantmedia.util.concurrent.SpinPolicy', + 'com.fasterxml.jackson.annotation.JsonInclude$Include', + 'com.fasterxml.jackson.databind.DeserializationContext', + 'com.fasterxml.jackson.databind.DeserializationFeature', + 'com.fasterxml.jackson.databind.JsonMappingException', + 'com.fasterxml.jackson.databind.JsonNode', + 'com.fasterxml.jackson.databind.Module$SetupContext', + 'com.fasterxml.jackson.databind.ObjectReader', + 'com.fasterxml.jackson.databind.ObjectWriter', + 'com.fasterxml.jackson.databind.SerializerProvider', + 'com.fasterxml.jackson.databind.deser.std.StdDeserializer', + 'com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer', + 'com.fasterxml.jackson.databind.module.SimpleModule', + 'com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter', + 'com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider', + 'com.fasterxml.jackson.databind.ser.std.StdScalarSerializer', + 'com.fasterxml.jackson.databind.ser.std.StdSerializer', + 'com.fasterxml.jackson.dataformat.xml.JacksonXmlModule', + 'com.fasterxml.jackson.dataformat.xml.XmlMapper', + 'com.fasterxml.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter', + 'com.fasterxml.jackson.databind.node.JsonNodeFactory', + 'com.fasterxml.jackson.databind.node.ObjectNode', + 'com.lmax.disruptor.BlockingWaitStrategy', + 'com.lmax.disruptor.BusySpinWaitStrategy', + 'com.lmax.disruptor.EventFactory', + 'com.lmax.disruptor.EventTranslator', + 'com.lmax.disruptor.EventTranslatorTwoArg', + 'com.lmax.disruptor.EventTranslatorVararg', + 'com.lmax.disruptor.ExceptionHandler', + 'com.lmax.disruptor.LifecycleAware', + 'com.lmax.disruptor.RingBuffer', + 'com.lmax.disruptor.Sequence', + 'com.lmax.disruptor.SequenceReportingEventHandler', + 'com.lmax.disruptor.SleepingWaitStrategy', + 'com.lmax.disruptor.TimeoutBlockingWaitStrategy', + 'com.lmax.disruptor.WaitStrategy', + 'com.lmax.disruptor.YieldingWaitStrategy', + 'com.lmax.disruptor.dsl.Disruptor', + 'com.lmax.disruptor.dsl.ProducerType', + 'javax.jms.Connection', + 'javax.jms.ConnectionFactory', + 'javax.jms.Destination', + 'javax.jms.JMSException', + 'javax.jms.MapMessage', + 'javax.jms.Message', + 'javax.jms.MessageConsumer', + 'javax.jms.MessageProducer', + 'javax.jms.Session', + 'javax.mail.Authenticator', + 'javax.mail.Message$RecipientType', + 'javax.mail.PasswordAuthentication', + 'javax.mail.Session', + 'javax.mail.Transport', + 'javax.mail.internet.InternetAddress', + 'javax.mail.internet.InternetHeaders', + 'javax.mail.internet.MimeBodyPart', + 'javax.mail.internet.MimeMessage', + 'javax.mail.internet.MimeMultipart', + 'javax.mail.internet.MimeUtility', + 'javax.mail.util.ByteArrayDataSource', + 'javax.persistence.AttributeConverter', + 'javax.persistence.EntityManager', + 'javax.persistence.EntityManagerFactory', + 'javax.persistence.EntityTransaction', + 'javax.persistence.Persistence', + 'javax.persistence.PersistenceException', + 'org.apache.commons.compress.compressors.CompressorStreamFactory', + 'org.apache.commons.compress.utils.IOUtils', + 'org.apache.commons.csv.CSVFormat', + 'org.apache.commons.csv.QuoteMode', + 'org.apache.kafka.clients.producer.Callback', + 'org.apache.kafka.clients.producer.KafkaProducer', + 'org.apache.kafka.clients.producer.Producer', + 'org.apache.kafka.clients.producer.ProducerRecord', + 'org.apache.kafka.clients.producer.RecordMetadata', + 'org.codehaus.stax2.XMLStreamWriter2', + 'org.jctools.queues.MessagePassingQueue$Consumer', + 'org.jctools.queues.MpscArrayQueue', + 'org.osgi.framework.AdaptPermission', + 'org.osgi.framework.AdminPermission', + 'org.osgi.framework.Bundle', + 'org.osgi.framework.BundleActivator', + 'org.osgi.framework.BundleContext', + 'org.osgi.framework.BundleEvent', + 'org.osgi.framework.BundleReference', + 'org.osgi.framework.FrameworkUtil', + 'org.osgi.framework.ServiceRegistration', + 'org.osgi.framework.SynchronousBundleListener', + 'org.osgi.framework.wiring.BundleWire', + 'org.osgi.framework.wiring.BundleWiring', + 'org.zeromq.ZMQ$Context', + 'org.zeromq.ZMQ$Socket', + 'org.zeromq.ZMQ' +] diff --git a/x-pack/plugin/sql/sql-shared-client/licenses/jackson-LICENSE b/x-pack/plugin/sql/sql-action/licenses/jackson-LICENSE similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/licenses/jackson-LICENSE rename to x-pack/plugin/sql/sql-action/licenses/jackson-LICENSE diff --git a/x-pack/plugin/sql/sql-shared-client/licenses/jackson-NOTICE b/x-pack/plugin/sql/sql-action/licenses/jackson-NOTICE similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/licenses/jackson-NOTICE rename to x-pack/plugin/sql/sql-action/licenses/jackson-NOTICE diff --git a/x-pack/plugin/sql/sql-shared-client/licenses/jackson-core-2.8.10.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/jackson-core-2.8.10.jar.sha1 similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/licenses/jackson-core-2.8.10.jar.sha1 rename to x-pack/plugin/sql/sql-action/licenses/jackson-core-2.8.10.jar.sha1 diff --git a/x-pack/plugin/sql/sql-shared-proto/licenses/joda-time-2.9.9.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/joda-time-2.9.9.jar.sha1 similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/licenses/joda-time-2.9.9.jar.sha1 rename to x-pack/plugin/sql/sql-action/licenses/joda-time-2.9.9.jar.sha1 diff --git a/x-pack/plugin/sql/sql-shared-proto/licenses/joda-time-LICENSE.txt b/x-pack/plugin/sql/sql-action/licenses/joda-time-LICENSE.txt similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/licenses/joda-time-LICENSE.txt rename to x-pack/plugin/sql/sql-action/licenses/joda-time-LICENSE.txt diff --git a/x-pack/plugin/sql/sql-shared-proto/licenses/joda-time-NOTICE.txt b/x-pack/plugin/sql/sql-action/licenses/joda-time-NOTICE.txt similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/licenses/joda-time-NOTICE.txt rename to x-pack/plugin/sql/sql-action/licenses/joda-time-NOTICE.txt diff --git a/x-pack/plugin/sql/sql-proto/licenses/log4j-api-2.9.1.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/log4j-api-2.9.1.jar.sha1 similarity index 100% rename from x-pack/plugin/sql/sql-proto/licenses/log4j-api-2.9.1.jar.sha1 rename to x-pack/plugin/sql/sql-action/licenses/log4j-api-2.9.1.jar.sha1 diff --git a/x-pack/plugin/sql/sql-proto/licenses/log4j-api-LICENSE.txt b/x-pack/plugin/sql/sql-action/licenses/log4j-api-LICENSE.txt similarity index 100% rename from x-pack/plugin/sql/sql-proto/licenses/log4j-api-LICENSE.txt rename to x-pack/plugin/sql/sql-action/licenses/log4j-api-LICENSE.txt diff --git a/x-pack/plugin/sql/sql-proto/licenses/log4j-api-NOTICE.txt b/x-pack/plugin/sql/sql-action/licenses/log4j-api-NOTICE.txt similarity index 100% rename from x-pack/plugin/sql/sql-proto/licenses/log4j-api-NOTICE.txt rename to x-pack/plugin/sql/sql-action/licenses/log4j-api-NOTICE.txt diff --git a/x-pack/plugin/sql/sql-proto/licenses/log4j-core-2.9.1.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/log4j-core-2.9.1.jar.sha1 similarity index 100% rename from x-pack/plugin/sql/sql-proto/licenses/log4j-core-2.9.1.jar.sha1 rename to x-pack/plugin/sql/sql-action/licenses/log4j-core-2.9.1.jar.sha1 diff --git a/x-pack/plugin/sql/sql-proto/licenses/log4j-core-LICENSE.txt b/x-pack/plugin/sql/sql-action/licenses/log4j-core-LICENSE.txt similarity index 100% rename from x-pack/plugin/sql/sql-proto/licenses/log4j-core-LICENSE.txt rename to x-pack/plugin/sql/sql-action/licenses/log4j-core-LICENSE.txt diff --git a/x-pack/plugin/sql/sql-proto/licenses/log4j-core-NOTICE.txt b/x-pack/plugin/sql/sql-action/licenses/log4j-core-NOTICE.txt similarity index 100% rename from x-pack/plugin/sql/sql-proto/licenses/log4j-core-NOTICE.txt rename to x-pack/plugin/sql/sql-action/licenses/log4j-core-NOTICE.txt diff --git a/x-pack/plugin/sql/sql-proto/licenses/lucene-LICENSE.txt b/x-pack/plugin/sql/sql-action/licenses/lucene-LICENSE.txt similarity index 100% rename from x-pack/plugin/sql/sql-proto/licenses/lucene-LICENSE.txt rename to x-pack/plugin/sql/sql-action/licenses/lucene-LICENSE.txt diff --git a/x-pack/plugin/sql/sql-proto/licenses/lucene-NOTICE.txt b/x-pack/plugin/sql/sql-action/licenses/lucene-NOTICE.txt similarity index 100% rename from x-pack/plugin/sql/sql-proto/licenses/lucene-NOTICE.txt rename to x-pack/plugin/sql/sql-action/licenses/lucene-NOTICE.txt diff --git a/x-pack/plugin/sql/sql-proto/licenses/lucene-core-7.4.0.jar.sha1 b/x-pack/plugin/sql/sql-action/licenses/lucene-core-7.4.0.jar.sha1 similarity index 100% rename from x-pack/plugin/sql/sql-proto/licenses/lucene-core-7.4.0.jar.sha1 rename to x-pack/plugin/sql/sql-action/licenses/lucene-core-7.4.0.jar.sha1 diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/AbstractSqlQueryRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java similarity index 99% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/AbstractSqlQueryRequest.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java index dcb210ca68d..5ca956404be 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/AbstractSqlQueryRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlQueryRequest.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.common.Nullable; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/AbstractSqlRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlRequest.java similarity index 98% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/AbstractSqlRequest.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlRequest.java index 2cb23f796d6..ba513fed7da 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/AbstractSqlRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/AbstractSqlRequest.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/CliFormatter.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/CliFormatter.java similarity index 99% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/CliFormatter.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/CliFormatter.java index 359652fa4f2..c773e75aa18 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/CliFormatter.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/CliFormatter.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorAction.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorAction.java similarity index 94% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorAction.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorAction.java index 0908af76beb..ee824fc04e9 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorAction.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorAction.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.Action; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequest.java similarity index 98% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequest.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequest.java index 45dda285887..7a1f72dd74a 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequest.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.ParseField; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequestBuilder.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequestBuilder.java similarity index 94% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequestBuilder.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequestBuilder.java index b7a1f383a2f..40ce4f8dcf3 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequestBuilder.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequestBuilder.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorResponse.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponse.java similarity index 98% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorResponse.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponse.java index 3bb3df9a47f..ba9e4193d99 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorResponse.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponse.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryAction.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryAction.java similarity index 93% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryAction.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryAction.java index 5b9a5b1c3ef..f25eef31d3d 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryAction.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryAction.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.Action; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java similarity index 98% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequest.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java index 16c3cbf9c39..a7166f56790 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequest.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.ParseField; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequestBuilder.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestBuilder.java similarity index 98% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequestBuilder.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestBuilder.java index 812b72473ad..b1c6c310f7a 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequestBuilder.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestBuilder.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryResponse.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java similarity index 99% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryResponse.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java index 118ba81f82d..1dc356f9fba 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlQueryResponse.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlQueryResponse.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.Nullable; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateAction.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateAction.java similarity index 94% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateAction.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateAction.java index 978a11fbbb6..2431ecc1edf 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateAction.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateAction.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.Action; @@ -23,4 +23,4 @@ public class SqlTranslateAction extends Action { public SqlTranslateResponse newResponse() { return new SqlTranslateResponse(); } -} \ No newline at end of file +} diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequest.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequest.java similarity index 93% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequest.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequest.java index 103bfe5fddd..73187a02856 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequest.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequest.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.common.Strings; @@ -15,6 +15,7 @@ import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.proto.SqlTypedParamValue; +import org.elasticsearch.xpack.sql.proto.SqlQueryRequest; import java.io.IOException; import java.util.List; @@ -63,7 +64,7 @@ public class SqlTranslateRequest extends AbstractSqlQueryRequest { @Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { // This is needed just to test parsing of SqlTranslateRequest, so we can reuse SqlQuerySerialization - return new org.elasticsearch.xpack.sql.proto.SqlQueryRequest(mode(), query(), params(), timeZone(), fetchSize(), + return new SqlQueryRequest(mode(), query(), params(), timeZone(), fetchSize(), requestTimeout(), pageTimeout(), filter(), null).toXContent(builder, params); } diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequestBuilder.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequestBuilder.java similarity index 97% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequestBuilder.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequestBuilder.java index 9b9b00ebde9..22af91be67d 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequestBuilder.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequestBuilder.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.ActionRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; diff --git a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateResponse.java b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateResponse.java similarity index 97% rename from x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateResponse.java rename to x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateResponse.java index a19f8d1fc3c..e2efd4b46b6 100644 --- a/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateResponse.java +++ b/x-pack/plugin/sql/sql-action/src/main/java/org/elasticsearch/xpack/sql/action/SqlTranslateResponse.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.ActionResponse; import org.elasticsearch.common.io.stream.StreamInput; diff --git a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequestTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequestTests.java similarity index 97% rename from x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequestTests.java rename to x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequestTests.java index e479ae8b4f1..e9c7043519b 100644 --- a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorRequestTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.XContentParser; diff --git a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorResponseTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponseTests.java similarity index 96% rename from x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorResponseTests.java rename to x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponseTests.java index 94964428bb4..9e9f200abac 100644 --- a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlClearCursorResponseTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.test.AbstractStreamableXContentTestCase; diff --git a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequestTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestTests.java similarity index 96% rename from x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequestTests.java rename to x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestTests.java index 0e4a183ab16..84f361cabc7 100644 --- a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlQueryRequestTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; @@ -25,8 +25,8 @@ import java.util.List; import java.util.function.Consumer; import java.util.function.Supplier; -import static org.elasticsearch.xpack.sql.plugin.SqlTestUtils.randomFilter; -import static org.elasticsearch.xpack.sql.plugin.SqlTestUtils.randomFilterOrNull; +import static org.elasticsearch.xpack.sql.action.SqlTestUtils.randomFilter; +import static org.elasticsearch.xpack.sql.action.SqlTestUtils.randomFilterOrNull; public class SqlQueryRequestTests extends AbstractSerializingTestCase { diff --git a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlQueryResponseTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryResponseTests.java similarity index 99% rename from x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlQueryResponseTests.java rename to x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryResponseTests.java index bc5e5ae2a01..0957b4c5202 100644 --- a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlQueryResponseTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlQueryResponseTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.common.Strings; import org.elasticsearch.common.bytes.BytesReference; diff --git a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlTestUtils.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTestUtils.java similarity index 96% rename from x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlTestUtils.java rename to x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTestUtils.java index 05a164c1c94..0aee6aade96 100644 --- a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlTestUtils.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTestUtils.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import com.carrotsearch.randomizedtesting.generators.RandomStrings; import org.elasticsearch.index.query.QueryBuilder; diff --git a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequestTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequestTests.java similarity index 95% rename from x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequestTests.java rename to x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequestTests.java index 2eb3d71bbf4..cd022746bae 100644 --- a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateRequestTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateRequestTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.Writeable; @@ -21,8 +21,8 @@ import java.io.IOException; import java.util.Collections; import java.util.function.Consumer; -import static org.elasticsearch.xpack.sql.plugin.SqlTestUtils.randomFilter; -import static org.elasticsearch.xpack.sql.plugin.SqlTestUtils.randomFilterOrNull; +import static org.elasticsearch.xpack.sql.action.SqlTestUtils.randomFilter; +import static org.elasticsearch.xpack.sql.action.SqlTestUtils.randomFilterOrNull; public class SqlTranslateRequestTests extends AbstractSerializingTestCase { diff --git a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateResponseTests.java b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateResponseTests.java similarity index 94% rename from x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateResponseTests.java rename to x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateResponseTests.java index 76f73fada06..647bb909520 100644 --- a/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/plugin/SqlTranslateResponseTests.java +++ b/x-pack/plugin/sql/sql-action/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateResponseTests.java @@ -3,11 +3,12 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.fetch.subphase.DocValueFieldsContext; import org.elasticsearch.test.AbstractStreamableTestCase; +import org.elasticsearch.xpack.sql.action.SqlTranslateResponse; import java.io.IOException; diff --git a/x-pack/plugin/sql/sql-cli/build.gradle b/x-pack/plugin/sql/sql-cli/build.gradle index 06eb24c743a..b90b07abad3 100644 --- a/x-pack/plugin/sql/sql-cli/build.gradle +++ b/x-pack/plugin/sql/sql-cli/build.gradle @@ -16,8 +16,8 @@ description = 'Command line interface to Elasticsearch that speaks SQL' dependencies { compile "org.jline:jline:3.6.0" - compile xpackProject('plugin:sql:sql-shared-client') - compile xpackProject('plugin:sql:sql-proto') + compile xpackProject('plugin:sql:sql-client') + compile xpackProject('plugin:sql:sql-action') compile "org.elasticsearch:elasticsearch-cli:${version}" runtime "org.fusesource.jansi:jansi:1.16" @@ -31,13 +31,13 @@ dependencyLicenses { mapping from: /elasticsearch-core.*/, to: 'elasticsearch' mapping from: /jackson-.*/, to: 'jackson' mapping from: /lucene-.*/, to: 'lucene' - mapping from: /sql-proto.*/, to: 'elasticsearch' - mapping from: /sql-shared-client.*/, to: 'elasticsearch' + mapping from: /sql-action.*/, to: 'elasticsearch' + mapping from: /sql-client.*/, to: 'elasticsearch' ignoreSha 'elasticsearch-cli' ignoreSha 'elasticsearch-core' ignoreSha 'elasticsearch' - ignoreSha 'sql-proto' - ignoreSha 'sql-shared-client' + ignoreSha 'sql-action' + ignoreSha 'sql-client' } /* diff --git a/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/Cli.java b/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/Cli.java index d1f59c97e5a..357a4bcb5a7 100644 --- a/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/Cli.java +++ b/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/Cli.java @@ -21,9 +21,9 @@ import org.elasticsearch.xpack.sql.cli.command.PrintLogoCommand; import org.elasticsearch.xpack.sql.cli.command.ServerInfoCliCommand; import org.elasticsearch.xpack.sql.cli.command.ServerQueryCliCommand; import org.elasticsearch.xpack.sql.client.HttpClient; -import org.elasticsearch.xpack.sql.client.shared.ClientException; -import org.elasticsearch.xpack.sql.client.shared.ConnectionConfiguration; -import org.elasticsearch.xpack.sql.client.shared.Version; +import org.elasticsearch.xpack.sql.client.ClientException; +import org.elasticsearch.xpack.sql.client.ConnectionConfiguration; +import org.elasticsearch.xpack.sql.client.Version; import org.jline.terminal.TerminalBuilder; import java.io.IOException; import java.net.ConnectException; diff --git a/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilder.java b/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilder.java index dbd0e230043..9033133a0ef 100644 --- a/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilder.java +++ b/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilder.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.sql.cli; import org.elasticsearch.cli.ExitCodes; import org.elasticsearch.cli.SuppressForbidden; import org.elasticsearch.cli.UserException; -import org.elasticsearch.xpack.sql.client.shared.ConnectionConfiguration; +import org.elasticsearch.xpack.sql.client.ConnectionConfiguration; import java.net.URI; import java.nio.file.Files; @@ -16,8 +16,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Properties; -import static org.elasticsearch.xpack.sql.client.shared.UriUtils.parseURI; -import static org.elasticsearch.xpack.sql.client.shared.UriUtils.removeQuery; +import static org.elasticsearch.xpack.sql.client.UriUtils.parseURI; +import static org.elasticsearch.xpack.sql.client.UriUtils.removeQuery; /** * Connection Builder. Can interactively ask users for the password if it is not provided diff --git a/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/command/CliSession.java b/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/command/CliSession.java index 82a2a8817f4..f5b91704aea 100644 --- a/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/command/CliSession.java +++ b/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/command/CliSession.java @@ -6,8 +6,8 @@ package org.elasticsearch.xpack.sql.cli.command; import org.elasticsearch.xpack.sql.client.HttpClient; -import org.elasticsearch.xpack.sql.client.shared.ClientException; -import org.elasticsearch.xpack.sql.client.shared.Version; +import org.elasticsearch.xpack.sql.client.ClientException; +import org.elasticsearch.xpack.sql.client.Version; import org.elasticsearch.xpack.sql.proto.MainResponse; import org.elasticsearch.xpack.sql.proto.Protocol; diff --git a/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/command/ServerQueryCliCommand.java b/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/command/ServerQueryCliCommand.java index aa8bc499cd2..1eb982c814c 100644 --- a/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/command/ServerQueryCliCommand.java +++ b/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/command/ServerQueryCliCommand.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.sql.cli.command; import org.elasticsearch.xpack.sql.cli.CliTerminal; import org.elasticsearch.xpack.sql.client.HttpClient; -import org.elasticsearch.xpack.sql.client.shared.JreHttpUrlConnection; -import org.elasticsearch.xpack.sql.plugin.CliFormatter; +import org.elasticsearch.xpack.sql.client.JreHttpUrlConnection; +import org.elasticsearch.xpack.sql.action.CliFormatter; import org.elasticsearch.xpack.sql.proto.SqlQueryResponse; import java.sql.SQLException; diff --git a/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/CliSessionTests.java b/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/CliSessionTests.java index 8b0138865ce..295ebe1fb07 100644 --- a/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/CliSessionTests.java +++ b/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/CliSessionTests.java @@ -10,8 +10,8 @@ import org.elasticsearch.common.UUIDs; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.sql.cli.command.CliSession; import org.elasticsearch.xpack.sql.client.HttpClient; -import org.elasticsearch.xpack.sql.client.shared.ClientException; -import org.elasticsearch.xpack.sql.client.shared.Version; +import org.elasticsearch.xpack.sql.client.ClientException; +import org.elasticsearch.xpack.sql.client.Version; import org.elasticsearch.xpack.sql.proto.MainResponse; import java.sql.SQLException; diff --git a/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilderTests.java b/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilderTests.java index 69b77931ff0..d825b992300 100644 --- a/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilderTests.java +++ b/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilderTests.java @@ -7,8 +7,8 @@ package org.elasticsearch.xpack.sql.cli; import org.elasticsearch.cli.UserException; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.sql.client.shared.ConnectionConfiguration; -import org.elasticsearch.xpack.sql.client.shared.SslConfig; +import org.elasticsearch.xpack.sql.client.ConnectionConfiguration; +import org.elasticsearch.xpack.sql.client.SslConfig; import java.net.URI; import java.nio.file.Path; import java.util.Properties; diff --git a/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/VersionTests.java b/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/VersionTests.java index 0f1effc4463..5be8bdd4df0 100644 --- a/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/VersionTests.java +++ b/x-pack/plugin/sql/sql-cli/src/test/java/org/elasticsearch/xpack/sql/cli/VersionTests.java @@ -6,7 +6,7 @@ package org.elasticsearch.xpack.sql.cli; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.sql.client.shared.Version; +import org.elasticsearch.xpack.sql.client.Version; public class VersionTests extends ESTestCase { public void testVersionIsCurrent() { diff --git a/x-pack/plugin/sql/sql-shared-client/build.gradle b/x-pack/plugin/sql/sql-client/build.gradle similarity index 80% rename from x-pack/plugin/sql/sql-shared-client/build.gradle rename to x-pack/plugin/sql/sql-client/build.gradle index f7f5efec7af..fbc411e4459 100644 --- a/x-pack/plugin/sql/sql-shared-client/build.gradle +++ b/x-pack/plugin/sql/sql-client/build.gradle @@ -1,8 +1,6 @@ /* - * This project is named sql-shared-client because it is in the - * "org.elasticsearch.plugin" group and it'd be super confusing for it to just - * be called "shared-client" there. + * The minimal dependencies REST-based SQL client that is used by CLI and JDBC */ apply plugin: 'elasticsearch.build' @@ -10,18 +8,18 @@ apply plugin: 'elasticsearch.build' description = 'Code shared between jdbc and cli' dependencies { - compile xpackProject('plugin:sql:sql-shared-proto') + compile xpackProject('plugin:sql:sql-proto') compile "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" testCompile "org.elasticsearch.test:framework:${version}" } dependencyLicenses { mapping from: /jackson-.*/, to: 'jackson' - mapping from: /sql-shared-proto.*/, to: 'elasticsearch' + mapping from: /sql-proto.*/, to: 'elasticsearch' mapping from: /elasticsearch-cli.*/, to: 'elasticsearch' mapping from: /elasticsearch-core.*/, to: 'elasticsearch' mapping from: /lucene-.*/, to: 'lucene' - ignoreSha 'sql-proto' + ignoreSha 'sql-action' ignoreSha 'elasticsearch' ignoreSha 'elasticsearch-core' } diff --git a/x-pack/plugin/sql/sql-shared-proto/licenses/jackson-LICENSE b/x-pack/plugin/sql/sql-client/licenses/jackson-LICENSE similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/licenses/jackson-LICENSE rename to x-pack/plugin/sql/sql-client/licenses/jackson-LICENSE diff --git a/x-pack/plugin/sql/sql-shared-proto/licenses/jackson-NOTICE b/x-pack/plugin/sql/sql-client/licenses/jackson-NOTICE similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/licenses/jackson-NOTICE rename to x-pack/plugin/sql/sql-client/licenses/jackson-NOTICE diff --git a/x-pack/plugin/sql/sql-shared-proto/licenses/jackson-core-2.8.10.jar.sha1 b/x-pack/plugin/sql/sql-client/licenses/jackson-core-2.8.10.jar.sha1 similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/licenses/jackson-core-2.8.10.jar.sha1 rename to x-pack/plugin/sql/sql-client/licenses/jackson-core-2.8.10.jar.sha1 diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/Bytes.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/Bytes.java similarity index 93% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/Bytes.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/Bytes.java index 0e0a3af5633..4d5e78d91db 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/Bytes.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/Bytes.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.nio.charset.StandardCharsets; import java.util.Arrays; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/CheckedBiFunction.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/CheckedBiFunction.java similarity index 91% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/CheckedBiFunction.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/CheckedBiFunction.java index ba16da3bfd3..afe1ad14eed 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/CheckedBiFunction.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/CheckedBiFunction.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.util.function.BiFunction; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/CheckedConsumer.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/CheckedConsumer.java similarity index 91% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/CheckedConsumer.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/CheckedConsumer.java index 62258eebefa..12aa32addaa 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/CheckedConsumer.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/CheckedConsumer.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.util.function.Consumer; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/CheckedFunction.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/CheckedFunction.java similarity index 91% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/CheckedFunction.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/CheckedFunction.java index 67e174ffd70..35a0a22f059 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/CheckedFunction.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/CheckedFunction.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.util.function.Function; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ClientException.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ClientException.java similarity index 92% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ClientException.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ClientException.java index 5eb18b86091..996bee3bed4 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ClientException.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ClientException.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; /** * A general-purpose exception to be used on the client-side code. Does not support var-args formatting. diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ConnectionConfiguration.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ConnectionConfiguration.java similarity index 99% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ConnectionConfiguration.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ConnectionConfiguration.java index aca262e1726..0de71d27471 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ConnectionConfiguration.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ConnectionConfiguration.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.net.URI; import java.net.URISyntaxException; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/HttpClient.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/HttpClient.java similarity index 95% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/HttpClient.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/HttpClient.java index 27e1870904f..c84bc7b577a 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/HttpClient.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/HttpClient.java @@ -14,11 +14,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.core.internal.io.Streams; -import org.elasticsearch.xpack.sql.client.shared.CheckedFunction; -import org.elasticsearch.xpack.sql.client.shared.ClientException; -import org.elasticsearch.xpack.sql.client.shared.ConnectionConfiguration; -import org.elasticsearch.xpack.sql.client.shared.JreHttpUrlConnection; -import org.elasticsearch.xpack.sql.client.shared.JreHttpUrlConnection.ResponseOrException; +import org.elasticsearch.xpack.sql.client.JreHttpUrlConnection.ResponseOrException; import org.elasticsearch.xpack.sql.proto.AbstractSqlRequest; import org.elasticsearch.xpack.sql.proto.MainResponse; import org.elasticsearch.xpack.sql.proto.Mode; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/JreHttpUrlConnection.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/JreHttpUrlConnection.java similarity index 99% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/JreHttpUrlConnection.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/JreHttpUrlConnection.java index 2f6289ee395..0dca4a88f05 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/JreHttpUrlConnection.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/JreHttpUrlConnection.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.io.BufferedInputStream; import java.io.Closeable; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ObjectUtils.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ObjectUtils.java similarity index 94% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ObjectUtils.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ObjectUtils.java index df924cdb375..3c4fa7fcaad 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ObjectUtils.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ObjectUtils.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.util.Arrays; import java.util.Map; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ProxyConfig.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ProxyConfig.java similarity index 97% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ProxyConfig.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ProxyConfig.java index ca311e5292d..4ec33f4fbe8 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/ProxyConfig.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/ProxyConfig.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.net.InetSocketAddress; import java.net.Proxy; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/RemoteFailure.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/RemoteFailure.java similarity index 99% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/RemoteFailure.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/RemoteFailure.java index f9eccb4f157..61e62c390ec 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/RemoteFailure.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/RemoteFailure.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonGenerator; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/SslConfig.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/SslConfig.java similarity index 99% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/SslConfig.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/SslConfig.java index 35a1ebe3b96..fecfb44492c 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/SslConfig.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/SslConfig.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.io.IOException; import java.io.InputStream; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/StringUtils.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/StringUtils.java similarity index 99% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/StringUtils.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/StringUtils.java index 192c217be51..e4e5bf4d985 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/StringUtils.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/StringUtils.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.nio.charset.StandardCharsets; import java.util.ArrayList; @@ -305,4 +305,4 @@ public abstract class StringUtils { return buf.toString(); } -} \ No newline at end of file +} diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/SuppressForbidden.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/SuppressForbidden.java similarity index 93% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/SuppressForbidden.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/SuppressForbidden.java index 52b864edff4..fbbf13782a9 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/SuppressForbidden.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/SuppressForbidden.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/UriUtils.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/UriUtils.java similarity index 98% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/UriUtils.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/UriUtils.java index f8c2e73e6a0..26113010c61 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/UriUtils.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/UriUtils.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.net.URI; import java.net.URISyntaxException; diff --git a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/Version.java b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/Version.java similarity index 98% rename from x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/Version.java rename to x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/Version.java index bfa9e0a3cb4..d7327af6c4e 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/main/java/org/elasticsearch/xpack/sql/client/shared/Version.java +++ b/x-pack/plugin/sql/sql-client/src/main/java/org/elasticsearch/xpack/sql/client/Version.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import java.io.IOException; import java.net.URL; diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/RemoteFailureTests.java b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java similarity index 99% rename from x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/RemoteFailureTests.java rename to x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java index ab0bc40f3ba..ee3a859b548 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/RemoteFailureTests.java +++ b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/RemoteFailureTests.java @@ -3,10 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.sql.client.RemoteFailure; import java.io.IOException; import java.io.InputStream; diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/StringUtilsTests.java b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/StringUtilsTests.java similarity index 81% rename from x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/StringUtilsTests.java rename to x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/StringUtilsTests.java index b758d361ab9..34f1f20056a 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/StringUtilsTests.java +++ b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/StringUtilsTests.java @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import org.elasticsearch.test.ESTestCase; -import static org.elasticsearch.xpack.sql.client.shared.StringUtils.nullAsEmpty; +import static org.elasticsearch.xpack.sql.client.StringUtils.nullAsEmpty; public class StringUtilsTests extends ESTestCase { public void testNullAsEmpty() { diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/UriUtilsTests.java b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/UriUtilsTests.java similarity index 94% rename from x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/UriUtilsTests.java rename to x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/UriUtilsTests.java index f75b20d0f0d..0b7f6c47b0d 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/UriUtilsTests.java +++ b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/UriUtilsTests.java @@ -3,14 +3,14 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import org.elasticsearch.test.ESTestCase; import java.net.URI; -import static org.elasticsearch.xpack.sql.client.shared.UriUtils.parseURI; -import static org.elasticsearch.xpack.sql.client.shared.UriUtils.removeQuery; +import static org.elasticsearch.xpack.sql.client.UriUtils.parseURI; +import static org.elasticsearch.xpack.sql.client.UriUtils.removeQuery; public class UriUtilsTests extends ESTestCase { diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/VersionTests.java b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/VersionTests.java similarity index 94% rename from x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/VersionTests.java rename to x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/VersionTests.java index 9eabed07931..7ed772e3525 100644 --- a/x-pack/plugin/sql/sql-shared-client/src/test/java/org/elasticsearch/xpack/sql/client/shared/VersionTests.java +++ b/x-pack/plugin/sql/sql-client/src/test/java/org/elasticsearch/xpack/sql/client/VersionTests.java @@ -3,9 +3,10 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.client.shared; +package org.elasticsearch.xpack.sql.client; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.sql.client.Version; public class VersionTests extends ESTestCase { public void test70Version() { diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/basic.json b/x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/basic.json similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/basic.json rename to x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/basic.json diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/bogus_error.json b/x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/bogus_error.json similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/bogus_error.json rename to x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/bogus_error.json diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/invalid_json.txt b/x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/invalid_json.txt similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/invalid_json.txt rename to x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/invalid_json.txt diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/missing_auth.json b/x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/missing_auth.json similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/missing_auth.json rename to x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/missing_auth.json diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/nested.json b/x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/nested.json similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/nested.json rename to x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/nested.json diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/no_error.json b/x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/no_error.json similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/no_error.json rename to x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/no_error.json diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/no_stack.json b/x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/no_stack.json similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/no_stack.json rename to x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/no_stack.json diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/no_type.json b/x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/no_type.json similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/remote_failure/no_type.json rename to x-pack/plugin/sql/sql-client/src/test/resources/remote_failure/no_type.json diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/ssl/client.keystore b/x-pack/plugin/sql/sql-client/src/test/resources/ssl/client.keystore similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/ssl/client.keystore rename to x-pack/plugin/sql/sql-client/src/test/resources/ssl/client.keystore diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/ssl/readme.txt b/x-pack/plugin/sql/sql-client/src/test/resources/ssl/readme.txt similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/ssl/readme.txt rename to x-pack/plugin/sql/sql-client/src/test/resources/ssl/readme.txt diff --git a/x-pack/plugin/sql/sql-shared-client/src/test/resources/ssl/server.keystore b/x-pack/plugin/sql/sql-client/src/test/resources/ssl/server.keystore similarity index 100% rename from x-pack/plugin/sql/sql-shared-client/src/test/resources/ssl/server.keystore rename to x-pack/plugin/sql/sql-client/src/test/resources/ssl/server.keystore diff --git a/x-pack/plugin/sql/sql-proto/build.gradle b/x-pack/plugin/sql/sql-proto/build.gradle index b1d8497f9b8..5a1439f4360 100644 --- a/x-pack/plugin/sql/sql-proto/build.gradle +++ b/x-pack/plugin/sql/sql-proto/build.gradle @@ -1,8 +1,6 @@ /* - * This project is named sql-proto because it is in the - * "org.elasticsearch.plugin" group and it'd be super confusing for it to just - * be called "proto" there. + * This project contains XContent protocol classes shared between server and http client */ import org.elasticsearch.gradle.precommit.PrecommitTasks @@ -13,23 +11,14 @@ description = 'Request and response objects shared by the cli, jdbc ' + 'and the Elasticsearch plugin' dependencies { - /* We'd like to just depend on xcontent but there are some bits of - * :server that we rely on.... */ - compile (project(':server')) { - transitive = false - } compile (project(':libs:core')) { transitive = false } compile (project(':libs:x-content')) { transitive = false } - compile xpackProject('plugin:sql:sql-shared-proto') - compile "org.apache.lucene:lucene-core:${versions.lucene}" compile 'joda-time:joda-time:2.9.9' runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - runtime "org.apache.logging.log4j:log4j-api:${versions.log4j}" - runtime "org.apache.logging.log4j:log4j-core:${versions.log4j}" testCompile "org.elasticsearch.test:framework:${version}" } @@ -42,113 +31,5 @@ forbiddenApisMain { dependencyLicenses { mapping from: /elasticsearch-core.*/, to: 'elasticsearch' mapping from: /jackson-.*/, to: 'jackson' - mapping from: /lucene-.*/, to: 'lucene' - ignoreSha 'elasticsearch' ignoreSha 'elasticsearch-core' } - -thirdPartyAudit.excludes = [ - 'com.fasterxml.jackson.dataformat.yaml.YAMLFactory', - 'com.fasterxml.jackson.dataformat.yaml.YAMLMapper', - - // from com.fasterxml.jackson.dataformat.yaml.YAMLMapper (jackson-dataformat-yaml) - 'com.fasterxml.jackson.databind.ObjectMapper', - 'org.fusesource.jansi.Ansi', - 'org.fusesource.jansi.AnsiRenderer$Code', - - // from log4j - 'com.conversantmedia.util.concurrent.DisruptorBlockingQueue', - 'com.conversantmedia.util.concurrent.SpinPolicy', - 'com.fasterxml.jackson.annotation.JsonInclude$Include', - 'com.fasterxml.jackson.databind.DeserializationContext', - 'com.fasterxml.jackson.databind.DeserializationFeature', - 'com.fasterxml.jackson.databind.JsonMappingException', - 'com.fasterxml.jackson.databind.JsonNode', - 'com.fasterxml.jackson.databind.Module$SetupContext', - 'com.fasterxml.jackson.databind.ObjectReader', - 'com.fasterxml.jackson.databind.ObjectWriter', - 'com.fasterxml.jackson.databind.SerializerProvider', - 'com.fasterxml.jackson.databind.deser.std.StdDeserializer', - 'com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer', - 'com.fasterxml.jackson.databind.module.SimpleModule', - 'com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter', - 'com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider', - 'com.fasterxml.jackson.databind.ser.std.StdScalarSerializer', - 'com.fasterxml.jackson.databind.ser.std.StdSerializer', - 'com.fasterxml.jackson.dataformat.xml.JacksonXmlModule', - 'com.fasterxml.jackson.dataformat.xml.XmlMapper', - 'com.fasterxml.jackson.dataformat.xml.util.DefaultXmlPrettyPrinter', - 'com.fasterxml.jackson.databind.node.JsonNodeFactory', - 'com.fasterxml.jackson.databind.node.ObjectNode', - 'com.lmax.disruptor.BlockingWaitStrategy', - 'com.lmax.disruptor.BusySpinWaitStrategy', - 'com.lmax.disruptor.EventFactory', - 'com.lmax.disruptor.EventTranslator', - 'com.lmax.disruptor.EventTranslatorTwoArg', - 'com.lmax.disruptor.EventTranslatorVararg', - 'com.lmax.disruptor.ExceptionHandler', - 'com.lmax.disruptor.LifecycleAware', - 'com.lmax.disruptor.RingBuffer', - 'com.lmax.disruptor.Sequence', - 'com.lmax.disruptor.SequenceReportingEventHandler', - 'com.lmax.disruptor.SleepingWaitStrategy', - 'com.lmax.disruptor.TimeoutBlockingWaitStrategy', - 'com.lmax.disruptor.WaitStrategy', - 'com.lmax.disruptor.YieldingWaitStrategy', - 'com.lmax.disruptor.dsl.Disruptor', - 'com.lmax.disruptor.dsl.ProducerType', - 'javax.jms.Connection', - 'javax.jms.ConnectionFactory', - 'javax.jms.Destination', - 'javax.jms.JMSException', - 'javax.jms.MapMessage', - 'javax.jms.Message', - 'javax.jms.MessageConsumer', - 'javax.jms.MessageProducer', - 'javax.jms.Session', - 'javax.mail.Authenticator', - 'javax.mail.Message$RecipientType', - 'javax.mail.PasswordAuthentication', - 'javax.mail.Session', - 'javax.mail.Transport', - 'javax.mail.internet.InternetAddress', - 'javax.mail.internet.InternetHeaders', - 'javax.mail.internet.MimeBodyPart', - 'javax.mail.internet.MimeMessage', - 'javax.mail.internet.MimeMultipart', - 'javax.mail.internet.MimeUtility', - 'javax.mail.util.ByteArrayDataSource', - 'javax.persistence.AttributeConverter', - 'javax.persistence.EntityManager', - 'javax.persistence.EntityManagerFactory', - 'javax.persistence.EntityTransaction', - 'javax.persistence.Persistence', - 'javax.persistence.PersistenceException', - 'org.apache.commons.compress.compressors.CompressorStreamFactory', - 'org.apache.commons.compress.utils.IOUtils', - 'org.apache.commons.csv.CSVFormat', - 'org.apache.commons.csv.QuoteMode', - 'org.apache.kafka.clients.producer.Callback', - 'org.apache.kafka.clients.producer.KafkaProducer', - 'org.apache.kafka.clients.producer.Producer', - 'org.apache.kafka.clients.producer.ProducerRecord', - 'org.apache.kafka.clients.producer.RecordMetadata', - 'org.codehaus.stax2.XMLStreamWriter2', - 'org.jctools.queues.MessagePassingQueue$Consumer', - 'org.jctools.queues.MpscArrayQueue', - 'org.osgi.framework.AdaptPermission', - 'org.osgi.framework.AdminPermission', - 'org.osgi.framework.Bundle', - 'org.osgi.framework.BundleActivator', - 'org.osgi.framework.BundleContext', - 'org.osgi.framework.BundleEvent', - 'org.osgi.framework.BundleReference', - 'org.osgi.framework.FrameworkUtil', - 'org.osgi.framework.ServiceRegistration', - 'org.osgi.framework.SynchronousBundleListener', - 'org.osgi.framework.wiring.BundleWire', - 'org.osgi.framework.wiring.BundleWiring', - 'org.zeromq.ZMQ$Context', - 'org.zeromq.ZMQ$Socket', - 'org.zeromq.ZMQ' -] diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/AbstractSqlRequest.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/AbstractSqlRequest.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/AbstractSqlRequest.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/AbstractSqlRequest.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ColumnInfo.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ColumnInfo.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ColumnInfo.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ColumnInfo.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/MainResponse.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/MainResponse.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/MainResponse.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/MainResponse.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/Mode.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/Mode.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/Mode.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/Mode.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ProtoUtils.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ProtoUtils.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ProtoUtils.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/ProtoUtils.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/Protocol.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/Protocol.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/Protocol.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/Protocol.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorRequest.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorRequest.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorRequest.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorRequest.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorResponse.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorResponse.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorResponse.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlClearCursorResponse.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryRequest.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryRequest.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryRequest.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryRequest.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryResponse.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryResponse.java similarity index 97% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryResponse.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryResponse.java index f048bcb170a..4cb500fe802 100644 --- a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryResponse.java +++ b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlQueryResponse.java @@ -18,7 +18,6 @@ import java.util.Objects; import static org.elasticsearch.common.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.common.xcontent.ConstructingObjectParser.optionalConstructorArg; -import static org.elasticsearch.xpack.sql.proto.ProtoUtils.parseFieldsValue; /** * Response to perform an sql query for JDBC/CLI client @@ -94,7 +93,7 @@ public class SqlQueryResponse { List list = new ArrayList<>(); while (parser.nextToken() != XContentParser.Token.END_ARRAY) { if (parser.currentToken().isValue()) { - list.add(parseFieldsValue(parser)); + list.add(ProtoUtils.parseFieldsValue(parser)); } else if (parser.currentToken() == XContentParser.Token.VALUE_NULL) { list.add(null); } else { diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlTypedParamValue.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlTypedParamValue.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlTypedParamValue.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/proto/SqlTypedParamValue.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/type/DataType.java b/x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/type/DataType.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/main/java/org/elasticsearch/xpack/sql/type/DataType.java rename to x-pack/plugin/sql/sql-proto/src/main/java/org/elasticsearch/xpack/sql/type/DataType.java diff --git a/x-pack/plugin/sql/sql-shared-proto/src/test/java/org/elasticsearch/xpack/sql/proto/ProtoUtilsTests.java b/x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/proto/ProtoUtilsTests.java similarity index 100% rename from x-pack/plugin/sql/sql-shared-proto/src/test/java/org/elasticsearch/xpack/sql/proto/ProtoUtilsTests.java rename to x-pack/plugin/sql/sql-proto/src/test/java/org/elasticsearch/xpack/sql/proto/ProtoUtilsTests.java diff --git a/x-pack/plugin/sql/sql-shared-proto/build.gradle b/x-pack/plugin/sql/sql-shared-proto/build.gradle deleted file mode 100644 index 5a1439f4360..00000000000 --- a/x-pack/plugin/sql/sql-shared-proto/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ - -/* - * This project contains XContent protocol classes shared between server and http client - */ - -import org.elasticsearch.gradle.precommit.PrecommitTasks - -apply plugin: 'elasticsearch.build' - -description = 'Request and response objects shared by the cli, jdbc ' + - 'and the Elasticsearch plugin' - -dependencies { - compile (project(':libs:core')) { - transitive = false - } - compile (project(':libs:x-content')) { - transitive = false - } - compile 'joda-time:joda-time:2.9.9' - runtime "com.fasterxml.jackson.core:jackson-core:${versions.jackson}" - - testCompile "org.elasticsearch.test:framework:${version}" -} - -forbiddenApisMain { - //sql does not depend on server, so only jdk signatures should be checked - signaturesURLs = [PrecommitTasks.getResource('/forbidden/jdk-signatures.txt')] -} - -dependencyLicenses { - mapping from: /elasticsearch-core.*/, to: 'elasticsearch' - mapping from: /jackson-.*/, to: 'jackson' - ignoreSha 'elasticsearch-core' -} diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/CliFormatterCursor.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/CliFormatterCursor.java index 94422dd2888..b226e899e4d 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/CliFormatterCursor.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/CliFormatterCursor.java @@ -10,6 +10,7 @@ import org.elasticsearch.client.Client; import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; +import org.elasticsearch.xpack.sql.action.CliFormatter; import org.elasticsearch.xpack.sql.session.Configuration; import org.elasticsearch.xpack.sql.session.Cursor; import org.elasticsearch.xpack.sql.session.RowSet; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java index 175b78d4f66..e606eace975 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java @@ -12,6 +12,8 @@ import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.xpack.sql.action.SqlClearCursorAction; +import org.elasticsearch.xpack.sql.action.SqlClearCursorRequest; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.proto.Protocol; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java index a8daa1136d3..387b7d8727e 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java @@ -18,6 +18,9 @@ import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.action.RestResponseListener; +import org.elasticsearch.xpack.sql.action.SqlQueryAction; +import org.elasticsearch.xpack.sql.action.SqlQueryRequest; +import org.elasticsearch.xpack.sql.action.SqlQueryResponse; import org.elasticsearch.xpack.sql.proto.Mode; import org.elasticsearch.xpack.sql.proto.Protocol; import org.elasticsearch.xpack.sql.session.Cursor; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java index 74d94e48006..731046f923f 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java @@ -12,6 +12,8 @@ import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.action.RestToXContentListener; +import org.elasticsearch.xpack.sql.action.SqlTranslateAction; +import org.elasticsearch.xpack.sql.action.SqlTranslateRequest; import org.elasticsearch.xpack.sql.proto.Mode; import java.io.IOException; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java index 24bf8f15aa7..6c026b26071 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/SqlPlugin.java @@ -31,6 +31,9 @@ import org.elasticsearch.watcher.ResourceWatcherService; import org.elasticsearch.xpack.core.XPackField; import org.elasticsearch.xpack.core.XPackPlugin; import org.elasticsearch.xpack.core.XPackSettings; +import org.elasticsearch.xpack.sql.action.SqlClearCursorAction; +import org.elasticsearch.xpack.sql.action.SqlQueryAction; +import org.elasticsearch.xpack.sql.action.SqlTranslateAction; import org.elasticsearch.xpack.sql.analysis.index.IndexResolver; import org.elasticsearch.xpack.sql.execution.PlanExecutor; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TextFormat.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TextFormat.java index 9d0cd60c23e..de8798ecf54 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TextFormat.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TextFormat.java @@ -7,6 +7,8 @@ package org.elasticsearch.xpack.sql.plugin; import org.elasticsearch.common.Strings; import org.elasticsearch.rest.RestRequest; +import org.elasticsearch.xpack.sql.action.SqlQueryResponse; +import org.elasticsearch.xpack.sql.action.CliFormatter; import org.elasticsearch.xpack.sql.proto.ColumnInfo; import org.elasticsearch.xpack.sql.session.Cursor; import org.elasticsearch.xpack.sql.session.Cursors; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlClearCursorAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlClearCursorAction.java index 7a216f3a2bf..be0aae2001c 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlClearCursorAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlClearCursorAction.java @@ -13,12 +13,14 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xpack.sql.action.SqlClearCursorRequest; +import org.elasticsearch.xpack.sql.action.SqlClearCursorResponse; import org.elasticsearch.xpack.sql.execution.PlanExecutor; import org.elasticsearch.xpack.sql.session.Configuration; import org.elasticsearch.xpack.sql.session.Cursor; import org.elasticsearch.xpack.sql.session.Cursors; -import static org.elasticsearch.xpack.sql.plugin.SqlClearCursorAction.NAME; +import static org.elasticsearch.xpack.sql.action.SqlClearCursorAction.NAME; public class TransportSqlClearCursorAction extends HandledTransportAction { private final PlanExecutor planExecutor; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlQueryAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlQueryAction.java index 7993f00d71a..e491f76749b 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlQueryAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlQueryAction.java @@ -15,6 +15,9 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xpack.sql.action.SqlQueryAction; +import org.elasticsearch.xpack.sql.action.SqlQueryRequest; +import org.elasticsearch.xpack.sql.action.SqlQueryResponse; import org.elasticsearch.xpack.sql.execution.PlanExecutor; import org.elasticsearch.xpack.sql.proto.ColumnInfo; import org.elasticsearch.xpack.sql.session.Configuration; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlTranslateAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlTranslateAction.java index 4ef7c14ab01..95a10497fdc 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlTranslateAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/TransportSqlTranslateAction.java @@ -13,6 +13,9 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.tasks.Task; import org.elasticsearch.transport.TransportService; +import org.elasticsearch.xpack.sql.action.SqlTranslateAction; +import org.elasticsearch.xpack.sql.action.SqlTranslateRequest; +import org.elasticsearch.xpack.sql.action.SqlTranslateResponse; import org.elasticsearch.xpack.sql.execution.PlanExecutor; import org.elasticsearch.xpack.sql.session.Configuration; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/CliFormatterTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/CliFormatterTests.java similarity index 95% rename from x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/CliFormatterTests.java rename to x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/CliFormatterTests.java index d87dba33068..400a90712d6 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/CliFormatterTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/CliFormatterTests.java @@ -3,9 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.sql.plugin; +package org.elasticsearch.xpack.sql.action; import org.elasticsearch.test.ESTestCase; +import org.elasticsearch.xpack.sql.action.CliFormatter; +import org.elasticsearch.xpack.sql.action.SqlQueryResponse; import org.elasticsearch.xpack.sql.proto.ColumnInfo; import java.sql.JDBCType; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlActionIT.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlActionIT.java index ef90e8ccd47..cbdf0e1ac98 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlActionIT.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlActionIT.java @@ -7,10 +7,7 @@ package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.WriteRequest; -import org.elasticsearch.xpack.sql.plugin.SqlQueryRequestBuilder; import org.elasticsearch.xpack.sql.proto.ColumnInfo; -import org.elasticsearch.xpack.sql.plugin.SqlQueryAction; -import org.elasticsearch.xpack.sql.plugin.SqlQueryResponse; import org.elasticsearch.xpack.sql.proto.Mode; import java.sql.JDBCType; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorActionIT.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorActionIT.java index 643372a21fe..de55d486555 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorActionIT.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlClearCursorActionIT.java @@ -8,12 +8,6 @@ package org.elasticsearch.xpack.sql.action; import org.elasticsearch.action.bulk.BulkRequestBuilder; import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.support.WriteRequest; -import org.elasticsearch.xpack.sql.plugin.SqlClearCursorAction; -import org.elasticsearch.xpack.sql.plugin.SqlClearCursorRequestBuilder; -import org.elasticsearch.xpack.sql.plugin.SqlClearCursorResponse; -import org.elasticsearch.xpack.sql.plugin.SqlQueryAction; -import org.elasticsearch.xpack.sql.plugin.SqlQueryRequestBuilder; -import org.elasticsearch.xpack.sql.plugin.SqlQueryResponse; import org.elasticsearch.xpack.sql.session.Cursor; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlDisabledIT.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlDisabledIT.java index 395a2b673f9..c50f1095164 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlDisabledIT.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlDisabledIT.java @@ -7,8 +7,6 @@ package org.elasticsearch.xpack.sql.action; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.xpack.core.XPackSettings; -import org.elasticsearch.xpack.sql.plugin.SqlQueryAction; -import org.elasticsearch.xpack.sql.plugin.SqlQueryRequestBuilder; import static org.hamcrest.CoreMatchers.either; import static org.hamcrest.CoreMatchers.startsWith; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlLicenseIT.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlLicenseIT.java index a755d2b4f59..df0875690a2 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlLicenseIT.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlLicenseIT.java @@ -21,12 +21,6 @@ import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.test.hamcrest.ElasticsearchAssertions; import org.elasticsearch.transport.Netty4Plugin; import org.elasticsearch.transport.nio.NioTransportPlugin; -import org.elasticsearch.xpack.sql.plugin.SqlQueryAction; -import org.elasticsearch.xpack.sql.plugin.SqlQueryRequestBuilder; -import org.elasticsearch.xpack.sql.plugin.SqlQueryResponse; -import org.elasticsearch.xpack.sql.plugin.SqlTranslateAction; -import org.elasticsearch.xpack.sql.plugin.SqlTranslateRequestBuilder; -import org.elasticsearch.xpack.sql.plugin.SqlTranslateResponse; import org.hamcrest.Matchers; import org.junit.Before; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateActionIT.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateActionIT.java index 2ef7c084d11..e413a590dfa 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateActionIT.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/action/SqlTranslateActionIT.java @@ -11,9 +11,6 @@ import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.fetch.subphase.DocValueFieldsContext; import org.elasticsearch.search.fetch.subphase.FetchSourceContext; import org.elasticsearch.search.sort.SortBuilders; -import org.elasticsearch.xpack.sql.plugin.SqlTranslateAction; -import org.elasticsearch.xpack.sql.plugin.SqlTranslateRequestBuilder; -import org.elasticsearch.xpack.sql.plugin.SqlTranslateResponse; import static java.util.Collections.singletonList; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/CursorTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/CursorTests.java index bac221df2e9..7eb4e5402cd 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/CursorTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/execution/search/CursorTests.java @@ -12,10 +12,10 @@ import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.client.Client; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.sql.SqlException; -import org.elasticsearch.xpack.sql.plugin.CliFormatter; +import org.elasticsearch.xpack.sql.action.CliFormatter; import org.elasticsearch.xpack.sql.plugin.CliFormatterCursor; import org.elasticsearch.xpack.sql.proto.ColumnInfo; -import org.elasticsearch.xpack.sql.plugin.SqlQueryResponse; +import org.elasticsearch.xpack.sql.action.SqlQueryResponse; import org.elasticsearch.xpack.sql.session.Configuration; import org.elasticsearch.xpack.sql.session.Cursor; import org.elasticsearch.xpack.sql.session.Cursors; diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/TextFormatTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/TextFormatTests.java index bf6ccbb225a..7a0f6dbca9d 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/TextFormatTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/plugin/TextFormatTests.java @@ -10,6 +10,7 @@ import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.rest.FakeRestRequest; +import org.elasticsearch.xpack.sql.action.SqlQueryResponse; import org.elasticsearch.xpack.sql.proto.ColumnInfo; import java.util.ArrayList; diff --git a/x-pack/qa/sql/build.gradle b/x-pack/qa/sql/build.gradle index 0bea3a9364b..4d061fffa91 100644 --- a/x-pack/qa/sql/build.gradle +++ b/x-pack/qa/sql/build.gradle @@ -89,7 +89,7 @@ subprojects { testRuntime "net.sourceforge.csvjdbc:csvjdbc:1.0.34" testRuntime "com.h2database:h2:1.4.197" testRuntime project(path: xpackModule('sql:jdbc'), configuration: 'nodeps') - testRuntime xpackProject('plugin:sql:sql-shared-client') + testRuntime xpackProject('plugin:sql:sql-client') // TODO check if needed @@ -99,7 +99,7 @@ subprojects { // CLI testing dependencies testRuntime project(path: xpackModule('sql:sql-cli'), configuration: 'nodeps') - testRuntime (xpackProject('plugin:sql:sql-proto')) { + testRuntime (xpackProject('plugin:sql:sql-action')) { transitive = false } testRuntime "org.jline:jline:3.6.0"