You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/06/01 15:44:24 UTC
[17/25] ignite git commit: IGNITE-5320: Removed unused parameter from
IgniteH2Indexing.executeSqlQueryWithTimer method.
IGNITE-5320: Removed unused parameter from IgniteH2Indexing.executeSqlQueryWithTimer method.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/802562ec
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/802562ec
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/802562ec
Branch: refs/heads/ignite-5075-pds
Commit: 802562ecad31e7c6dedc55327179a5aa4a390dc7
Parents: dc78026
Author: devozerov <vo...@gridgain.com>
Authored: Thu Jun 1 16:13:06 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Thu Jun 1 16:13:06 2017 +0300
----------------------------------------------------------------------
.../processors/query/h2/IgniteH2Indexing.java | 28 +++++++-------------
.../query/h2/twostep/GridMapQueryExecutor.java | 2 +-
.../h2/twostep/GridReduceQueryExecutor.java | 15 +++++------
3 files changed, 16 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/802562ec/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/IgniteH2Indexing.java
----------------------------------------------------------------------
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 ca591c1..50c8e41 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
@@ -839,7 +839,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
runs.putIfAbsent(run.id(), run);
try {
- ResultSet rs = executeSqlQueryWithTimer(schemaName, stmt, conn, qry, params, timeout, cancel);
+ ResultSet rs = executeSqlQueryWithTimer(stmt, conn, qry, params, timeout, cancel);
return new H2FieldsIterator(rs);
}
@@ -943,8 +943,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
/**
* Executes sql query and prints warning if query is too slow..
*
- * @param schema Schema.
- * @param conn Connection,.
+ * @param conn Connection,
* @param sql Sql query.
* @param params Parameters.
* @param useStmtCache If {@code true} uses stmt cache.
@@ -952,21 +951,15 @@ public class IgniteH2Indexing implements GridQueryIndexing {
* @return Result.
* @throws IgniteCheckedException If failed.
*/
- public ResultSet executeSqlQueryWithTimer(String schema,
- Connection conn,
- String sql,
- @Nullable Collection<Object> params,
- boolean useStmtCache,
- int timeoutMillis,
- @Nullable GridQueryCancel cancel) throws IgniteCheckedException {
- return executeSqlQueryWithTimer(schema, preparedStatementWithParams(conn, sql, params, useStmtCache),
+ public ResultSet executeSqlQueryWithTimer(Connection conn, String sql, @Nullable Collection<Object> params,
+ boolean useStmtCache, int timeoutMillis, @Nullable GridQueryCancel cancel) throws IgniteCheckedException {
+ return executeSqlQueryWithTimer(preparedStatementWithParams(conn, sql, params, useStmtCache),
conn, sql, params, timeoutMillis, cancel);
}
/**
* Executes sql query and prints warning if query is too slow.
*
- * @param schema Schema.
* @param stmt Prepared statement for query.
* @param conn Connection.
* @param sql Sql query.
@@ -975,12 +968,9 @@ public class IgniteH2Indexing implements GridQueryIndexing {
* @return Result.
* @throws IgniteCheckedException If failed.
*/
- private ResultSet executeSqlQueryWithTimer(String schema, PreparedStatement stmt,
- Connection conn,
- String sql,
- @Nullable Collection<Object> params,
- int timeoutMillis,
- @Nullable GridQueryCancel cancel) throws IgniteCheckedException {
+ private ResultSet executeSqlQueryWithTimer(PreparedStatement stmt, Connection conn, String sql,
+ @Nullable Collection<Object> params, int timeoutMillis, @Nullable GridQueryCancel cancel)
+ throws IgniteCheckedException {
long start = U.currentTimeMillis();
try {
@@ -1135,7 +1125,7 @@ public class IgniteH2Indexing implements GridQueryIndexing {
runs.put(run.id(), run);
try {
- ResultSet rs = executeSqlQueryWithTimer(schemaName, conn, sql, params, true, 0, cancel);
+ ResultSet rs = executeSqlQueryWithTimer(conn, sql, params, true, 0, cancel);
return new H2KeyValueIterator(rs);
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/802562ec/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index afaf68d..23504ad 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -610,7 +610,7 @@ public class GridMapQueryExecutor {
// If we are not the target node for this replicated query, just ignore it.
if (qry.node() == null ||
(segmentId == 0 && qry.node().equals(ctx.localNodeId()))) {
- rs = h2.executeSqlQueryWithTimer(h2.schema(mainCctx.name()), conn, qry.query(),
+ rs = h2.executeSqlQueryWithTimer(conn, qry.query(),
F.asList(qry.parameters(params)), true,
timeout,
qr.cancels[qryIdx]);
http://git-wip-us.apache.org/repos/asf/ignite/blob/802562ec/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 5c8870e..2d12635 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -791,12 +791,11 @@ public class GridReduceQueryExecutor {
try {
if (qry.explain())
- return explainPlan(r.connection(), schemaName, qry, params);
+ return explainPlan(r.connection(), qry, params);
GridCacheSqlQuery rdc = qry.reduceQuery();
- ResultSet res = h2.executeSqlQueryWithTimer(schemaName,
- r.connection(),
+ ResultSet res = h2.executeSqlQueryWithTimer(r.connection(),
rdc.query(),
F.asList(rdc.parameters(params)),
false, // The statement will cache some extra thread local objects.
@@ -1210,19 +1209,18 @@ public class GridReduceQueryExecutor {
/**
* @param c Connection.
- * @param schema Schema.
* @param qry Query.
* @param params Query parameters.
* @return Cursor for plans.
* @throws IgniteCheckedException if failed.
*/
- private Iterator<List<?>> explainPlan(JdbcConnection c, String schema, GridCacheTwoStepQuery qry, Object[] params)
+ private Iterator<List<?>> explainPlan(JdbcConnection c, GridCacheTwoStepQuery qry, Object[] params)
throws IgniteCheckedException {
List<List<?>> lists = new ArrayList<>();
for (int i = 0, mapQrys = qry.mapQueries().size(); i < mapQrys; i++) {
- ResultSet rs = h2.executeSqlQueryWithTimer(schema, c,
- "SELECT PLAN FROM " + mergeTableIdentifier(i), null, false, 0, null);
+ ResultSet rs =
+ h2.executeSqlQueryWithTimer(c, "SELECT PLAN FROM " + mergeTableIdentifier(i), null, false, 0, null);
lists.add(F.asList(getPlan(rs)));
}
@@ -1237,8 +1235,7 @@ public class GridReduceQueryExecutor {
GridCacheSqlQuery rdc = qry.reduceQuery();
- ResultSet rs = h2.executeSqlQueryWithTimer(schema,
- c,
+ ResultSet rs = h2.executeSqlQueryWithTimer(c,
"EXPLAIN " + rdc.query(),
F.asList(rdc.parameters(params)),
false,