Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL: Refactor package names of sql-proto and sql-shared-proto projects #31622

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x-pack/plugin/security/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
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;

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugin/sql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
12 changes: 6 additions & 6 deletions x-pack/plugin/sql/jdbc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand All @@ -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'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -39,10 +39,10 @@
* 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.
*/
Expand All @@ -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).
Expand Down Expand Up @@ -235,4 +235,4 @@ private static PrintStream stdout() {
private static PrintStream stderr() {
return System.err;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -56,16 +56,16 @@ void logException(Method m, Object[] args, Throwable t) {
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++) {
Expand Down Expand Up @@ -97,4 +97,4 @@ private static String handleArray(Object o) {
}
return String.valueOf(o);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -22,8 +22,8 @@
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -127,4 +127,4 @@ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
private void close() {
Debug.close();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -117,4 +117,4 @@ public <T> T unwrap(Class<T> iface) throws SQLException {
}
throw new SQLException();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
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;
Expand All @@ -23,7 +23,7 @@
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
152 changes: 152 additions & 0 deletions x-pack/plugin/sql/sql-action/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
]
Loading