This is an automated email from the ASF dual-hosted git repository.
tledkov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 50947ba IGNITE-12886 Introduce separate SQL configuration (#7745)
50947ba is described below
commit 50947ba7a42ce6912ea944d1dc12752bcd9f333a
Author: tledkov <[email protected]>
AuthorDate: Fri May 15 12:23:16 2020 +0300
IGNITE-12886 Introduce separate SQL configuration (#7745)
---
.../internal/jdbc2/JdbcMetadataSelfTest.java | 3 +-
.../JdbcThinComplexDmlDdlCustomSchemaSelfTest.java | 3 +-
.../jdbc/thin/JdbcThinDefaultTimeoutTest.java | 3 +-
.../ignite/jdbc/thin/JdbcThinMetadataSelfTest.java | 5 +-
.../ignite/configuration/IgniteConfiguration.java | 110 ++++++++++-----
.../ignite/configuration/SqlConfiguration.java | 154 +++++++++++++++++++++
.../processors/query/QueryHistoryTracker.java | 4 +-
.../processors/query/RunningQueryManager.java | 6 +-
.../processors/query/h2/IgniteH2Indexing.java | 2 +-
.../query/h2/LongRunningQueryManager.java | 2 +-
.../internal/processors/query/h2/QueryParser.java | 2 +-
...acheDistributedQueryDefaultTimeoutSelfTest.java | 3 +-
...gniteCacheLocalQueryDefaultTimeoutSelfTest.java | 3 +-
.../cache/metric/SqlViewExporterSpiTest.java | 4 +-
.../processors/query/AbstractCustomSchemaTest.java | 5 +-
.../query/IgniteSqlCustomSchemaWithPdsEnabled.java | 5 +-
.../IgniteSqlSchemasDiffConfigurationsTest.java | 11 +-
.../IgniteSqlSkipReducerOnUpdateDmlSelfTest.java | 3 +-
.../processors/query/SqlQueryHistorySelfTest.java | 3 +-
.../processors/query/SqlSystemViewsSelfTest.java | 14 +-
20 files changed, 286 insertions(+), 59 deletions(-)
diff --git
a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
index f741444..0570be5 100755
---
a/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
+++
b/modules/clients/src/test/java/org/apache/ignite/internal/jdbc2/JdbcMetadataSelfTest.java
@@ -44,6 +44,7 @@ import
org.apache.ignite.cache.query.annotations.QuerySqlField;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.ConnectorConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.internal.IgniteVersionUtils;
import org.apache.ignite.internal.processors.query.QueryEntityEx;
import org.apache.ignite.internal.processors.query.QueryUtils;
@@ -98,7 +99,7 @@ public class JdbcMetadataSelfTest extends
GridCommonAbstractTest {
cfg.setConnectorConfiguration(new ConnectorConfiguration());
- cfg.setSqlSchemas("PREDEFINED_SCHEMAS_1", "PREDEFINED_SCHEMAS_2");
+ cfg.setSqlConfiguration(new
SqlConfiguration().setSqlSchemas("PREDEFINED_SCHEMAS_1",
"PREDEFINED_SCHEMAS_2"));
return cfg;
}
diff --git
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlCustomSchemaSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlCustomSchemaSelfTest.java
index 298150e..0ac8bea 100644
---
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlCustomSchemaSelfTest.java
+++
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinComplexDmlDdlCustomSchemaSelfTest.java
@@ -22,6 +22,7 @@ import org.apache.ignite.configuration.IgniteConfiguration;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.junit.Test;
/**
@@ -41,7 +42,7 @@ public class JdbcThinComplexDmlDdlCustomSchemaSelfTest
extends JdbcThinComplexDm
@Override protected IgniteConfiguration getConfiguration(String
igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
- cfg.setSqlSchemas(SCHEMA_1, SCHEMA_2);
+ cfg.setSqlConfiguration(new SqlConfiguration().setSqlSchemas(SCHEMA_1,
SCHEMA_2));
return cfg;
}
diff --git
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDefaultTimeoutTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDefaultTimeoutTest.java
index 40bb9a6..404900d 100644
---
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDefaultTimeoutTest.java
+++
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinDefaultTimeoutTest.java
@@ -28,6 +28,7 @@ import java.util.stream.IntStream;
import org.apache.ignite.cache.query.annotations.QuerySqlFunction;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
@@ -46,7 +47,7 @@ public class JdbcThinDefaultTimeoutTest extends
GridCommonAbstractTest {
return super.getConfiguration(igniteInstanceName)
.setCacheConfiguration(ccfg)
- .setDefaultQueryTimeout(100);
+ .setSqlConfiguration(new
SqlConfiguration().setDefaultQueryTimeout(100));
}
/** {@inheritDoc} */
diff --git
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
index 7d34d03..e8aeb58 100644
---
a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
+++
b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinMetadataSelfTest.java
@@ -44,6 +44,7 @@ import org.apache.ignite.cache.affinity.AffinityKey;
import org.apache.ignite.cache.query.annotations.QuerySqlField;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.internal.IgniteVersionUtils;
import org.apache.ignite.internal.jdbc2.JdbcUtils;
import org.apache.ignite.internal.processors.query.QueryEntityEx;
@@ -77,7 +78,9 @@ public class JdbcThinMetadataSelfTest extends
JdbcThinAbstractSelfTest {
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String
igniteInstanceName) throws Exception {
return super.getConfiguration(igniteInstanceName)
- .setSqlSchemas("PREDEFINED_SCHEMAS_1", "PREDEFINED_SCHEMAS_2")
+ .setSqlConfiguration(new SqlConfiguration()
+ .setSqlSchemas("PREDEFINED_SCHEMAS_1", "PREDEFINED_SCHEMAS_2")
+ )
.setMetricExporterSpi(new SqlViewMetricExporterSpi());
}
diff --git
a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
index 313d462..9a9810f 100644
---
a/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
+++
b/modules/core/src/main/java/org/apache/ignite/configuration/IgniteConfiguration.java
@@ -247,8 +247,13 @@ public class IgniteConfiguration {
@SuppressWarnings("UnnecessaryBoxing")
public static final Long DFLT_CLIENT_FAILURE_DETECTION_TIMEOUT = new
Long(30_000);
- /** Default timeout after which long query warning will be printed. */
- public static final long DFLT_LONG_QRY_WARN_TIMEOUT = 3000;
+ /**
+ * Default timeout after which long query warning will be printed.
+ *
+ * @deprecated Please use {@link
SqlConfiguration#DFLT_LONG_QRY_WARN_TIMEOUT}.
+ */
+ @Deprecated
+ public static final long DFLT_LONG_QRY_WARN_TIMEOUT =
SqlConfiguration.DFLT_LONG_QRY_WARN_TIMEOUT;
/** Default number of MVCC vacuum threads.. */
public static final int DFLT_MVCC_VACUUM_THREAD_CNT = 2;
@@ -256,11 +261,13 @@ public class IgniteConfiguration {
/** Default time interval between MVCC vacuum runs in milliseconds. */
public static final long DFLT_MVCC_VACUUM_FREQUENCY = 5000;
- /** Default SQL query history size. */
- public static final int DFLT_SQL_QUERY_HISTORY_SIZE = 1000;
-
- /** Default query timeout. */
- public static final long DFLT_QRY_TIMEOUT = 0;
+ /**
+ * Default SQL query history size.
+ *
+ * @deprecated Please use {@link
SqlConfiguration#DFLT_SQL_QUERY_HISTORY_SIZE}.
+ */
+ @Deprecated
+ public static final int DFLT_SQL_QUERY_HISTORY_SIZE =
SqlConfiguration.DFLT_SQL_QUERY_HISTORY_SIZE;
/** Optional local Ignite instance name. */
private String igniteInstanceName;
@@ -313,12 +320,6 @@ public class IgniteConfiguration {
/** Index create/rebuild pool size. */
private int buildIdxPoolSize = DFLT_BUILD_IDX_THREAD_POOL_SIZE;
- /** SQL query history size. */
- private int sqlQryHistSize = DFLT_SQL_QUERY_HISTORY_SIZE;
-
- /** Default query timeout. */
- private long dfltQryTimeout = DFLT_QRY_TIMEOUT;
-
/** Ignite installation folder. */
private String igniteHome;
@@ -579,9 +580,6 @@ public class IgniteConfiguration {
/** Cluster state on start. */
private ClusterState clusterStateOnStart;
- /** */
- private long longQryWarnTimeout = DFLT_LONG_QRY_WARN_TIMEOUT;
-
/** SQL connector configuration. */
@Deprecated
private SqlConnectorConfiguration sqlConnCfg;
@@ -604,12 +602,12 @@ public class IgniteConfiguration {
/** Communication failure resolver */
private CommunicationFailureResolver commFailureRslvr;
- /** SQL schemas to be created on node start. */
- private String[] sqlSchemas;
-
/** Plugin providers. */
private PluginProvider[] pluginProvs;
+ /** SQL configuration. */
+ private SqlConfiguration sqlCfg = new SqlConfiguration();
+
/**
* Creates valid grid configuration with all default values.
*/
@@ -670,7 +668,6 @@ public class IgniteConfiguration {
consistentId = cfg.getConsistentId();
daemon = cfg.isDaemon();
dataStreamerPoolSize = cfg.getDataStreamerThreadPoolSize();
- dfltQryTimeout = cfg.getDefaultQueryTimeout();
deployMode = cfg.getDeploymentMode();
discoStartupDelay = cfg.getDiscoveryStartupDelay();
execCfgs = cfg.getExecutorConfiguration();
@@ -687,7 +684,6 @@ public class IgniteConfiguration {
lifecycleBeans = cfg.getLifecycleBeans();
locHost = cfg.getLocalHost();
log = cfg.getGridLogger();
- longQryWarnTimeout = cfg.getLongQueryWarningTimeout();
lsnrs = cfg.getLocalEventListeners();
marsh = cfg.getMarshaller();
marshLocJobs = cfg.isMarshalLocalJobs();
@@ -725,8 +721,6 @@ public class IgniteConfiguration {
sndRetryCnt = cfg.getNetworkSendRetryCount();
sndRetryDelay = cfg.getNetworkSendRetryDelay();
sqlConnCfg = cfg.getSqlConnectorConfiguration();
- sqlQryHistSize = cfg.getSqlQueryHistorySize();
- sqlSchemas = cfg.getSqlSchemas();
sslCtxFactory = cfg.getSslContextFactory();
storeSesLsnrs = cfg.getCacheStoreSessionListenerFactories();
stripedPoolSize = cfg.getStripedPoolSize();
@@ -742,6 +736,7 @@ public class IgniteConfiguration {
utilityCachePoolSize = cfg.getUtilityCacheThreadPoolSize();
waitForSegOnStart = cfg.isWaitForSegmentOnStart();
warmupClos = cfg.getWarmupClosure();
+ sqlCfg = cfg.getSqlConfiguration();
}
/**
@@ -1128,24 +1123,30 @@ public class IgniteConfiguration {
/**
* Number of SQL query history elements to keep in memory. If not
provided, then default value {@link
- * #DFLT_SQL_QUERY_HISTORY_SIZE} is used. If provided value is less or
equals 0, then gathering SQL query history
+ * SqlConfiguration#DFLT_SQL_QUERY_HISTORY_SIZE} is used. If provided
value is less or equals 0, then gathering SQL query history
* will be switched off.
*
* @return SQL query history size.
+ *
+ * @deprecated Use {@link SqlConfiguration#setSqlQueryHistorySize(int)}
instead.
*/
+ @Deprecated
public int getSqlQueryHistorySize() {
- return sqlQryHistSize;
+ return sqlCfg.getSqlQueryHistorySize();
}
/**
* Sets number of SQL query history elements kept in memory. If not
explicitly set, then default value is {@link
- * #DFLT_SQL_QUERY_HISTORY_SIZE}.
+ * SqlConfiguration#DFLT_SQL_QUERY_HISTORY_SIZE}.
*
* @param size Number of SQL query history elements kept in memory.
* @return {@code this} for chaining.
+ *
+ * @deprecated Use {@link SqlConfiguration#getSqlQueryHistorySize()}
instead.
*/
+ @Deprecated
public IgniteConfiguration setSqlQueryHistorySize(int size) {
- sqlQryHistSize = size;
+ sqlCfg.setSqlQueryHistorySize(size);
return this;
}
@@ -1153,14 +1154,17 @@ public class IgniteConfiguration {
/**
* Defines the default query timeout.
*
- * Defaults to {@link #DFLT_QRY_TIMEOUT}.
+ * Defaults to {@link SqlConfiguration#DFLT_QRY_TIMEOUT}.
* {@code 0} means there is no timeout (this
* is a default value)
*
* @return Default query timeout.
+ *
+ * @deprecated Use {@link SqlConfiguration#getDefaultQueryTimeout()}
instead.
*/
+ @Deprecated
public long getDefaultQueryTimeout() {
- return dfltQryTimeout;
+ return sqlCfg.getDefaultQueryTimeout();
}
/**
@@ -1170,10 +1174,12 @@ public class IgniteConfiguration {
*
* @param dfltQryTimeout Timeout in milliseconds.
* @return {@code this} for chaining.
+ *
+ * @deprecated Use {@link SqlConfiguration#setDefaultQueryTimeout(long)}
instead.
*/
+ @Deprecated
public IgniteConfiguration setDefaultQueryTimeout(long dfltQryTimeout) {
- A.ensure(dfltQryTimeout >= 0 && dfltQryTimeout <= Integer.MAX_VALUE,
"default query timeout value should be valid Integer.");
- this.dfltQryTimeout = dfltQryTimeout;
+ sqlCfg.setDefaultQueryTimeout(dfltQryTimeout);
return this;
}
@@ -3412,9 +3418,12 @@ public class IgniteConfiguration {
* Gets timeout in milliseconds after which long query warning will be
printed.
*
* @return Timeout in milliseconds.
+ *
+ * @deprecated Use {@link SqlConfiguration#getLongQueryWarningTimeout()}
instead.
*/
+ @Deprecated
public long getLongQueryWarningTimeout() {
- return longQryWarnTimeout;
+ return sqlCfg.getLongQueryWarningTimeout();
}
/**
@@ -3422,9 +3431,12 @@ public class IgniteConfiguration {
*
* @param longQryWarnTimeout Timeout in milliseconds.
* @return {@code this} for chaining.
+ *
+ * @deprecated Use {@link
SqlConfiguration#setLongQueryWarningTimeout(long)} instead.
*/
+ @Deprecated
public IgniteConfiguration setLongQueryWarningTimeout(long
longQryWarnTimeout) {
- this.longQryWarnTimeout = longQryWarnTimeout;
+ sqlCfg.setLongQueryWarningTimeout(longQryWarnTimeout);
return this;
}
@@ -3578,9 +3590,12 @@ public class IgniteConfiguration {
* See {@link #setSqlSchemas(String...)} for more information.
*
* @return SQL schemas to be created on node startup.
+ *
+ * @deprecated Use {@link SqlConfiguration#getSqlSchemas()} instead.
*/
+ @Deprecated
public String[] getSqlSchemas() {
- return sqlSchemas;
+ return sqlCfg.getSqlSchemas();
}
/**
@@ -3594,9 +3609,12 @@ public class IgniteConfiguration {
*
* @param sqlSchemas SQL schemas to be created on node startup.
* @return {@code this} for chaining.
+ *
+ * @deprecated Use {@link SqlConfiguration#setSqlSchemas(String...)}
instead.
*/
+ @Deprecated
public IgniteConfiguration setSqlSchemas(String... sqlSchemas) {
- this.sqlSchemas = sqlSchemas;
+ sqlCfg.setSqlSchemas(sqlSchemas);
return this;
}
@@ -3622,6 +3640,28 @@ public class IgniteConfiguration {
return this;
}
+ /**
+ * Gets Configuration of the SQL subsystem.
+ *
+ * @return SQL configuration.
+ */
+ public SqlConfiguration getSqlConfiguration() {
+ return sqlCfg;
+ }
+
+ /**
+ * @param sqlCfg Configuration of the SQL subsystem.
+ *
+ * @return {@code this} for chaining.
+ */
+ public IgniteConfiguration setSqlConfiguration(SqlConfiguration sqlCfg) {
+ A.ensure(sqlCfg != null, "SQL configuration cannot be null");
+
+ this.sqlCfg = sqlCfg;
+
+ return this;
+ }
+
/** {@inheritDoc} */
@Override public String toString() {
return S.toString(IgniteConfiguration.class, this);
diff --git
a/modules/core/src/main/java/org/apache/ignite/configuration/SqlConfiguration.java
b/modules/core/src/main/java/org/apache/ignite/configuration/SqlConfiguration.java
new file mode 100644
index 0000000..e3dd475
--- /dev/null
+++
b/modules/core/src/main/java/org/apache/ignite/configuration/SqlConfiguration.java
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.configuration;
+
+import org.apache.ignite.internal.util.typedef.internal.A;
+import org.apache.ignite.internal.util.typedef.internal.S;
+
+/**
+ * The configuration of the SQL query subsystem.
+ */
+public class SqlConfiguration {
+ /** Default SQL query history size. */
+ public static final int DFLT_SQL_QUERY_HISTORY_SIZE = 1000;
+
+ /** Default query timeout. */
+ public static final long DFLT_QRY_TIMEOUT = 0;
+
+ /** Default timeout after which long query warning will be printed. */
+ public static final long DFLT_LONG_QRY_WARN_TIMEOUT = 3000;
+
+ /** */
+ private long longQryWarnTimeout = DFLT_LONG_QRY_WARN_TIMEOUT;
+
+ /** Default query timeout. */
+ private long dfltQryTimeout = DFLT_QRY_TIMEOUT;
+
+ /** SQL schemas to be created on node start. */
+ private String[] sqlSchemas;
+
+ /** SQL query history size. */
+ private int sqlQryHistSize = DFLT_SQL_QUERY_HISTORY_SIZE;
+
+ /**
+ * Defines the default query timeout.
+ *
+ * Defaults to {@link #DFLT_QRY_TIMEOUT}.
+ * {@code 0} means there is no timeout (this is a default value)
+ *
+ * @return Default query timeout.
+ */
+ public long getDefaultQueryTimeout() {
+ return dfltQryTimeout;
+ }
+
+ /**
+ * Sets timeout in milliseconds for default query timeout.
+ * {@code 0} means there is no timeout (this is a default value)
+ *
+ * @param dfltQryTimeout Timeout in milliseconds.
+ * @return {@code this} for chaining.
+ */
+ public SqlConfiguration setDefaultQueryTimeout(long dfltQryTimeout) {
+ A.ensure(dfltQryTimeout >= 0 && dfltQryTimeout <= Integer.MAX_VALUE,
+ "default query timeout value should be valid Integer.");
+
+ this.dfltQryTimeout = dfltQryTimeout;
+
+ return this;
+ }
+
+ /**
+ * Number of SQL query history elements to keep in memory. If not
provided, then default value {@link
+ * #DFLT_SQL_QUERY_HISTORY_SIZE} is used. If provided value is less or
equals 0, then gathering SQL query history
+ * will be switched off.
+ *
+ * @return SQL query history size.
+ */
+ public int getSqlQueryHistorySize() {
+ return sqlQryHistSize;
+ }
+
+ /**
+ * Sets number of SQL query history elements kept in memory. If not
explicitly set, then default value is {@link
+ * #DFLT_SQL_QUERY_HISTORY_SIZE}.
+ *
+ * @param size Number of SQL query history elements kept in memory.
+ * @return {@code this} for chaining.
+ */
+ public SqlConfiguration setSqlQueryHistorySize(int size) {
+ sqlQryHistSize = size;
+
+ return this;
+ }
+
+ /**
+ * Gets SQL schemas to be created on node startup.
+ * <p>
+ * See {@link #setSqlSchemas(String...)} for more information.
+ *
+ * @return SQL schemas to be created on node startup.
+ */
+ public String[] getSqlSchemas() {
+ return sqlSchemas;
+ }
+
+ /**
+ * Sets SQL schemas to be created on node startup. Schemas are created on
local node only and are not propagated
+ * to other cluster nodes. Created schemas cannot be dropped.
+ * <p>
+ * By default schema names are case-insensitive, i.e. {@code my_schema}
and {@code My_Schema} represents the same
+ * object. Use quotes to enforce case sensitivity (e.g. {@code
"My_Schema"}).
+ * <p>
+ * Property is ignored if {@code ignite-indexing} module is not in
classpath.
+ *
+ * @param sqlSchemas SQL schemas to be created on node startup.
+ * @return {@code this} for chaining.
+ */
+ public SqlConfiguration setSqlSchemas(String... sqlSchemas) {
+ this.sqlSchemas = sqlSchemas;
+
+ return this;
+ }
+
+ /**
+ * Gets timeout in milliseconds after which long query warning will be
printed.
+ *
+ * @return Timeout in milliseconds.
+ */
+ public long getLongQueryWarningTimeout() {
+ return longQryWarnTimeout;
+ }
+
+ /**
+ * Sets timeout in milliseconds after which long query warning will be
printed.
+ *
+ * @param longQryWarnTimeout Timeout in milliseconds.
+ * @return {@code this} for chaining.
+ */
+ public SqlConfiguration setLongQueryWarningTimeout(long
longQryWarnTimeout) {
+ this.longQryWarnTimeout = longQryWarnTimeout;
+
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return S.toString(SqlConfiguration.class, this);
+ }
+}
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryHistoryTracker.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryHistoryTracker.java
index 3bb2b26..cb7f9ca 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryHistoryTracker.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryHistoryTracker.java
@@ -21,7 +21,7 @@ package org.apache.ignite.internal.processors.query;
import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.jsr166.ConcurrentLinkedDeque8;
import org.jsr166.ConcurrentLinkedDeque8.Node;
@@ -137,7 +137,7 @@ class QueryHistoryTracker {
/**
* Gets SQL query history. Size of history could be configured via
- * {@link IgniteConfiguration#setSqlQueryHistorySize(int)}.
+ * {@link SqlConfiguration#setSqlQueryHistorySize(int)}.
*
* @return SQL queries history aggregated by query text, schema and local
flag.
*/
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/RunningQueryManager.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/RunningQueryManager.java
index 361e383..9ba7938 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/RunningQueryManager.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/RunningQueryManager.java
@@ -26,7 +26,7 @@ import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicLong;
-import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.internal.GridKernalContext;
import
org.apache.ignite.internal.managers.systemview.walker.SqlQueryHistoryViewWalker;
import
org.apache.ignite.internal.managers.systemview.walker.SqlQueryViewWalker;
@@ -97,7 +97,7 @@ public class RunningQueryManager {
public RunningQueryManager(GridKernalContext ctx) {
localNodeId = ctx.localNodeId();
- histSz = ctx.config().getSqlQueryHistorySize();
+ histSz = ctx.config().getSqlConfiguration().getSqlQueryHistorySize();
qryHistTracker = new QueryHistoryTracker(histSz);
@@ -272,7 +272,7 @@ public class RunningQueryManager {
/**
* Gets query history statistics. Size of history could be configured via
{@link
- * IgniteConfiguration#setSqlQueryHistorySize(int)}
+ * SqlConfiguration#setSqlQueryHistorySize(int)}
*
* @return Queries history statistics aggregated by query text, schema and
local flag.
*/
diff --git
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
index 626e21a..48990fd 100644
---
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
+++
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
@@ -2103,7 +2103,7 @@ public class IgniteH2Indexing implements
GridQueryIndexing {
parser = new QueryParser(this, connMgr);
schemaMgr = new SchemaManager(ctx, connMgr);
- schemaMgr.start(ctx.config().getSqlSchemas());
+ schemaMgr.start(ctx.config().getSqlConfiguration().getSqlSchemas());
nodeId = ctx.localNodeId();
marshaller = ctx.config().getMarshaller();
diff --git
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/LongRunningQueryManager.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/LongRunningQueryManager.java
index e7e775e..3500597 100644
---
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/LongRunningQueryManager.java
+++
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/LongRunningQueryManager.java
@@ -95,7 +95,7 @@ public final class LongRunningQueryManager {
}
};
- timeout = ctx.config().getLongQueryWarningTimeout();
+ timeout =
ctx.config().getSqlConfiguration().getLongQueryWarningTimeout();
IgniteThread thread = new IgniteThread(checkWorker);
diff --git
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParser.java
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParser.java
index d7580c3..76b84a4 100644
---
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParser.java
+++
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/QueryParser.java
@@ -169,7 +169,7 @@ public class QueryParser {
if (qry.getTimeout() >= 0)
timeout = qry.getTimeout();
else
- timeout =
(int)idx.kernalContext().config().getDefaultQueryTimeout();
+ timeout =
(int)idx.kernalContext().config().getSqlConfiguration().getDefaultQueryTimeout();
return new QueryParameters(
qry.getArgs(),
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedQueryDefaultTimeoutSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedQueryDefaultTimeoutSelfTest.java
index ccad8af..612e63d 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedQueryDefaultTimeoutSelfTest.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/distributed/near/IgniteCacheDistributedQueryDefaultTimeoutSelfTest.java
@@ -31,6 +31,7 @@ import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.cache.query.QueryCancelledException;
import org.apache.ignite.internal.processors.GridProcessor;
@@ -80,7 +81,7 @@ public class
IgniteCacheDistributedQueryDefaultTimeoutSelfTest extends GridCommo
ccfg.setIndexedTypes(Integer.class, String.class);
cfg.setCacheConfiguration(ccfg);
- cfg.setDefaultQueryTimeout(DEFAULT_QUERY_TIMEOUT);
+ cfg.setSqlConfiguration(new
SqlConfiguration().setDefaultQueryTimeout(DEFAULT_QUERY_TIMEOUT));
return cfg;
}
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalQueryDefaultTimeoutSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalQueryDefaultTimeoutSelfTest.java
index de80105..62475a1 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalQueryDefaultTimeoutSelfTest.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/local/IgniteCacheLocalQueryDefaultTimeoutSelfTest.java
@@ -27,6 +27,7 @@ import org.apache.ignite.cache.query.QueryCursor;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.internal.util.typedef.X;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
@@ -55,7 +56,7 @@ public class IgniteCacheLocalQueryDefaultTimeoutSelfTest
extends GridCommonAbstr
ccfg.setCacheMode(LOCAL);
cfg.setCacheConfiguration(ccfg);
- cfg.setDefaultQueryTimeout(DEFAULT_QUERY_TIMEOUT);
+ cfg.setSqlConfiguration(new
SqlConfiguration().setDefaultQueryTimeout(DEFAULT_QUERY_TIMEOUT));
return cfg;
}
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java
index 76dd922..f95e063 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/metric/SqlViewExporterSpiTest.java
@@ -46,6 +46,7 @@ import org.apache.ignite.configuration.ClientConfiguration;
import org.apache.ignite.configuration.DataRegionConfiguration;
import org.apache.ignite.configuration.DataStorageConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.metric.AbstractExporterSpiTest;
import org.apache.ignite.internal.metric.SystemViewSelfTest.TestPredicate;
@@ -375,7 +376,8 @@ public class SqlViewExporterSpiTest extends
AbstractExporterSpiTest {
/** */
@Test
public void testSchemas() throws Exception {
- try (IgniteEx g = startGrid(new
IgniteConfiguration().setSqlSchemas("MY_SCHEMA", "ANOTHER_SCHEMA"))) {
+ try (IgniteEx g = startGrid(new
IgniteConfiguration().setSqlConfiguration(new SqlConfiguration()
+ .setSqlSchemas("MY_SCHEMA", "ANOTHER_SCHEMA")))) {
SystemView<SqlSchemaView> schemasSysView =
g.context().systemView().view(SQL_SCHEMA_VIEW);
Set<String> schemaFromSysView = new HashSet<>();
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/AbstractCustomSchemaTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/AbstractCustomSchemaTest.java
index c32dbb48..adae201 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/AbstractCustomSchemaTest.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/AbstractCustomSchemaTest.java
@@ -23,6 +23,7 @@ import java.util.Collections;
import java.util.List;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import
org.apache.ignite.internal.processors.cache.index.AbstractIndexingCommonTest;
import org.apache.ignite.testframework.GridTestUtils;
import org.junit.After;
@@ -68,7 +69,9 @@ public abstract class AbstractCustomSchemaTest extends
AbstractIndexingCommonTes
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String
igniteInstanceName) throws Exception {
return super.getConfiguration(igniteInstanceName)
- .setSqlSchemas(SCHEMA_NAME_1, SCHEMA_NAME_2, q(SCHEMA_NAME_3))
+ .setSqlConfiguration(new SqlConfiguration()
+ .setSqlSchemas(SCHEMA_NAME_1, SCHEMA_NAME_2, q(SCHEMA_NAME_3))
+ )
.setCacheConfiguration(new
CacheConfiguration(CACHE_NAME).setSqlSchema(SCHEMA_NAME_4));
}
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java
index d04bdd2..fe25de5 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlCustomSchemaWithPdsEnabled.java
@@ -24,6 +24,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.DataRegionConfiguration;
import org.apache.ignite.configuration.DataStorageConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.internal.IgniteEx;
import
org.apache.ignite.internal.processors.cache.index.AbstractIndexingCommonTest;
import org.junit.After;
@@ -67,7 +68,9 @@ public class IgniteSqlCustomSchemaWithPdsEnabled extends
AbstractIndexingCommonT
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String
igniteInstanceName) throws Exception {
return super.getConfiguration(igniteInstanceName)
- .setSqlSchemas(SCHEMA_NAME_1, SCHEMA_NAME_2, q(SCHEMA_NAME_3))
+ .setSqlConfiguration(new SqlConfiguration()
+ .setSqlSchemas(SCHEMA_NAME_1, SCHEMA_NAME_2, q(SCHEMA_NAME_3))
+ )
.setDataStorageConfiguration(
new
DataStorageConfiguration().setDefaultDataRegionConfiguration(
new
DataRegionConfiguration().setPersistenceEnabled(true)));
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemasDiffConfigurationsTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemasDiffConfigurationsTest.java
index 1fce5a9..7721865 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemasDiffConfigurationsTest.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSchemasDiffConfigurationsTest.java
@@ -22,6 +22,7 @@ import java.util.List;
import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import
org.apache.ignite.internal.processors.cache.index.AbstractIndexingCommonTest;
import org.junit.After;
import org.junit.Assert;
@@ -55,9 +56,15 @@ public class IgniteSqlSchemasDiffConfigurationsTest extends
AbstractIndexingComm
/** */
@Test
public void testDiffSqlSchemasCfgProp() throws Exception {
- startGrid(getConfiguration("ign1").setSqlSchemas(SCHEMA_NAME_1,
SCHEMA_NAME_2));
+ startGrid(getConfiguration("ign1")
+ .setSqlConfiguration(new SqlConfiguration()
+ .setSqlSchemas(SCHEMA_NAME_1, SCHEMA_NAME_2))
+ );
- startGrid(getConfiguration("ign2").setSqlSchemas(SCHEMA_NAME_3,
SCHEMA_NAME_4));
+ startGrid(getConfiguration("ign2")
+ .setSqlConfiguration(new SqlConfiguration()
+ .setSqlSchemas(SCHEMA_NAME_3, SCHEMA_NAME_4))
+ );
List<List<String>> exp = Arrays.asList(
Arrays.asList(SCHEMA_NAME_1, "cache_1"),
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
index 744c70d..7440759 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlSkipReducerOnUpdateDmlSelfTest.java
@@ -40,6 +40,7 @@ import
org.apache.ignite.cache.query.annotations.QuerySqlField;
import org.apache.ignite.cache.query.annotations.QuerySqlFunction;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.events.CacheQueryExecutedEvent;
import org.apache.ignite.events.Event;
import org.apache.ignite.events.EventType;
@@ -95,7 +96,7 @@ public class IgniteSqlSkipReducerOnUpdateDmlSelfTest extends
AbstractIndexingCom
ccfgs.add(buildCacheConfiguration(CACHE_POSITION));
c.setCacheConfiguration(ccfgs.toArray(new
CacheConfiguration[ccfgs.size()]));
- c.setLongQueryWarningTimeout(10000);
+ c.setSqlConfiguration(new
SqlConfiguration().setLongQueryWarningTimeout(10000));
c.setIncludeEventTypes(EventType.EVTS_ALL);
return c;
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlQueryHistorySelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlQueryHistorySelfTest.java
index a4327d6..0142b9e 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlQueryHistorySelfTest.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlQueryHistorySelfTest.java
@@ -37,6 +37,7 @@ import org.apache.ignite.cache.query.TextQuery;
import org.apache.ignite.cache.query.annotations.QuerySqlFunction;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.processors.query.h2.IgniteH2Indexing;
@@ -114,7 +115,7 @@ public class SqlQueryHistorySelfTest extends
GridCommonAbstractTest {
cfg.setCacheConfiguration(configureCache("A"), configureCache("B"));
- cfg.setSqlQueryHistorySize(QUERY_HISTORY_SIZE);
+ cfg.setSqlConfiguration(new
SqlConfiguration().setSqlQueryHistorySize(QUERY_HISTORY_SIZE));
return cfg;
}
diff --git
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSystemViewsSelfTest.java
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSystemViewsSelfTest.java
index 4a25e2c..f07f707 100644
---
a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSystemViewsSelfTest.java
+++
b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/SqlSystemViewsSelfTest.java
@@ -56,6 +56,7 @@ import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.DataRegionConfiguration;
import org.apache.ignite.configuration.DataStorageConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.configuration.SqlConfiguration;
import org.apache.ignite.configuration.TopologyValidator;
import org.apache.ignite.internal.ClusterMetricsSnapshot;
import org.apache.ignite.internal.IgniteEx;
@@ -195,10 +196,17 @@ public class SqlSystemViewsSelfTest extends
AbstractIndexingCommonTest {
*/
@Test
public void testSchemasView() throws Exception {
- IgniteEx srv =
startGrid(getConfiguration().setSqlSchemas("PREDIFINED_SCHEMA_1"));
+ IgniteEx srv = startGrid(getConfiguration()
+ .setSqlConfiguration(new SqlConfiguration()
+ .setSqlSchemas("PREDIFINED_SCHEMA_1")
+ )
+ );
- IgniteEx client =
-
startClientGrid(getConfiguration().setIgniteInstanceName("CLIENT").setSqlSchemas("PREDIFINED_SCHEMA_2"));
+ IgniteEx client =
startClientGrid(getConfiguration().setIgniteInstanceName("CLIENT")
+ .setSqlConfiguration(new SqlConfiguration()
+ .setSqlSchemas("PREDIFINED_SCHEMA_2")
+ )
+ );
srv.createCache(cacheConfiguration("TST1"));