diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java index 7839badbd9d96..9493fcb970159 100644 --- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java +++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/CalciteQueryProcessorTest.java @@ -437,16 +437,16 @@ public void union() throws Exception { QueryEngine engine = Commons.lookupComponent(grid(1).context(), QueryEngine.class); - List>> query = engine.query(null, "PUBLIC", + List>> qry = engine.query(null, "PUBLIC", "SELECT * FROM employer1 " + "UNION " + "SELECT * FROM employer2 " + "UNION " + "SELECT * FROM employer3 "); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - List> rows = query.get(0).getAll(); + List> rows = qry.get(0).getAll(); assertEquals(3, rows.size()); } @@ -695,12 +695,12 @@ public void aggregate() throws Exception { QueryEngine engine = Commons.lookupComponent(grid(1).context(), QueryEngine.class); - List>> query = engine.query(null, "PUBLIC", + List>> qry = engine.query(null, "PUBLIC", "SELECT * FROM employer WHERE employer.salary = (SELECT AVG(employer.salary) FROM employer)"); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - List> rows = query.get(0).getAll(); + List> rows = qry.get(0).getAll(); assertEquals(1, rows.size()); assertEquals(Arrays.asList("Roman", 15d), F.first(rows)); } @@ -768,12 +768,12 @@ public void query() throws Exception { QueryEngine engine = Commons.lookupComponent(grid(1).context(), QueryEngine.class); - List>> query = engine.query(null, "PUBLIC", + List>> qry = engine.query(null, "PUBLIC", "select * from DEVELOPER d, PROJECT p where d.projectId = p._key and d._key = ?", 0); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - assertEqualsCollections(Arrays.asList("Igor", 1, "Calcite"), F.first(query.get(0).getAll())); + assertEqualsCollections(Arrays.asList("Igor", 1, "Calcite"), F.first(qry.get(0).getAll())); } /** */ @@ -801,12 +801,12 @@ public void query2() { QueryEngine engine = Commons.lookupComponent(grid(1).context(), QueryEngine.class); - List>> query = engine.query(null, "PUBLIC", + List>> qry = engine.query(null, "PUBLIC", "select * from DEVELOPER d, PROJECT p where d.projectId = p._key and d._key = ?", 0); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - assertEqualsCollections(Arrays.asList("Igor", 1, "Calcite"), F.first(query.get(0).getAll())); + assertEqualsCollections(Arrays.asList("Igor", 1, "Calcite"), F.first(qry.get(0).getAll())); } /** */ @@ -838,17 +838,17 @@ public void queryMultiStatement() throws Exception { QueryEngine engine = Commons.lookupComponent(grid(1).context(), QueryEngine.class); - List>> query = engine.query(null, "PUBLIC", + List>> qry = engine.query(null, "PUBLIC", "" + "select * from DEVELOPER d, PROJECT p where d.projectId = p._key and d._key = ?;" + "select * from DEVELOPER d, PROJECT p where d.projectId = p._key and d._key = 10;" + "select * from DEVELOPER d, PROJECT p where d.projectId = p._key and d._key = ?", 0, 1); - assertEquals(3, query.size()); + assertEquals(3, qry.size()); - assertEqualsCollections(Arrays.asList("Igor", 1, "Calcite"), F.first(query.get(0).getAll())); - assertEquals(0, query.get(1).getAll().size()); - assertEqualsCollections(Arrays.asList("Roman", 0, "Ignite"), F.first(query.get(2).getAll())); + assertEqualsCollections(Arrays.asList("Igor", 1, "Calcite"), F.first(qry.get(0).getAll())); + assertEquals(0, qry.get(1).getAll().size()); + assertEqualsCollections(Arrays.asList("Roman", 0, "Ignite"), F.first(qry.get(2).getAll())); } /** @@ -1192,29 +1192,29 @@ public void testThroughput() { // warmup for (int i = 0; i < numIterations; i++) { - List>> query = engine.query(null, "PUBLIC", "select * from DEVELOPER"); - query.get(0).getAll(); + List>> qry = engine.query(null, "PUBLIC", "select * from DEVELOPER"); + qry.get(0).getAll(); } long start = System.currentTimeMillis(); for (int i = 0; i < numIterations; i++) { - List>> query = engine.query(null, "PUBLIC", "select * from DEVELOPER"); - query.get(0).getAll(); + List>> qry = engine.query(null, "PUBLIC", "select * from DEVELOPER"); + qry.get(0).getAll(); } System.out.println("Calcite duration = " + (System.currentTimeMillis() - start)); // warmup for (int i = 0; i < numIterations; i++) { - List>> query = client.context().query().querySqlFields( + List>> qry = client.context().query().querySqlFields( new SqlFieldsQuery("select * from DEVELOPER").setSchema("PUBLIC"), false, false); - query.get(0).getAll(); + qry.get(0).getAll(); } start = System.currentTimeMillis(); for (int i = 0; i < numIterations; i++) { - List>> query = client.context().query().querySqlFields( + List>> qry = client.context().query().querySqlFields( new SqlFieldsQuery("select * from DEVELOPER").setSchema("PUBLIC"), false, false); - query.get(0).getAll(); + qry.get(0).getAll(); } System.out.println("H2 duration = " + (System.currentTimeMillis() - start)); } diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/KillQueryCommandDdlIntegrationTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/KillQueryCommandDdlIntegrationTest.java index efdf2a78ed319..1d03fdf9aae7c 100644 --- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/KillQueryCommandDdlIntegrationTest.java +++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/KillQueryCommandDdlIntegrationTest.java @@ -77,14 +77,14 @@ public static Collection parameters() { public void testCancelUnknownSqlQuery() { IgniteEx srv = grid(0); UUID nodeId = cancelOnClient ? client.localNode().id() : srv.localNode().id(); - Long queryId = ThreadLocalRandom.current().nextLong(10, 10000); + Long qryId = ThreadLocalRandom.current().nextLong(10, 10000); GridTestUtils.assertThrows(log, () -> { sql(cancelOnClient ? client : srv, "KILL QUERY" + (isAsync ? " ASYNC '" : " '") + nodeId + "_" - + queryId + "'"); + + qryId + "'"); }, IgniteException.class, String.format("Failed to cancel query [nodeId=%s, qryId=%d, err=Query with provided ID doesn't exist " + - "[nodeId=%s, qryId=%d]]", nodeId, queryId, nodeId, queryId) + "[nodeId=%s, qryId=%d]]", nodeId, qryId, nodeId, qryId) ); } diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/PartitionPruneTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/PartitionPruneTest.java index 0663175f5ea01..ac6fc2c47adee 100644 --- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/PartitionPruneTest.java +++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/PartitionPruneTest.java @@ -401,29 +401,29 @@ private void testSelect(int sz, boolean withIn, String column) { assertTrue(sz >= 1); int[] values = ThreadLocalRandom.current().ints(0, ENTRIES_COUNT).distinct().limit(sz).toArray(); - StringBuilder query; + StringBuilder qry; if (!withIn || sz == 1) - query = new StringBuilder("select * from T1 where "); + qry = new StringBuilder("select * from T1 where "); else - query = new StringBuilder("select * from T1 where T1.").append(column).append(" in ("); + qry = new StringBuilder("select * from T1 where T1.").append(column).append(" in ("); for (int i = 0; i < sz; ++i) { if (!withIn || sz == 1) - query.append("T1.").append(column).append("= ?"); + qry.append("T1.").append(column).append("= ?"); else - query.append('?'); + qry.append('?'); if (sz == 1) break; if (i == sz - 1) - query.append(!withIn ? "" : ")"); + qry.append(!withIn ? "" : ")"); else - query.append(!withIn ? " OR " : ", "); + qry.append(!withIn ? " OR " : ", "); } - execute(query.toString(), + execute(qry.toString(), res -> { assertPartitions(IntStream.of(values).map(i -> partition("T1_CACHE", i)).toArray()); assertNodes(IntStream.of(values).mapToObj(i -> node("T1_CACHE", i)).toArray(ClusterNode[]::new)); diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SqlDiagnosticIntegrationTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SqlDiagnosticIntegrationTest.java index e2ac50e66db2f..b0055c54de202 100644 --- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SqlDiagnosticIntegrationTest.java +++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/SqlDiagnosticIntegrationTest.java @@ -359,7 +359,7 @@ public void testPerformanceStatistics() throws Exception { Set dataNodesIds = new HashSet<>(F.asList(grid(0).localNode().id(), grid(1).localNode().id())); Set readsNodes = new HashSet<>(dataNodesIds); Set readsQueries = new HashSet<>(); - Map rowsFetchedPerQuery = new HashMap<>(); + Map rowsFetchedPerQry = new HashMap<>(); AtomicLong firstQryId = new AtomicLong(-1); AtomicLong lastQryId = new AtomicLong(); @@ -420,7 +420,7 @@ public void testPerformanceStatistics() throws Exception { } else if ("Fetched".equals(action)) { assertEquals(grid(0).localNode().id(), nodeId); - assertNull(rowsFetchedPerQuery.put(id, rows)); + assertNull(rowsFetchedPerQry.put(id, rows)); } } }); @@ -428,8 +428,8 @@ else if ("Fetched".equals(action)) { assertEquals(4, qryCnt.get()); assertTrue("Query reads expected on nodes: " + readsNodes, readsNodes.isEmpty()); assertEquals(Collections.singleton(lastQryId.get()), readsQueries); - assertEquals((Long)1000L, rowsFetchedPerQuery.get(firstQryId.get())); - assertEquals((Long)4L, rowsFetchedPerQuery.get(lastQryId.get())); + assertEquals((Long)1000L, rowsFetchedPerQry.get(firstQryId.get())); + assertEquals((Long)4L, rowsFetchedPerQry.get(lastQryId.get())); assertEquals(5L, rowsScanned.get()); } diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDdlIntegrationTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDdlIntegrationTest.java index 4b108d1d74d5a..ccf7b0b5ae06c 100644 --- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDdlIntegrationTest.java +++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDdlIntegrationTest.java @@ -957,13 +957,13 @@ public void alterTableLogging() { */ @Test public void testMulitlineWithCreateTable() { - String multiLineQuery = "CREATE TABLE test (val0 int primary key, val1 varchar);" + + String multiLineQry = "CREATE TABLE test (val0 int primary key, val1 varchar);" + "INSERT INTO test(val0, val1) VALUES (0, 'test0');" + "ALTER TABLE test ADD COLUMN val2 int;" + "INSERT INTO test(val0, val1, val2) VALUES(1, 'test1', 10);" + "ALTER TABLE test DROP COLUMN val2;"; - sql(multiLineQuery); + sql(multiLineQry); List> res = sql("SELECT * FROM test order by val0"); assertEquals(2, res.size()); diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java index 73f4d2d29ae04..310dff671922b 100644 --- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java +++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/TableDmlIntegrationTest.java @@ -152,12 +152,12 @@ public void testInsertPrimitiveKey() { QueryEngine engine = Commons.lookupComponent(grid(1).context(), QueryEngine.class); - List>> query = engine.query(null, "PUBLIC", + List>> qry = engine.query(null, "PUBLIC", "INSERT INTO DEVELOPER(_key, name, projectId) VALUES (?, ?, ?)", 0, "Igor", 1); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - List> rows = query.get(0).getAll(); + List> rows = qry.get(0).getAll(); assertEquals(1, rows.size()); @@ -167,11 +167,11 @@ public void testInsertPrimitiveKey() { assertEqualsCollections(F.asList(1L), row); - query = engine.query(null, "PUBLIC", "select _key, * from DEVELOPER"); + qry = engine.query(null, "PUBLIC", "select _key, * from DEVELOPER"); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - row = F.first(query.get(0).getAll()); + row = F.first(qry.get(0).getAll()); assertNotNull(row); @@ -192,61 +192,61 @@ public void testInsertUpdateDeleteNonPrimitiveKey() throws Exception { QueryEngine engine = Commons.lookupComponent(grid(1).context(), QueryEngine.class); - List>> query = engine.query(null, "PUBLIC", "INSERT INTO DEVELOPER VALUES (?, ?, ?, ?)", 0, 0, "Igor", 1); + List>> qry = engine.query(null, "PUBLIC", "INSERT INTO DEVELOPER VALUES (?, ?, ?, ?)", 0, 0, "Igor", 1); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - List row = F.first(query.get(0).getAll()); + List row = F.first(qry.get(0).getAll()); assertNotNull(row); assertEqualsCollections(F.asList(1L), row); - query = engine.query(null, "PUBLIC", "select * from DEVELOPER"); + qry = engine.query(null, "PUBLIC", "select * from DEVELOPER"); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - row = F.first(query.get(0).getAll()); + row = F.first(qry.get(0).getAll()); assertNotNull(row); assertEqualsCollections(F.asList(0, 0, "Igor", 1), row); - query = engine.query(null, "PUBLIC", "UPDATE DEVELOPER d SET name = name || 'Roman' WHERE id = ?", 0); + qry = engine.query(null, "PUBLIC", "UPDATE DEVELOPER d SET name = name || 'Roman' WHERE id = ?", 0); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - row = F.first(query.get(0).getAll()); + row = F.first(qry.get(0).getAll()); assertNotNull(row); assertEqualsCollections(F.asList(1L), row); - query = engine.query(null, "PUBLIC", "select * from DEVELOPER"); + qry = engine.query(null, "PUBLIC", "select * from DEVELOPER"); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - row = F.first(query.get(0).getAll()); + row = F.first(qry.get(0).getAll()); assertNotNull(row); assertEqualsCollections(F.asList(0, 0, "IgorRoman", 1), row); - query = engine.query(null, "PUBLIC", "DELETE FROM DEVELOPER WHERE id = ?", 0); + qry = engine.query(null, "PUBLIC", "DELETE FROM DEVELOPER WHERE id = ?", 0); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - row = F.first(query.get(0).getAll()); + row = F.first(qry.get(0).getAll()); assertNotNull(row); assertEqualsCollections(F.asList(1L), row); - query = engine.query(null, "PUBLIC", "select * from DEVELOPER"); + qry = engine.query(null, "PUBLIC", "select * from DEVELOPER"); - assertEquals(1, query.size()); + assertEquals(1, qry.size()); - row = F.first(query.get(0).getAll()); + row = F.first(qry.get(0).getAll()); assertNull(row); } diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcQueryTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcQueryTest.java index b82c4b35d98cb..cd457f62a38f0 100644 --- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcQueryTest.java +++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/jdbc/JdbcQueryTest.java @@ -315,12 +315,12 @@ public void testBatchPrepared() throws Exception { */ @Test public void testMultilineQuery() throws Exception { - String multiLineQuery = "CREATE TABLE test (val0 int primary key, val1 varchar);" + + String multiLineQry = "CREATE TABLE test (val0 int primary key, val1 varchar);" + "INSERT INTO test(val0, val1) VALUES (0, 'test0');" + "ALTER TABLE test ADD COLUMN val2 int;" + "INSERT INTO test(val0, val1, val2) VALUES(1, 'test1', 10);" + "ALTER TABLE test DROP COLUMN val2;"; - stmt.execute(multiLineQuery); + stmt.execute(multiLineQry); try (ResultSet rs = stmt.executeQuery("select * from test order by val0")) { int i; diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/sql/SqlCustomParserTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/sql/SqlCustomParserTest.java index f62463fbd62ff..5720eb600b8be 100644 --- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/sql/SqlCustomParserTest.java +++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/sql/SqlCustomParserTest.java @@ -78,9 +78,9 @@ public class SqlCustomParserTest extends GridCommonAbstractTest { */ @Test public void createTableSimpleCase() throws SqlParseException { - String query = "create table my_table(id int, val varchar)"; + String qry = "create table my_table(id int, val varchar)"; - SqlNode node = parse(query); + SqlNode node = parse(qry); assertThat(node, instanceOf(IgniteSqlCreateTable.class)); @@ -97,9 +97,9 @@ public void createTableSimpleCase() throws SqlParseException { */ @Test public void createTableQuotedIdentifiers() throws SqlParseException { - String query = "create table \"My_Table\"(\"Id\" int, \"Val\" varchar)"; + String qry = "create table \"My_Table\"(\"Id\" int, \"Val\" varchar)"; - SqlNode node = parse(query); + SqlNode node = parse(qry); assertThat(node, instanceOf(IgniteSqlCreateTable.class)); @@ -116,9 +116,9 @@ public void createTableQuotedIdentifiers() throws SqlParseException { */ @Test public void createTableIfNotExists() throws SqlParseException { - String query = "create table if not exists my_table(id int, val varchar)"; + String qry = "create table if not exists my_table(id int, val varchar)"; - SqlNode node = parse(query); + SqlNode node = parse(qry); assertThat(node, instanceOf(IgniteSqlCreateTable.class)); @@ -136,9 +136,9 @@ public void createTableIfNotExists() throws SqlParseException { */ @Test public void createTableWithPkCase1() throws SqlParseException { - String query = "create table my_table(id int primary key, val varchar)"; + String qry = "create table my_table(id int primary key, val varchar)"; - SqlNode node = parse(query); + SqlNode node = parse(qry); assertThat(node, instanceOf(IgniteSqlCreateTable.class)); @@ -160,9 +160,9 @@ public void createTableWithPkCase1() throws SqlParseException { */ @Test public void createTableWithPkCase2() throws SqlParseException { - String query = "create table my_table(id int, val varchar, primary key(id))"; + String qry = "create table my_table(id int, val varchar, primary key(id))"; - SqlNode node = parse(query); + SqlNode node = parse(qry); assertThat(node, instanceOf(IgniteSqlCreateTable.class)); @@ -184,9 +184,9 @@ public void createTableWithPkCase2() throws SqlParseException { */ @Test public void createTableWithPkCase3() throws SqlParseException { - String query = "create table my_table(id int, val varchar, constraint pk_key primary key(id))"; + String qry = "create table my_table(id int, val varchar, constraint pk_key primary key(id))"; - SqlNode node = parse(query); + SqlNode node = parse(qry); assertThat(node, instanceOf(IgniteSqlCreateTable.class)); @@ -208,9 +208,9 @@ public void createTableWithPkCase3() throws SqlParseException { */ @Test public void createTableWithPkCase4() throws SqlParseException { - String query = "create table my_table(id1 int, id2 int, val varchar, primary key(id1, id2))"; + String qry = "create table my_table(id1 int, id2 int, val varchar, primary key(id1, id2))"; - SqlNode node = parse(query); + SqlNode node = parse(qry); assertThat(node, instanceOf(IgniteSqlCreateTable.class)); @@ -233,7 +233,7 @@ && hasItem(ofTypeMatching("identifier \"ID2\"", SqlIdentifier.class, id -> "ID2" */ @Test public void createTableWithOptions() throws SqlParseException { - String query = "create table my_table(id int) with" + + String qry = "create table my_table(id int) with" + " template=\"my_template\"," + " backups=2," + " affinity_key=my_aff," + @@ -246,7 +246,7 @@ public void createTableWithOptions() throws SqlParseException { " value_type=my_value_type," + " encrypted=true"; - SqlNode node = parse(query); + SqlNode node = parse(qry); assertThat(node, instanceOf(IgniteSqlCreateTable.class)); @@ -270,7 +270,7 @@ public void createTableWithOptions() throws SqlParseException { */ @Test public void createTableWithOptionsQuoted() throws SqlParseException { - String query = "create table my_table(id int) with \"" + + String qry = "create table my_table(id int) with \"" + " template=my_template," + " backups=2," + " affinity_key=My_Aff," + @@ -284,7 +284,7 @@ public void createTableWithOptionsQuoted() throws SqlParseException { " encrypted=true" + "\""; - SqlNode node = parse(query); + SqlNode node = parse(qry); assertThat(node, instanceOf(IgniteSqlCreateTable.class)); @@ -787,18 +787,18 @@ public void killSqlQuery() throws Exception { IgniteSqlKill killTask; UUID nodeId = UUID.randomUUID(); - long queryId = ThreadLocalRandom.current().nextLong(); + long qryId = ThreadLocalRandom.current().nextLong(); - killTask = parse("kill query '" + nodeId + "_" + queryId + "'"); + killTask = parse("kill query '" + nodeId + "_" + qryId + "'"); assertTrue(killTask instanceof IgniteSqlKillQuery); assertEquals(nodeId, ((IgniteSqlKillQuery)killTask).nodeId()); - assertEquals(queryId, ((IgniteSqlKillQuery)killTask).queryId()); + assertEquals(qryId, ((IgniteSqlKillQuery)killTask).queryId()); assertFalse(((IgniteSqlKillQuery)killTask).isAsync()); - killTask = parse("kill query async '" + nodeId + "_" + queryId + "'"); + killTask = parse("kill query async '" + nodeId + "_" + qryId + "'"); assertTrue(killTask instanceof IgniteSqlKillQuery); assertEquals(nodeId, ((IgniteSqlKillQuery)killTask).nodeId()); - assertEquals(queryId, ((IgniteSqlKillQuery)killTask).queryId()); + assertEquals(qryId, ((IgniteSqlKillQuery)killTask).queryId()); assertTrue(((IgniteSqlKillQuery)killTask).isAsync()); assertParserThrows("kill query '1233415'", SqlParseException.class); diff --git a/modules/checkstyle/src/main/resources/abbrevations.csv b/modules/checkstyle/src/main/resources/abbrevations.csv index e5079dda6b4a1..c828e45cb8ccc 100644 --- a/modules/checkstyle/src/main/resources/abbrevations.csv +++ b/modules/checkstyle/src/main/resources/abbrevations.csv @@ -53,7 +53,7 @@ property,prop properties,props process,proc processor,proc -#query,qry +query,qry receive,rcv reference,ref #regularexpression,regex diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/AbstractJdbcPojoQuerySelfTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/AbstractJdbcPojoQuerySelfTest.java index 1c9961b0311e6..bb02fc335cc15 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/AbstractJdbcPojoQuerySelfTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/AbstractJdbcPojoQuerySelfTest.java @@ -59,14 +59,14 @@ public abstract class AbstractJdbcPojoQuerySelfTest extends GridCommonAbstractTe cfg.setConnectorConfiguration(new ConnectorConfiguration()); - QueryEntity queryEntity = new QueryEntity(); - queryEntity.setKeyType("java.lang.String"); - queryEntity.setValueType("org.apache.ignite.internal.JdbcTestObject"); - queryEntity.addQueryField("id", "java.lang.Integer", null); - queryEntity.addQueryField("testObject", "org.apache.ignite.internal.JdbcTestObject2", null); - queryEntity.setIndexes(Collections.singletonList(new QueryIndex("id"))); - - cache.setQueryEntities(Collections.singletonList(queryEntity)); + QueryEntity qryEntity = new QueryEntity(); + qryEntity.setKeyType("java.lang.String"); + qryEntity.setValueType("org.apache.ignite.internal.JdbcTestObject"); + qryEntity.addQueryField("id", "java.lang.Integer", null); + qryEntity.addQueryField("testObject", "org.apache.ignite.internal.JdbcTestObject2", null); + qryEntity.setIndexes(Collections.singletonList(new QueryIndex("id"))); + + cache.setQueryEntities(Collections.singletonList(qryEntity)); cfg.setCacheConfiguration(cache); diff --git a/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java b/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java index 0f69fd08b1439..5850aa319d505 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/QueryEntity.java @@ -180,7 +180,7 @@ public QueryEntity(Class keyCls, Class valCls) { checkEquals(conflicts, "valueFieldName", valueFieldName, target.valueFieldName); checkEquals(conflicts, "tableName", tableName, target.tableName); - List queryFieldsToAdd = checkFields(target, conflicts); + List qryFieldsToAdd = checkFields(target, conflicts); Collection indexesToAdd = checkIndexes(target, conflicts); @@ -189,13 +189,13 @@ public QueryEntity(Class keyCls, Class valCls) { Collection patchOperations = new ArrayList<>(); - if (!queryFieldsToAdd.isEmpty()) + if (!qryFieldsToAdd.isEmpty()) patchOperations.add(new SchemaAlterTableAddColumnOperation( UUID.randomUUID(), null, null, tableName, - queryFieldsToAdd, + qryFieldsToAdd, true, true )); @@ -234,17 +234,17 @@ public QueryEntity(Class keyCls, Class valCls) { throw new IllegalStateException("Duplicate key"); } - for (QueryIndex queryIdx : target.getIndexes()) { - if (curIndexes.containsKey(queryIdx.getName())) { + for (QueryIndex qryIdx : target.getIndexes()) { + if (curIndexes.containsKey(qryIdx.getName())) { checkEquals( conflicts, - "index " + queryIdx.getName(), - curIndexes.get(queryIdx.getName()), - queryIdx + "index " + qryIdx.getName(), + curIndexes.get(qryIdx.getName()), + qryIdx ); } else - indexesToAdd.add(queryIdx); + indexesToAdd.add(qryIdx); } return indexesToAdd; } @@ -257,7 +257,7 @@ public QueryEntity(Class keyCls, Class valCls) { * @return Fields which exist in target and not exist in local. */ private List checkFields(QueryEntity target, StringBuilder conflicts) { - List queryFieldsToAdd = new ArrayList<>(); + List qryFieldsToAdd = new ArrayList<>(); for (Map.Entry targetField : target.getFields().entrySet()) { String targetFieldName = targetField.getKey(); @@ -311,7 +311,7 @@ private List checkFields(QueryEntity target, StringBuilder conflicts Integer precision = getFromMap(target.getFieldsPrecision(), targetFieldName); Integer scale = getFromMap(target.getFieldsScale(), targetFieldName); - queryFieldsToAdd.add(new QueryField( + qryFieldsToAdd.add(new QueryField( targetFieldName, targetFieldType, targetFieldAlias, @@ -324,7 +324,7 @@ private List checkFields(QueryEntity target, StringBuilder conflicts } } - return queryFieldsToAdd; + return qryFieldsToAdd; } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java index 3115ff61b9c72..6b311d31ed07a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/jdbc/thin/ConnectionPropertiesImpl.java @@ -758,18 +758,18 @@ private void parseUrl0(String url, Properties props) throws SQLException { // Determine mode - semicolon or ampersand. int semicolonPos = url.indexOf(";"); int slashPos = url.indexOf("/"); - int queryPos = url.indexOf("?"); + int qryPos = url.indexOf("?"); boolean semicolonMode; - if (semicolonPos == -1 && slashPos == -1 && queryPos == -1) + if (semicolonPos == -1 && slashPos == -1 && qryPos == -1) // No special char -> any mode could be used, choose semicolon for simplicity. semicolonMode = true; else { if (semicolonPos != -1) { // Use semicolon mode if it appears earlier than slash or query. semicolonMode = - (slashPos == -1 || semicolonPos < slashPos) && (queryPos == -1 || semicolonPos < queryPos); + (slashPos == -1 || semicolonPos < slashPos) && (qryPos == -1 || semicolonPos < qryPos); } else // Semicolon is not found. diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java index 5521dcdd0fc8c..13164ebe03804 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/ClusterCachesInfo.java @@ -1634,9 +1634,9 @@ private void registerReceivedCaches(CacheNodeCommonDiscoveryData cachesData) { cacheData.cacheConfigurationEnrichment() ); - Collection locQueryEntities = getLocalQueryEntities(cfg.getName()); + Collection locQryEntities = getLocalQueryEntities(cfg.getName()); - QuerySchemaPatch schemaPatch = desc.makeSchemaPatch(locQueryEntities); + QuerySchemaPatch schemaPatch = desc.makeSchemaPatch(locQryEntities); if (schemaPatch.hasConflicts()) { hasSchemaPatchConflict = true; @@ -1645,7 +1645,7 @@ private void registerReceivedCaches(CacheNodeCommonDiscoveryData cachesData) { } else if (!schemaPatch.isEmpty()) patchesToApply.put(desc, schemaPatch); - else if (!GridFunc.eqNotOrdered(desc.schema().entities(), locQueryEntities)) + else if (!GridFunc.eqNotOrdered(desc.schema().entities(), locQryEntities)) cachesToSave.add(desc); //received config is different of local config - need to resave desc.receivedOnDiscovery(true); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/defragmentation/CachePartitionDefragmentationManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/defragmentation/CachePartitionDefragmentationManager.java index e17b869ac4adf..bde4ac6bbfb1f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/defragmentation/CachePartitionDefragmentationManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/persistence/defragmentation/CachePartitionDefragmentationManager.java @@ -902,9 +902,9 @@ private void defragmentIndexPartition( CacheGroupContext grpCtx, CacheGroupContext newCtx ) throws IgniteCheckedException { - GridQueryProcessor query = grpCtx.caches().get(0).kernalContext().query(); + GridQueryProcessor qry = grpCtx.caches().get(0).kernalContext().query(); - if (!query.moduleEnabled()) + if (!qry.moduleEnabled()) return; IndexProcessor idx = grpCtx.caches().get(0).kernalContext().indexProcessor(); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcMessageParser.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcMessageParser.java index 5a7de34bd2202..587e640818a5f 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcMessageParser.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcMessageParser.java @@ -163,18 +163,18 @@ public OdbcMessageParser(GridKernalContext ctx, ClientListenerProtocolVersion ve } case OdbcRequest.QRY_FETCH: { - long queryId = reader.readLong(); + long qryId = reader.readLong(); int pageSize = reader.readInt(); - res = new OdbcQueryFetchRequest(queryId, pageSize); + res = new OdbcQueryFetchRequest(qryId, pageSize); break; } case OdbcRequest.QRY_CLOSE: { - long queryId = reader.readLong(); + long qryId = reader.readLong(); - res = new OdbcQueryCloseRequest(queryId); + res = new OdbcQueryCloseRequest(qryId); break; } @@ -202,27 +202,27 @@ public OdbcMessageParser(GridKernalContext ctx, ClientListenerProtocolVersion ve case OdbcRequest.META_PARAMS: { String schema = reader.readString(); - String sqlQuery = reader.readString(); + String sqlQry = reader.readString(); - res = new OdbcQueryGetParamsMetaRequest(schema, sqlQuery); + res = new OdbcQueryGetParamsMetaRequest(schema, sqlQry); break; } case OdbcRequest.META_RESULTSET: { String schema = reader.readString(); - String sqlQuery = reader.readString(); + String sqlQry = reader.readString(); - res = new OdbcQueryGetResultsetMetaRequest(schema, sqlQuery); + res = new OdbcQueryGetResultsetMetaRequest(schema, sqlQry); break; } case OdbcRequest.MORE_RESULTS: { - long queryId = reader.readLong(); + long qryId = reader.readLong(); int pageSize = reader.readInt(); - res = new OdbcQueryMoreResultsRequest(queryId, pageSize); + res = new OdbcQueryMoreResultsRequest(qryId, pageSize); break; } diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java index eb84a170c6222..5ea085dcf7990 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/odbc/odbc/OdbcRequestHandler.java @@ -578,25 +578,25 @@ private void processStreamingBatch(SqlFieldsQueryEx qry, IgniteBiTuple dataCache = target.rawCache(); - PlatformDotNetEntityFrameworkCacheKey key = new PlatformDotNetEntityFrameworkCacheKey(query, versions); + PlatformDotNetEntityFrameworkCacheKey key = new PlatformDotNetEntityFrameworkCacheKey(qry, versions); dataCache.put(key, efEntry); @@ -140,7 +140,7 @@ public class PlatformDotNetEntityFrameworkCacheExtension implements PlatformCach } case OP_GET_ITEM: { - String query = reader.readString(); + String qry = reader.readString(); long[] versions = null; @@ -156,7 +156,7 @@ public class PlatformDotNetEntityFrameworkCacheExtension implements PlatformCach IgniteCache dataCache = target.rawCache(); - PlatformDotNetEntityFrameworkCacheKey key = new PlatformDotNetEntityFrameworkCacheKey(query, versions); + PlatformDotNetEntityFrameworkCacheKey key = new PlatformDotNetEntityFrameworkCacheKey(qry, versions); PlatformDotNetEntityFrameworkCacheEntry entry = dataCache.get(key); diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/entityframework/PlatformDotNetEntityFrameworkCacheKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/entityframework/PlatformDotNetEntityFrameworkCacheKey.java index 23a1c1f914f80..2784e3be51ce9 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/entityframework/PlatformDotNetEntityFrameworkCacheKey.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/entityframework/PlatformDotNetEntityFrameworkCacheKey.java @@ -138,10 +138,10 @@ public long[] versions() { /** {@inheritDoc} */ @Override public int compareTo(@NotNull PlatformDotNetEntityFrameworkCacheKey o) { - int cmpQuery = query.compareTo(o.query); + int cmpQry = query.compareTo(o.query); - if (cmpQuery != 0) - return cmpQuery; + if (cmpQry != 0) + return cmpQry; if (versions == null) { return o.versions == null ? 0 : -1; diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QuerySchema.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QuerySchema.java index 9b89135aaa09e..adc92e019a77d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QuerySchema.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QuerySchema.java @@ -136,11 +136,11 @@ public QuerySchemaPatch makePatch(CacheConfiguration targetCfg, Collection StringBuilder conflicts = new StringBuilder(); - for (QueryEntity queryEntity : target) { - if (locEntities.containsKey(queryEntity.getTableName())) { - QueryEntity locEntity = locEntities.get(queryEntity.getTableName()); + for (QueryEntity qryEntity : target) { + if (locEntities.containsKey(qryEntity.getTableName())) { + QueryEntity locEntity = locEntities.get(qryEntity.getTableName()); - QueryEntityPatch entityPatch = locEntity.makePatch(queryEntity); + QueryEntityPatch entityPatch = locEntity.makePatch(qryEntity); if (entityPatch.hasConflict()) { if (conflicts.length() > 0) @@ -153,7 +153,7 @@ public QuerySchemaPatch makePatch(CacheConfiguration targetCfg, Collection patchOperations.addAll(entityPatch.getPatchOperations()); } else - entityToAdd.add(QueryUtils.copy(queryEntity)); + entityToAdd.add(QueryUtils.copy(qryEntity)); } return new QuerySchemaPatch(patchOperations, entityToAdd, conflicts.toString()); diff --git a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoWriteBehindStoreWithCoalescingTest.java b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoWriteBehindStoreWithCoalescingTest.java index d02653ce1c292..01633ac84ad20 100644 --- a/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoWriteBehindStoreWithCoalescingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/cache/store/jdbc/CacheJdbcPojoWriteBehindStoreWithCoalescingTest.java @@ -195,21 +195,21 @@ public CacheConfiguration getCacheConfiguration() { ccfg.setWriteBehindBatchSize(1000); - QueryEntity queryEntity = new QueryEntity(); + QueryEntity qryEntity = new QueryEntity(); - queryEntity.setKeyType("java.lang.Integer"); + qryEntity.setKeyType("java.lang.Integer"); - queryEntity.setValueType("org.apache.ignite.cache.store.jdbc.model.TestPojo"); + qryEntity.setValueType("org.apache.ignite.cache.store.jdbc.model.TestPojo"); - queryEntity.setTableName("TEST_CACHE"); + qryEntity.setTableName("TEST_CACHE"); - queryEntity.setKeyFieldName("value3"); + qryEntity.setKeyFieldName("value3"); Set keyFiles = new HashSet<>(); keyFiles.add("value3"); - queryEntity.setKeyFields(keyFiles); + qryEntity.setKeyFields(keyFiles); LinkedHashMap fields = new LinkedHashMap<>(); @@ -219,7 +219,7 @@ public CacheConfiguration getCacheConfiguration() { fields.put("value3", "java.sql.Date"); - queryEntity.setFields(fields); + qryEntity.setFields(fields); Map aliases = new HashMap<>(); @@ -229,13 +229,13 @@ public CacheConfiguration getCacheConfiguration() { aliases.put("value3", "VALUE3"); - queryEntity.setAliases(aliases); + qryEntity.setAliases(aliases); - ArrayList queryEntities = new ArrayList<>(); + ArrayList qryEntities = new ArrayList<>(); - queryEntities.add(queryEntity); + qryEntities.add(qryEntity); - ccfg.setQueryEntities(queryEntities); + ccfg.setQueryEntities(qryEntities); return ccfg; } diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheRecreateTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheRecreateTest.java index aca4448f420c7..4ec3bbc466134 100755 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheRecreateTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/distributed/dht/IgniteCacheRecreateTest.java @@ -310,10 +310,10 @@ public void testAtomicScanAndCacheRecreate() throws Exception { ATOMIC, GridCacheQueryRequest.class, (cache, keys) -> { - ScanQuery scanQuery = new ScanQuery<>(); - scanQuery.setPageSize(1); + ScanQuery scanQry = new ScanQuery<>(); + scanQry.setPageSize(1); - try (QueryCursor qry = cache.query(scanQuery)) { + try (QueryCursor qry = cache.query(scanQry)) { for (Object o : qry.getAll()) { IgniteBiTuple tuple = (IgniteBiTuple)o; diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryTransformerSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryTransformerSelfTest.java index 8a275b9cc07b9..76420397ed685 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryTransformerSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryTransformerSelfTest.java @@ -607,10 +607,10 @@ public void testPageSize() throws Exception { } }; - ScanQuery query = new ScanQuery<>(); - query.setPageSize(pageSize); + ScanQuery qry = new ScanQuery<>(); + qry.setPageSize(pageSize); - List res = cache.query(query, transformer).getAll(); + List res = cache.query(qry, transformer).getAll(); assertEquals(numEntries, res.size()); diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/IgniteCacheQueryCacheDestroySelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/IgniteCacheQueryCacheDestroySelfTest.java index c389cd3b296ba..c7590e54696d9 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/IgniteCacheQueryCacheDestroySelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/query/IgniteCacheQueryCacheDestroySelfTest.java @@ -102,7 +102,7 @@ public void testQueue() throws Throwable { * @throws Exception If failed. */ private void runQuery() throws Exception { - ScanQuery scanQuery = new ScanQuery() + ScanQuery scanQry = new ScanQuery() .setLocal(true) .setFilter(new IgniteBiPredicate() { @Override public boolean apply(String key, String p) { @@ -115,9 +115,9 @@ private void runQuery() throws Exception { IgniteCache example = ignite.cache(CACHE_NAME); for (int partition : ignite.affinity(CACHE_NAME).primaryPartitions(ignite.cluster().localNode())) { - scanQuery.setPartition(partition); + scanQry.setPartition(partition); - try (QueryCursor cursor = example.query(scanQuery)) { + try (QueryCursor cursor = example.query(scanQry)) { for (Object p : cursor) { String value = (String)((Cache.Entry)p).getValue(); diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/ClassLoadingProblemExceptionTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/ClassLoadingProblemExceptionTest.java index cb374f9cf46e0..74148dffeb247 100644 --- a/modules/core/src/test/java/org/apache/ignite/p2p/ClassLoadingProblemExceptionTest.java +++ b/modules/core/src/test/java/org/apache/ignite/p2p/ClassLoadingProblemExceptionTest.java @@ -196,14 +196,14 @@ private class TestCommunicationSpi extends TcpCommunicationSpi { Message m = ioMsg.message(); if (m instanceof GridCacheQueryRequest) { - GridCacheQueryRequest queryReq = (GridCacheQueryRequest)m; + GridCacheQueryRequest qryReq = (GridCacheQueryRequest)m; - if (queryReq.deployInfo() != null) { - queryReq.prepare( + if (qryReq.deployInfo() != null) { + qryReq.prepare( new GridDeploymentInfoBean( IgniteUuid.fromUuid(UUID.randomUUID()), - queryReq.deployInfo().userVersion(), - queryReq.deployInfo().deployMode(), + qryReq.deployInfo().userVersion(), + qryReq.deployInfo().deployMode(), null ) ); diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PScanQueryWithTransformerTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PScanQueryWithTransformerTest.java index 347445211e341..214325304ac91 100644 --- a/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PScanQueryWithTransformerTest.java +++ b/modules/core/src/test/java/org/apache/ignite/p2p/GridP2PScanQueryWithTransformerTest.java @@ -153,9 +153,9 @@ public void testScanQueryGetAllFromClientNodeWithExplicitClass() throws Exceptio IgniteCache clientCache = client.getOrCreateCache(DEFAULT_CACHE_NAME); - QueryCursor query = clientCache.query(new ScanQuery(), loadTransformerClass()); + QueryCursor qry = clientCache.query(new ScanQuery(), loadTransformerClass()); - List results = query.getAll(); + List results = qry.getAll(); assertNotNull(results); assertEquals(CACHE_SIZE, results.size()); @@ -183,11 +183,11 @@ public void testScanQueryCursorFromClientNodeWithAnonymousClass() throws Excepti IgniteCache clientCache = client.getOrCreateCache(DEFAULT_CACHE_NAME); - QueryCursor query = clientCache.query(new ScanQuery(), loadTransformerClosure()); + QueryCursor qry = clientCache.query(new ScanQuery(), loadTransformerClosure()); int sumQueried = 0; - for (Integer val : query) + for (Integer val : qry) sumQueried += val; assertTrue(sumQueried == sumPopulated * SCALE_FACTOR); @@ -238,10 +238,10 @@ public void testSharedTransformerWorksWhenP2PIsDisabled() throws Exception { IgniteCache clientCache = client.getOrCreateCache(DEFAULT_CACHE_NAME); - QueryCursor query = clientCache.query(new ScanQuery(), + QueryCursor qry = clientCache.query(new ScanQuery(), new SharedTransformer(SCALE_FACTOR)); - List results = query.getAll(); + List results = qry.getAll(); assertNotNull(results); assertEquals(CACHE_SIZE, results.size()); @@ -285,11 +285,11 @@ private void executeP2PClassLoadingEnabledTest(boolean withClientNode) throws Ex IgniteCache reqNodeCache = requestingNode.getOrCreateCache(DEFAULT_CACHE_NAME); - QueryCursor query = reqNodeCache.query(new ScanQuery(), loadTransformerClass()); + QueryCursor qry = reqNodeCache.query(new ScanQuery(), loadTransformerClass()); int sumQueried = 0; - for (Integer val : query) + for (Integer val : qry) sumQueried += val; assertTrue(sumQueried == sumPopulated * SCALE_FACTOR); @@ -331,10 +331,10 @@ private void executeP2PClassLoadingDisabledTest(boolean withClientNode) throws E IgniteCache reqNodeCache = reqNode.getOrCreateCache(DEFAULT_CACHE_NAME); - QueryCursor query = reqNodeCache.query(new ScanQuery(), loadTransformerClosure()); + QueryCursor qry = reqNodeCache.query(new ScanQuery(), loadTransformerClosure()); try { - List all = query.getAll(); + List all = qry.getAll(); } catch (Exception e) { //No-op. diff --git a/modules/core/src/test/java/org/apache/ignite/p2p/P2PClassLoadingFailureHandlingTest.java b/modules/core/src/test/java/org/apache/ignite/p2p/P2PClassLoadingFailureHandlingTest.java index cedb074193987..23e187164b971 100644 --- a/modules/core/src/test/java/org/apache/ignite/p2p/P2PClassLoadingFailureHandlingTest.java +++ b/modules/core/src/test/java/org/apache/ignite/p2p/P2PClassLoadingFailureHandlingTest.java @@ -218,14 +218,14 @@ public void cacheEntryProcessorP2PClassLoadingProblemShouldNotCauseFailureHandli public void continuousQueryRemoteFilterP2PClassLoadingProblemShouldNotCauseFailureHandling() throws Exception { IgniteCache cache = client.createCache(CACHE_NAME); - ContinuousQuery query = new ContinuousQuery<>(); - query.setLocalListener(entry -> {}); - query.setRemoteFilterFactory(instantiateClassLoadedWithExternalClassLoader( + ContinuousQuery qry = new ContinuousQuery<>(); + qry.setLocalListener(entry -> {}); + qry.setRemoteFilterFactory(instantiateClassLoadedWithExternalClassLoader( "org.apache.ignite.tests.p2p.classloadproblem.RemoteFilterFactoryCausingP2PClassLoadProblem" )); Throwable ex = assertThrows(log, () -> { - try (QueryCursor> ignored = cache.query(query)) { + try (QueryCursor> ignored = cache.query(qry)) { cache.put(1, "1"); } }, IgniteException.class, "Failed to update keys"); @@ -239,14 +239,14 @@ public void continuousQueryRemoteFilterP2PClassLoadingProblemShouldNotCauseFailu public void continuousQueryRemoteTransformerP2PClassLoadingProblemShouldNotCauseFailureHandling() throws Exception { IgniteCache cache = client.createCache(CACHE_NAME); - ContinuousQueryWithTransformer query = new ContinuousQueryWithTransformer<>(); - query.setLocalListener(entry -> {}); - query.setRemoteTransformerFactory(instantiateClassLoadedWithExternalClassLoader( + ContinuousQueryWithTransformer qry = new ContinuousQueryWithTransformer<>(); + qry.setLocalListener(entry -> {}); + qry.setRemoteTransformerFactory(instantiateClassLoadedWithExternalClassLoader( "org.apache.ignite.tests.p2p.classloadproblem.RemoteTransformerFactoryCausingP2PClassLoadProblem" )); Throwable ex = assertThrows(log, () -> { - try (QueryCursor> ignored = cache.query(query)) { + try (QueryCursor> ignored = cache.query(qry)) { cache.put(1, "1"); } }, IgniteException.class, "Failed to update keys"); diff --git a/modules/core/src/test/java/org/apache/ignite/startup/servlet/GridServletLoaderTest.java b/modules/core/src/test/java/org/apache/ignite/startup/servlet/GridServletLoaderTest.java index 26258a45a8970..1698d62d44509 100644 --- a/modules/core/src/test/java/org/apache/ignite/startup/servlet/GridServletLoaderTest.java +++ b/modules/core/src/test/java/org/apache/ignite/startup/servlet/GridServletLoaderTest.java @@ -92,9 +92,9 @@ public void testLoader() throws Exception { assert jmx != null; - String query = "*:*"; + String qry = "*:*"; - ObjectName queryName = new ObjectName(query); + ObjectName qryName = new ObjectName(qry); boolean found = false; @@ -105,7 +105,7 @@ public void testLoader() throws Exception { while (!found) { info("Attempt to find GridKernal MBean [num=" + i + ']'); - Set names = jmx.getMBeanServerConnection().queryNames(queryName, null); + Set names = jmx.getMBeanServerConnection().queryNames(qryName, null); if (!names.isEmpty()) { for (ObjectName objName : names) { diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java index 4a183d55b6d2e..33aa09bf007ef 100644 --- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java +++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/opt/GridLuceneIndex.java @@ -277,12 +277,12 @@ public GridCloseableIterator> query(String qry, // Filter expired items. Query filter = LongPoint.newRangeQuery(EXPIRATION_TIME_FIELD_NAME, U.currentTimeMillis(), Long.MAX_VALUE); - BooleanQuery query = new BooleanQuery.Builder() + BooleanQuery booleanQry = new BooleanQuery.Builder() .add(parser.parse(qry), BooleanClause.Occur.MUST) .add(filter, BooleanClause.Occur.FILTER) .build(); - docs = searcher.search(query, limit > 0 ? limit : Integer.MAX_VALUE); + docs = searcher.search(booleanQry, limit > 0 ? limit : Integer.MAX_VALUE); } catch (Exception e) { U.closeQuiet(reader); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/metric/UserQueriesTestBase.java b/modules/indexing/src/test/java/org/apache/ignite/internal/metric/UserQueriesTestBase.java index b6ab705e396b0..4912438522d58 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/metric/UserQueriesTestBase.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/metric/UserQueriesTestBase.java @@ -228,8 +228,8 @@ private void killAsyncAllQueriesOn(int nodeIdx) { Collection queries = node.context().query().runningQueries(-1); - for (GridRunningQueryInfo queryInfo : queries) { - String killId = queryInfo.globalQueryId(); + for (GridRunningQueryInfo qryInfo : queries) { + String killId = qryInfo.globalQueryId(); node.context().query().querySqlFields( new SqlFieldsQuery("KILL QUERY ASYNC '" + killId + "'").setSchema("PUBLIC"), false); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/AffinityKeyNameAndValueFieldNameConflictTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/AffinityKeyNameAndValueFieldNameConflictTest.java index 2a75a2c6eaae3..df54b7ab520bf 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/AffinityKeyNameAndValueFieldNameConflictTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/AffinityKeyNameAndValueFieldNameConflictTest.java @@ -159,10 +159,10 @@ private void checkQuery() throws Exception { personCache.put(keyProducer.apply(1, "o1"), new Person("p1")); - SqlFieldsQuery query = + SqlFieldsQuery qry = new SqlFieldsQuery("select * from \"" + PERSON_CACHE + "\"." + Person.class.getSimpleName() + " it where it.name=?"); - List> result = personCache.query(query.setArgs(keyFieldSpecified ? "o1" : "p1")).getAll(); + List> result = personCache.query(qry.setArgs(keyFieldSpecified ? "o1" : "p1")).getAll(); assertEquals(1, result.size()); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinarySerializationQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinarySerializationQuerySelfTest.java index 108d57f2462c2..7d74dffafc85d 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinarySerializationQuerySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/BinarySerializationQuerySelfTest.java @@ -114,15 +114,15 @@ public class BinarySerializationQuerySelfTest extends GridCommonAbstractTest { cacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); cacheCfg.setRebalanceMode(CacheRebalanceMode.SYNC); - List queryEntities = new ArrayList<>(); + List qryEntities = new ArrayList<>(); - queryEntities.add(entityForClass(EntityPlain.class)); - queryEntities.add(entityForClass(EntitySerializable.class)); - queryEntities.add(entityForClass(EntityExternalizable.class)); - queryEntities.add(entityForClass(EntityBinarylizable.class)); - queryEntities.add(entityForClass(EntityWriteReadObject.class)); + qryEntities.add(entityForClass(EntityPlain.class)); + qryEntities.add(entityForClass(EntitySerializable.class)); + qryEntities.add(entityForClass(EntityExternalizable.class)); + qryEntities.add(entityForClass(EntityBinarylizable.class)); + qryEntities.add(entityForClass(EntityWriteReadObject.class)); - cacheCfg.setQueryEntities(queryEntities); + cacheCfg.setQueryEntities(qryEntities); cfg.setCacheConfiguration(cacheCfg); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheSqlQueryValueCopySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheSqlQueryValueCopySelfTest.java index edc6db6373485..a5b70c97cabb0 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheSqlQueryValueCopySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/CacheSqlQueryValueCopySelfTest.java @@ -315,8 +315,8 @@ public void testCancelingSqlFieldsQuery() throws Exception { final Collection finalQueries = queries; - for (GridRunningQueryInfo query : finalQueries) - qryProc.cancelLocalQueries(Collections.singleton(query.id())); + for (GridRunningQueryInfo qry : finalQueries) + qryProc.cancelLocalQueries(Collections.singleton(qry.id())); int n = 100; diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ClientReconnectAfterClusterRestartTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ClientReconnectAfterClusterRestartTest.java index 91d5380e40c02..e39022c03835c 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ClientReconnectAfterClusterRestartTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ClientReconnectAfterClusterRestartTest.java @@ -86,7 +86,7 @@ public class ClientReconnectAfterClusterRestartTest extends GridCommonAbstractTe ccfg.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); ccfg.setCacheMode(CacheMode.PARTITIONED); - List queryEntities = new ArrayList<>(); + List qryEntities = new ArrayList<>(); QueryEntity entity = new QueryEntity(); @@ -112,9 +112,9 @@ public class ClientReconnectAfterClusterRestartTest extends GridCommonAbstractTe entity.setIndexes(indexes); - queryEntities.add(entity); + qryEntities.add(entity); - ccfg.setQueryEntities(queryEntities); + ccfg.setQueryEntities(qryEntities); return ccfg; } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java index 25e96c14c9752..e13a6b2ed3209 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheAbstractQuerySelfTest.java @@ -727,17 +727,17 @@ public void testDistributedJoinCustomTableName() throws Exception { cache.put(40, new Type2(2, "Type2 record #2")); cache.put(50, new Type2(3, "Type2 record #3")); - QueryCursor> query = cache.query( + QueryCursor> qry = cache.query( new SqlFieldsQuery("SELECT t2.name, t1.name FROM Type2 as t2 LEFT JOIN Type1 as t1 ON t1.id = t2.id") .setDistributedJoins(cacheMode() == PARTITIONED)); - assertEquals(2, query.getAll().size()); + assertEquals(2, qry.getAll().size()); - query = cache.query( + qry = cache.query( new SqlFieldsQuery("SELECT t2.name, t1.name FROM Type2 as t2 RIGHT JOIN Type1 as t1 ON t1.id = t2.id") .setDistributedJoins(cacheMode() == PARTITIONED)); - assertEquals(3, query.getAll().size()); + assertEquals(3, qry.getAll().size()); } /** diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinTest.java index ac7c9358cbc04..963ed13753de9 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IgniteCacheDistributedJoinTest.java @@ -229,7 +229,7 @@ public void testManyTables() { queryProcessor(ignite).querySqlFields(new SqlFieldsQuery( "INSERT INTO Person(ID, NAME) VALUES (1, 'Ed'), (2, 'Ann'), (3, 'Emma')"), true); - SqlFieldsQuery selectQuery = new SqlFieldsQuery( + SqlFieldsQuery selectQry = new SqlFieldsQuery( "SELECT P1.NAME " + "FROM PERSON P1 " + "JOIN PERSON P2 ON P1.ID = P2.ID " + @@ -241,7 +241,7 @@ public void testManyTables() { "JOIN PERSON P8 ON P1.ID = P8.ID " + "ORDER BY P1.NAME") .setDistributedJoins(true).setEnforceJoinOrder(false); - List> res = queryProcessor(ignite).querySqlFields(selectQuery, true).getAll(); + List> res = queryProcessor(ignite).querySqlFields(selectQry, true).getAll(); assertEquals(3, res.size()); assertThat(res.get(0).get(0), is("Ann")); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IncorrectQueryEntityTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IncorrectQueryEntityTest.java index 0426ca2c3ba29..f6087a405701b 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IncorrectQueryEntityTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/IncorrectQueryEntityTest.java @@ -38,21 +38,21 @@ public class IncorrectQueryEntityTest extends GridCommonAbstractTest { CacheConfiguration dfltCacheCfg = defaultCacheConfiguration(); - QueryEntity queryEntity = new QueryEntity(Object.class.getName(), Object.class.getName()); + QueryEntity qryEntity = new QueryEntity(Object.class.getName(), Object.class.getName()); LinkedHashMap fields = new LinkedHashMap<>(); fields.put("exceptionOid", Object.class.getName()); - queryEntity.setFields(fields); + qryEntity.setFields(fields); Set keyFields = new HashSet<>(); keyFields.add("exceptionOid"); - queryEntity.setKeyFields(keyFields); + qryEntity.setKeyFields(keyFields); - dfltCacheCfg.setQueryEntities(F.asList(queryEntity)); + dfltCacheCfg.setQueryEntities(F.asList(qryEntity)); cfg.setCacheConfiguration(dfltCacheCfg); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/QueryEntityCaseMismatchTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/QueryEntityCaseMismatchTest.java index 7cd10fe2cfc94..8ed66d39d4994 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/QueryEntityCaseMismatchTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/QueryEntityCaseMismatchTest.java @@ -65,14 +65,14 @@ public class QueryEntityCaseMismatchTest extends GridCommonAbstractTest { cfg.setMarshaller(new BinaryMarshaller()); - QueryEntity queryEntity = new QueryEntity("KeyType", Integer.class.getName()); + QueryEntity qryEntity = new QueryEntity("KeyType", Integer.class.getName()); LinkedHashMap fields = new LinkedHashMap<>(); fields.put("a", "TypeA"); fields.put("b", "TypeB"); - queryEntity.setFields(fields); + qryEntity.setFields(fields); //Specify key fields in upper register HashSet keyFields = new HashSet<>(); @@ -80,9 +80,9 @@ public class QueryEntityCaseMismatchTest extends GridCommonAbstractTest { keyFields.add("a"); keyFields.add("B"); - queryEntity.setKeyFields(keyFields); + qryEntity.setKeyFields(keyFields); - ccfg.setQueryEntities(F.asList(queryEntity)); + ccfg.setQueryEntities(F.asList(qryEntity)); cfg.setCacheConfiguration(ccfg); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IgniteDecimalSelfTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IgniteDecimalSelfTest.java index 9eafb60e06b3f..67adbfc0aa2ae 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IgniteDecimalSelfTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IgniteDecimalSelfTest.java @@ -99,12 +99,12 @@ public class IgniteDecimalSelfTest extends AbstractSchemaSelfTest { @NotNull private CacheConfiguration cacheCfg(String tabName, String cacheName) { CacheConfiguration ccfg = new CacheConfiguration<>(cacheName); - QueryEntity queryEntity = new QueryEntity(Integer.class.getName(), Salary.class.getName()); + QueryEntity qryEntity = new QueryEntity(Integer.class.getName(), Salary.class.getName()); - queryEntity.setTableName(tabName); + qryEntity.setTableName(tabName); - queryEntity.addQueryField("id", Integer.class.getName(), null); - queryEntity.addQueryField("amount", BigDecimal.class.getName(), null); + qryEntity.addQueryField("id", Integer.class.getName(), null); + qryEntity.addQueryField("amount", BigDecimal.class.getName(), null); Map precision = new HashMap<>(); Map scale = new HashMap<>(); @@ -112,10 +112,10 @@ public class IgniteDecimalSelfTest extends AbstractSchemaSelfTest { precision.put("amount", PRECISION); scale.put("amount", SCALE); - queryEntity.setFieldsPrecision(precision); - queryEntity.setFieldsScale(scale); + qryEntity.setFieldsPrecision(precision); + qryEntity.setFieldsScale(scale); - ccfg.setQueryEntities(Collections.singletonList(queryEntity)); + ccfg.setQueryEntities(Collections.singletonList(qryEntity)); return ccfg; } @@ -184,17 +184,17 @@ public void testSelectDecimal() throws Exception { /** */ private void checkPrecisionAndScale(String tabName, String colName, Integer precision, Integer scale) { - QueryEntity queryEntity = findTableInfo(tabName); + QueryEntity qryEntity = findTableInfo(tabName); - assertNotNull(queryEntity); + assertNotNull(qryEntity); - Map fieldsPrecision = queryEntity.getFieldsPrecision(); + Map fieldsPrecision = qryEntity.getFieldsPrecision(); assertNotNull(precision); assertEquals(fieldsPrecision.get(colName), precision); - Map fieldsScale = queryEntity.getFieldsScale(); + Map fieldsScale = qryEntity.getFieldsScale(); assertEquals(fieldsScale.get(colName), scale); diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IndexCorruptionRebuildTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IndexCorruptionRebuildTest.java index e53f6bd58146b..bc8ea9a887847 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IndexCorruptionRebuildTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/index/IndexCorruptionRebuildTest.java @@ -165,11 +165,11 @@ public void testCorruptedTree() throws Exception { String value = "test" + i; - String query = "insert into %s(col1, col2, col3, col4) values (?1, ?2, ?3, ?4)"; + String insertQry = "insert into %s(col1, col2, col3, col4) values (?1, ?2, ?3, ?4)"; Stream.of(TABLE_NAME_1, TABLE_NAME_2) .map(tableName -> - new SqlFieldsQuery(String.format(query, tableName)) + new SqlFieldsQuery(String.format(insertQry, tableName)) .setArgs(String.valueOf(counter), value, value, value) ).forEach(cache::query); } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/transaction/DmlInsideTransactionTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/transaction/DmlInsideTransactionTest.java index d49bdb9bc40fd..661b17f78cebb 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/transaction/DmlInsideTransactionTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/transaction/DmlInsideTransactionTest.java @@ -66,10 +66,10 @@ public class DmlInsideTransactionTest extends GridCommonAbstractTest { public void testDmlInTransactionByDefault() throws Exception { prepareIgnite(); - for (String dmlQuery : DML_QUERIES) { - runDmlSqlFieldsQueryInTransactionTest(dmlQuery, false, false); + for (String dmlQry : DML_QUERIES) { + runDmlSqlFieldsQueryInTransactionTest(dmlQry, false, false); - runDmlSqlFieldsQueryInTransactionTest(dmlQuery, true, false); + runDmlSqlFieldsQueryInTransactionTest(dmlQry, true, false); } } @@ -83,10 +83,10 @@ public void testDmlInTransactionByDefault() throws Exception { public void testDmlInTransactionInDisabledCompatibilityMode() throws Exception { prepareIgnite(); - for (String dmlQuery : DML_QUERIES) { - runDmlSqlFieldsQueryInTransactionTest(dmlQuery, false, false); + for (String dmlQry : DML_QUERIES) { + runDmlSqlFieldsQueryInTransactionTest(dmlQry, false, false); - runDmlSqlFieldsQueryInTransactionTest(dmlQuery, true, false); + runDmlSqlFieldsQueryInTransactionTest(dmlQry, true, false); } } @@ -100,10 +100,10 @@ public void testDmlInTransactionInDisabledCompatibilityMode() throws Exception { public void testDmlInTransactionInCompatibilityMode() throws Exception { prepareIgnite(); - for (String dmlQuery : DML_QUERIES) { - runDmlSqlFieldsQueryInTransactionTest(dmlQuery, false, true); + for (String dmlQry : DML_QUERIES) { + runDmlSqlFieldsQueryInTransactionTest(dmlQry, false, true); - runDmlSqlFieldsQueryInTransactionTest(dmlQuery, true, true); + runDmlSqlFieldsQueryInTransactionTest(dmlQry, true, true); } } @@ -116,12 +116,12 @@ public void testDmlInTransactionInCompatibilityMode() throws Exception { public void testDmlNotInTransaction() throws Exception { prepareIgnite(); - for (String dmlQuery : DML_QUERIES) { - grid(0).cache(CACHE_PERSON).query(new SqlFieldsQuery(dmlQuery)); + for (String dmlQry : DML_QUERIES) { + grid(0).cache(CACHE_PERSON).query(new SqlFieldsQuery(dmlQry)); grid(0).cache(CACHE_PERSON).clear(); - grid(0).cache(CACHE_PERSON).query(new SqlFieldsQuery(dmlQuery).setLocal(true)); + grid(0).cache(CACHE_PERSON).query(new SqlFieldsQuery(dmlQry).setLocal(true)); } } @@ -149,8 +149,8 @@ private void prepareIgnite() throws Exception { * @param isAllowed true in case DML should work inside transaction, false otherwise. */ private void runDmlSqlFieldsQueryInTransactionTest(String dmlQry, boolean isLocal, boolean isAllowed) { - SqlFieldsQuery query = new SqlFieldsQuery(dmlQry).setLocal(isLocal); - runDmlInTransactionTest(query, isAllowed); + SqlFieldsQuery qry = new SqlFieldsQuery(dmlQry).setLocal(isLocal); + runDmlInTransactionTest(qry, isAllowed); } /** diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsQueryTest.java index 1ab897286b7ff..5240774c416d3 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsQueryTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/performancestatistics/PerformanceStatisticsQueryTest.java @@ -328,7 +328,7 @@ else if (clientType == THIN_CLIENT) { srv.cluster().forServers().nodes().forEach(node -> readsNodes.add(node.id())); Set dataNodes = new HashSet<>(readsNodes); - AtomicInteger queryCnt = new AtomicInteger(); + AtomicInteger qryCnt = new AtomicInteger(); AtomicInteger readsCnt = new AtomicInteger(); HashSet qryIds = new HashSet<>(); AtomicLong mapRowCnt = new AtomicLong(); @@ -339,7 +339,7 @@ else if (clientType == THIN_CLIENT) { stopCollectStatisticsAndRead(new TestHandler() { @Override public void query(UUID nodeId, GridCacheQueryType type, String text, long id, long queryStartTime, long duration, boolean success) { - queryCnt.incrementAndGet(); + qryCnt.incrementAndGet(); qryIds.add(id); assertTrue(expNodeIds.contains(nodeId)); @@ -405,7 +405,7 @@ else if ("Reduce phase plan".equals(name)) { } }); - assertEquals(1, queryCnt.get()); + assertEquals(1, qryCnt.get()); assertTrue("Query reads expected on nodes: " + readsNodes, readsNodes.isEmpty()); assertEquals(1, qryIds.size()); 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 8a48394929385..098e897a908b0 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 @@ -387,8 +387,8 @@ public void testCancel() throws Exception { if (qCol.isEmpty()) return false; - for (GridRunningQueryInfo queryInfo : qCol) - queryInfo.cancel(); + for (GridRunningQueryInfo qryInfo : qCol) + qryInfo.cancel(); return true; } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryTest.java index 8ea3764add807..0c30057fd8f54 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/KillQueryTest.java @@ -954,7 +954,7 @@ public void testCancelQueryIfUnableToGetNodesForPartitions() throws Exception { String select = "select * from Integer where _val <> 42"; - IgniteInternalFuture runQueryFut = GridTestUtils.runAsync(() -> + IgniteInternalFuture runQryFut = GridTestUtils.runAsync(() -> ignite.cache(DEFAULT_CACHE_NAME).query( new SqlFieldsQuery(select) ).getAll()); @@ -963,8 +963,8 @@ public void testCancelQueryIfUnableToGetNodesForPartitions() throws Exception { () -> findQueriesOnNode(select, ignite).size() == 1, TIMEOUT); if (!gotOneFreezedSelect) { - if (runQueryFut.isDone()) - printFuturesException("Got exception getting running the query.", runQueryFut); + if (runQryFut.isDone()) + printFuturesException("Got exception getting running the query.", runQryFut); Assert.fail("Failed to wait for query to be in running queries list exactly one time " + "[select=" + select + ", node=" + ignite.localNode().id() + ", timeout=" + TIMEOUT + "ms]."); @@ -976,7 +976,7 @@ public void testCancelQueryIfUnableToGetNodesForPartitions() throws Exception { GridTestUtils.assertThrowsAnyCause( log, - () -> runQueryFut.get(CHECK_RESULT_TIMEOUT), + () -> runQryFut.get(CHECK_RESULT_TIMEOUT), CacheException.class, "The query was cancelled while executing."); @@ -1093,9 +1093,9 @@ private IgniteInternalFuture cancelQueryWithBarrier(String qry, String expErrMsg assertFalse(runningQueries.isEmpty()); - for (GridRunningQueryInfo runningQuery : runningQueries) { + for (GridRunningQueryInfo runningQry : runningQueries) { GridTestUtils.assertThrowsAnyCause(log, - () -> igniteForKillRequest.cache(DEFAULT_CACHE_NAME).query(createKillQuery(runningQuery.globalQueryId(), async)), + () -> igniteForKillRequest.cache(DEFAULT_CACHE_NAME).query(createKillQuery(runningQry.globalQueryId(), async)), CacheException.class, expErrMsg); } } @@ -1131,10 +1131,10 @@ private IgniteInternalFuture cancel(int expQryNum, boolean async, String... skip List res = new ArrayList<>(); - for (GridRunningQueryInfo runningQuery : runningQueries) { - if (Stream.of(skipSqls).noneMatch((skipSql -> runningQuery.query().equals(skipSql)))) + for (GridRunningQueryInfo runningQry : runningQueries) { + if (Stream.of(skipSqls).noneMatch((skipSql -> runningQry.query().equals(skipSql)))) res.add(GridTestUtils.runAsync(() -> { - igniteForKillRequest.cache(DEFAULT_CACHE_NAME).query(createKillQuery(runningQuery.globalQueryId(), async)); + igniteForKillRequest.cache(DEFAULT_CACHE_NAME).query(createKillQuery(runningQry.globalQueryId(), async)); } )); } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java index 13ca745de22aa..5bc65cbebc98e 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/RunningQueriesTest.java @@ -262,9 +262,9 @@ public void testAutoCloseQueryAfterIteratorIsExhausted() { for (int i = 0; i < 100; i++) cache.put(i, i); - FieldsQueryCursor> query = cache.query(new SqlFieldsQuery("SELECT * FROM Integer order by _key")); + FieldsQueryCursor> qry = cache.query(new SqlFieldsQuery("SELECT * FROM Integer order by _key")); - query.iterator().forEachRemaining((e) -> { + qry.iterator().forEachRemaining((e) -> { Assert.assertEquals("Should be one running query", 1, ignite.context().query().runningQueries(-1).size()); @@ -565,7 +565,7 @@ public void testMultiStatement() throws Exception { try (Connection conn = GridTestUtils.connect(ignite, null); Statement stmt = conn.createStatement()) { IgniteInternalFuture fut = GridTestUtils.runAsync(() -> stmt.execute(sql)); - for (String query : queries) { + for (String qry : queries) { assertWaitingOnBarrier(); List runningQueries = (List)ignite.context().query() @@ -573,7 +573,7 @@ public void testMultiStatement() throws Exception { assertEquals(1, runningQueries.size()); - assertEquals(query, runningQueries.get(0).query()); + assertEquals(qry, runningQueries.get(0).query()); awaitTimeout(); } diff --git a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/IgniteSqlBigIntegerKeyTest.java b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/IgniteSqlBigIntegerKeyTest.java index e232a3fa0dff8..8e5b4572e99ab 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/IgniteSqlBigIntegerKeyTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/h2/IgniteSqlBigIntegerKeyTest.java @@ -105,9 +105,9 @@ public void testBigIntegerFieldQuery() { private void checkQuery(IgniteCache cache, String sql, Object arg) { SqlFieldsQuery qry = new SqlFieldsQuery(sql).setArgs(arg); - QueryCursor> query = cache.query(qry); + QueryCursor> qryCursor = cache.query(qry); - List> res = query.getAll(); + List> res = qryCursor.getAll(); assertEquals(1, res.size()); diff --git a/modules/indexing/src/test/java/org/apache/ignite/sqltests/BaseSqlTest.java b/modules/indexing/src/test/java/org/apache/ignite/sqltests/BaseSqlTest.java index 77e503b52fe15..61e48c6c64e93 100644 --- a/modules/indexing/src/test/java/org/apache/ignite/sqltests/BaseSqlTest.java +++ b/modules/indexing/src/test/java/org/apache/ignite/sqltests/BaseSqlTest.java @@ -1275,16 +1275,16 @@ public void testCheckEmptySchema() { "Schema name could not be an empty string" ); - String sqlQuery = "SELECT * FROM Employee limit 1"; + String sqlQry = "SELECT * FROM Employee limit 1"; testAllNodes(node -> { - executeFrom(sqlQuery, node, ""); - executeFrom(sqlQuery, node, " "); + executeFrom(sqlQry, node, ""); + executeFrom(sqlQry, node, " "); assertTrue("Check valid schema", - executeFrom(sqlQuery, node, "PUBLIC").values().stream().count() > 0 + executeFrom(sqlQry, node, "PUBLIC").values().stream().count() > 0 ); assertTrue("Check null schema", - executeFrom(sqlQuery, node, null).values().stream().count() > 0 + executeFrom(sqlQry, node, null).values().stream().count() > 0 ); }); } diff --git a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java index 7263d690b405b..3f995fd3ef9dd 100644 --- a/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java +++ b/modules/spring/src/test/java/org/apache/ignite/spring/IgniteExcludeInConfigurationTest.java @@ -63,10 +63,10 @@ public void testExclude() throws Exception { assertEquals(1, cfg.getCacheConfiguration().length); - Collection queryEntities = cfg.getCacheConfiguration()[0].getQueryEntities(); + Collection qryEntities = cfg.getCacheConfiguration()[0].getQueryEntities(); - assertEquals(1, queryEntities.size()); - assertNull(queryEntities.iterator().next().getKeyType()); + assertEquals(1, qryEntities.size()); + assertNull(qryEntities.iterator().next().getKeyType()); } /** Spring should fail if bean class not exist in classpath. */ diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/jdbc/JdbcAbstractBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/jdbc/JdbcAbstractBenchmark.java index 37c789bb26dd3..7f23c2c5ff1e4 100644 --- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/jdbc/JdbcAbstractBenchmark.java +++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/jdbc/JdbcAbstractBenchmark.java @@ -147,8 +147,8 @@ private void populateTestDatabase(Connection conn) throws IOException, SQLExcept } } - for (String query : queries) { - try (PreparedStatement stmt = conn.prepareStatement(query)) { + for (String qry : queries) { + try (PreparedStatement stmt = conn.prepareStatement(qry)) { stmt.executeUpdate(); } } diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/jdbc/RdbmsBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/jdbc/RdbmsBenchmark.java index 67f387d6b7b65..0f4c0d018e2bd 100644 --- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/jdbc/RdbmsBenchmark.java +++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/jdbc/RdbmsBenchmark.java @@ -82,18 +82,18 @@ public class RdbmsBenchmark extends JdbcAbstractBenchmark { long delta = ThreadLocalRandom.current().nextLong(1000); - for (String query : getDbqueries()) { + for (String qry : getDbqueries()) { boolean done = false; - query = query.replaceAll(":aid", Long.toString(aid)); - query = query.replaceAll(":bid", Long.toString(bid)); - query = query.replaceAll(":tid", Long.toString(tid)); - query = query.replaceAll(":delta", Long.toString(delta)); - if (query.contains(":id")) - query = query.replaceAll(":id", Long.toString(cnt.getAndIncrement())); + qry = qry.replaceAll(":aid", Long.toString(aid)); + qry = qry.replaceAll(":bid", Long.toString(bid)); + qry = qry.replaceAll(":tid", Long.toString(tid)); + qry = qry.replaceAll(":delta", Long.toString(delta)); + if (qry.contains(":id")) + qry = qry.replaceAll(":id", Long.toString(cnt.getAndIncrement())); - try (PreparedStatement stmt = conn.get().prepareStatement(query)) { - if (isIgnite && query.startsWith("INSERT")) { + try (PreparedStatement stmt = conn.get().prepareStatement(qry)) { + if (isIgnite && qry.startsWith("INSERT")) { stmt.setLong(1, cnt.getAndIncrement()); stmt.setLong(2, tid); stmt.setLong(3, bid); @@ -106,7 +106,7 @@ public class RdbmsBenchmark extends JdbcAbstractBenchmark { } } catch (Exception ignored) { - BenchmarkUtils.println("Failed to execute query " + query); + BenchmarkUtils.println("Failed to execute query " + qry); } } return true; diff --git a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java index 68038463bfacb..936398ef9e21c 100644 --- a/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java +++ b/modules/yardstick/src/main/java/org/apache/ignite/yardstick/cache/load/IgniteCacheRandomOperationBenchmark.java @@ -260,28 +260,28 @@ private void searchCache() throws Exception { if (configuration.getQueryEntities() != null) { Collection entries = configuration.getQueryEntities(); - for (QueryEntity queryEntity : entries) { + for (QueryEntity qryEntity : entries) { try { - if (queryEntity.getKeyType() != null) { - Class keyCls = Class.forName(queryEntity.getKeyType()); + if (qryEntity.getKeyType() != null) { + Class keyCls = Class.forName(qryEntity.getKeyType()); if (ModelUtil.canCreateInstance(keyCls)) keys.add(keyCls); else throw new IgniteException("Class is unknown for the load test. Make sure you " + - "specified its full name [cache=" + cacheName + ", clsName=" + queryEntity.getKeyType() + ']'); + "specified its full name [cache=" + cacheName + ", clsName=" + qryEntity.getKeyType() + ']'); } - if (queryEntity.getValueType() != null) { - Class valCls = Class.forName(queryEntity.getValueType()); + if (qryEntity.getValueType() != null) { + Class valCls = Class.forName(qryEntity.getValueType()); if (ModelUtil.canCreateInstance(valCls)) values.add(valCls); else throw new IgniteException("Class is unknown for the load test. Make sure you " + - "specified its full name [cache=" + cacheName + ", clsName=" + queryEntity.getValueType() + ']'); + "specified its full name [cache=" + cacheName + ", clsName=" + qryEntity.getValueType() + ']'); - configureCacheSqlDescriptor(cacheName, queryEntity, valCls); + configureCacheSqlDescriptor(cacheName, qryEntity, valCls); } } catch (ClassNotFoundException e) {