use of com.hazelcast.jet.sql.SqlTestSupport.Row in project hazelcast by hazelcast.
the class MapScanMigrationStressTest method stressTest_noIndex.
@Test(timeout = 600_000)
public void stressTest_noIndex() throws InterruptedException {
List<Row> expected = new ArrayList<>();
Map<Integer, Integer> temp = new HashMap<>();
for (int i = 0; i <= ITEM_COUNT / 7; i++) {
temp.put(i, 1);
expected.add(new Row(i, i + "-" + 1));
}
map.putAll(temp);
mutator = new MutatorThread(1000L);
assertRowsAnyOrder("SELECT __key, Concat_WS('-', __key, this) FROM " + MAP_NAME, expected, mutator);
mutator.terminate();
mutator.join();
assertThat(mutatorException.get()).isNull();
}
use of com.hazelcast.jet.sql.SqlTestSupport.Row in project hazelcast by hazelcast.
the class MapScanMigrationStressTest method stressTest_sortedIndex.
@Test(timeout = 600_000)
public void stressTest_sortedIndex() throws InterruptedException {
List<Row> expected = new ArrayList<>();
Map<Integer, Integer> temp = new HashMap<>();
for (int i = 0; i <= ITEM_COUNT; i++) {
temp.put(i, i);
expected.add(new Row(ITEM_COUNT - i, ITEM_COUNT - i));
}
map.putAll(temp);
IndexConfig indexConfig = new IndexConfig(IndexType.SORTED, "this").setName(randomName());
map.addIndex(indexConfig);
mutator = new MutatorThread(2000L);
assertRowsOrdered("SELECT * FROM " + MAP_NAME + " ORDER BY this DESC", expected, mutator);
mutator.terminate();
mutator.join();
assertThat(mutatorException.get()).isNull();
}
use of com.hazelcast.jet.sql.SqlTestSupport.Row in project hazelcast by hazelcast.
the class MapScanMigrationStressTest method stressTest_hashIndex.
@Test(timeout = 600_000)
public void stressTest_hashIndex() throws InterruptedException {
List<Row> expected = new ArrayList<>();
Map<Integer, Integer> temp = new HashMap<>();
for (int i = 0; i <= ITEM_COUNT / 5; i++) {
temp.put(i, 1);
expected.add(new Row(i, 1));
}
map.putAll(temp);
IndexConfig indexConfig = new IndexConfig(IndexType.HASH, "this").setName(randomName());
map.addIndex(indexConfig);
mutator = new MutatorThread(2000L);
// Awful performance of such a query, but still a good load for test.
assertRowsAnyOrder("SELECT * FROM " + MAP_NAME + " WHERE this = 1", expected, mutator);
mutator.terminate();
mutator.join();
assertThat(mutatorException.get()).isNull();
}