diff --git a/connectors/riot-db/src/test/java/com/redis/riot/db/PostgresIntegrationTests.java b/connectors/riot-db/src/test/java/com/redis/riot/db/PostgresIntegrationTests.java index 09634336d..c03b057a7 100644 --- a/connectors/riot-db/src/test/java/com/redis/riot/db/PostgresIntegrationTests.java +++ b/connectors/riot-db/src/test/java/com/redis/riot/db/PostgresIntegrationTests.java @@ -72,7 +72,7 @@ void clearTables() throws SQLException { @ParameterizedTest @RedisTestContextsSource - void testExport(RedisTestContext redis) throws Exception { + void export(RedisTestContext redis) throws Exception { try (Statement statement = connection.createStatement()) { statement.execute("CREATE TABLE mytable (id smallint NOT NULL, field1 bpchar, field2 bpchar)"); statement.execute("ALTER TABLE ONLY mytable ADD CONSTRAINT pk_mytable PRIMARY KEY (id)"); @@ -96,7 +96,7 @@ void testExport(RedisTestContext redis) throws Exception { @ParameterizedTest @RedisTestContextsSource - void testExportNullValues(RedisTestContext redis) throws Exception { + void nullValueExport(RedisTestContext redis) throws Exception { try (Statement statement = connection.createStatement()) { statement.execute("CREATE TABLE mytable (id smallint NOT NULL, field1 bpchar, field2 bpchar)"); statement.execute("ALTER TABLE ONLY mytable ADD CONSTRAINT pk_mytable PRIMARY KEY (id)"); @@ -104,10 +104,10 @@ void testExportNullValues(RedisTestContext redis) throws Exception { Map hash1 = new HashMap<>(); hash1.put("field1", "value1"); hash1.put("field2", "value2"); - sync.hmset("gen:hash:1", hash1); + sync.hmset("gen:1", hash1); Map hash2 = new HashMap<>(); hash2.put("field2", "value2"); - sync.hmset("gen:hash:2", hash2); + sync.hmset("gen:2", hash2); execute("export-postgresql", redis, r -> configureExportCommand(r, POSTGRESQL)); statement.execute("SELECT COUNT(*) AS count FROM mytable"); ResultSet countResultSet = statement.getResultSet(); @@ -126,7 +126,7 @@ void testExportNullValues(RedisTestContext redis) throws Exception { @ParameterizedTest @RedisTestContextsSource - void testImport(RedisTestContext redis) throws Exception { + void hashImport(RedisTestContext redis) throws Exception { execute("import-postgresql", redis, r -> configureImportCommand(r, POSTGRESQL)); try (Statement statement = connection.createStatement()) { statement.execute("SELECT COUNT(*) AS count FROM orders"); @@ -143,14 +143,14 @@ void testImport(RedisTestContext redis) throws Exception { @ParameterizedTest @RedisTestContextsSource - void testImportNoop(RedisTestContext redis) throws Exception { + void noopImport(RedisTestContext redis) throws Exception { execute("import-postgresql-noop", redis, r -> configureImportCommand(r, POSTGRESQL)); Assertions.assertEquals(0, redis.sync().dbsize()); } @ParameterizedTest @RedisTestContextsSource - void testMultiThreadedImport(RedisTestContext redis) throws Exception { + void multiThreadedImport(RedisTestContext redis) throws Exception { execute("import-postgresql-multithreaded", redis, r -> configureImportCommand(r, POSTGRESQL)); try (Statement statement = connection.createStatement()) { statement.execute("SELECT COUNT(*) AS count FROM orders"); @@ -167,7 +167,7 @@ void testMultiThreadedImport(RedisTestContext redis) throws Exception { @ParameterizedTest @RedisTestContextsSource - void testImportSet(RedisTestContext redis) throws Exception { + void setImport(RedisTestContext redis) throws Exception { execute("import-postgresql-set", redis, r -> configureImportCommand(r, POSTGRESQL)); try (Statement statement = connection.createStatement()) { statement.execute("SELECT * FROM orders"); diff --git a/connectors/riot-db/src/test/resources/export-postgresql b/connectors/riot-db/src/test/resources/export-postgresql index c42fb2016..6df6ad0e3 100644 --- a/connectors/riot-db/src/test/resources/export-postgresql +++ b/connectors/riot-db/src/test/resources/export-postgresql @@ -1 +1 @@ -riot-db export "INSERT INTO mytable (id, field1, field2) VALUES (CAST(:id AS SMALLINT), :field1, :field2)" --url "jdbc:postgresql://host:port/database" --username appuser --password passwd --scan-match "gen:hash:*" --key-regex "gen:hash:(?.*)" \ No newline at end of file +riot-db export "INSERT INTO mytable (id, field1, field2) VALUES (CAST(:id AS SMALLINT), :field1, :field2)" --url "jdbc:postgresql://host:port/database" --username appuser --password passwd --scan-match "gen:*" --key-regex "gen:(?.*)" \ No newline at end of file diff --git a/connectors/riot-gen/src/main/java/com/redis/riot/gen/DataStructureGeneratorCommand.java b/connectors/riot-gen/src/main/java/com/redis/riot/gen/DataStructureGeneratorCommand.java index ce03686df..e54150260 100644 --- a/connectors/riot-gen/src/main/java/com/redis/riot/gen/DataStructureGeneratorCommand.java +++ b/connectors/riot-gen/src/main/java/com/redis/riot/gen/DataStructureGeneratorCommand.java @@ -46,9 +46,10 @@ protected Job job(JobBuilder jobBuilder) throws Exception { private ItemReader> reader() { DataStructureGeneratorItemReader.Builder reader = DataStructureGeneratorItemReader.builder() - .start(options.getStart()).count(options.getCount()).streamSize(options.getStreamSize()) - .streamFieldCount(options.getStreamFieldCount()).streamFieldSize(options.getStreamFieldSize()) - .listSize(options.getListSize()).setSize(options.getSetSize()).zsetSize(options.getZsetSize()) + .currentItemCount(options.getStart() - 1).maxItemCount(options.getCount()) + .streamSize(options.getStreamSize()).streamFieldCount(options.getStreamFieldCount()) + .streamFieldSize(options.getStreamFieldSize()).listSize(options.getListSize()) + .setSize(options.getSetSize()).zsetSize(options.getZsetSize()) .timeseriesSize(options.getTimeseriesSize()).keyspace(options.getKeyspace()) .stringSize(options.getStringSize()).types(options.getTypes().toArray(Type[]::new)) .zsetScore(options.getZsetScore()).hashSize(options.getHashSize()) diff --git a/connectors/riot-redis/src/test/java/com/redis/riot/redis/RedisIntegrationTests.java b/connectors/riot-redis/src/test/java/com/redis/riot/redis/RedisIntegrationTests.java index e212bacf9..980127632 100644 --- a/connectors/riot-redis/src/test/java/com/redis/riot/redis/RedisIntegrationTests.java +++ b/connectors/riot-redis/src/test/java/com/redis/riot/redis/RedisIntegrationTests.java @@ -87,7 +87,7 @@ void replicateHyperLogLog(RedisTestContext redis) throws Throwable { @ParameterizedTest @RedisTestContextsSource void replicateKeyProcessor(RedisTestContext redis) throws Throwable { - generate(DataStructureGeneratorItemReader.builder().count(200).build(), redis); + generate(DataStructureGeneratorItemReader.builder().maxItemCount(200).build(), redis); Long sourceSize = redis.sync().dbsize(); Assertions.assertTrue(sourceSize > 0); execute("replicate-key-processor", redis, this::configureReplicateCommand); @@ -116,11 +116,13 @@ void replicateDSLive(RedisTestContext container) throws Exception { private void runLiveReplication(String filename, RedisTestContext source) throws Exception { source.sync().configSet("notify-keyspace-events", "AK"); - generate(DataStructureGeneratorItemReader.builder().count(3000).build(), source); + generate(DataStructureGeneratorItemReader.builder().maxItemCount(3000).build(), source); ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); executor.schedule(() -> { try { - generate(1, DataStructureGeneratorItemReader.builder().start(3000).count(2000).build(), source); + generate(1, + DataStructureGeneratorItemReader.builder().currentItemCount(3000).maxItemCount(2000).build(), + source); } catch (Exception e) { e.printStackTrace(); } diff --git a/gradle.properties b/gradle.properties index ccc0f930d..54cedcb4e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ kordampBuildVersion=2.6.0 avroVersion=1.11.0 awaitilityVersion=4.2.0 awsVersion=2.2.6.RELEASE -batchRedisVersion=2.32.1 +batchRedisVersion=2.32.2 commonsIoVersion=2.11.0 db2Version=11.5.7.0 fakerVersion=1.0.2