Skip to content

Commit

Permalink
build: Introduced modules file, db, and faker
Browse files Browse the repository at this point in the history
  • Loading branch information
jruaux committed Sep 3, 2023
1 parent 87e4ef5 commit 986fc8a
Show file tree
Hide file tree
Showing 92 changed files with 2,897 additions and 347 deletions.
4 changes: 2 additions & 2 deletions core/riot-core/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
project_description = RIOT Engine
automatic.module.name = com.redis.riot.engine
project_description = RIOT Core
automatic.module.name = com.redis.riot.core
17 changes: 0 additions & 17 deletions core/riot-core/riot-core.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,13 @@ dependencies {
api 'org.slf4j:jcl-over-slf4j'
api group: 'com.redis', name: 'lettucemod', version: lettucemodVersion
api group: 'com.redis', name: 'spring-batch-redis', version: springBatchRedisVersion
api group: 'net.datafaker', name: 'datafaker', version: datafakerVersion
api 'org.springframework.batch:spring-batch-core'
api 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
implementation group: 'org.latencyutils', name: 'LatencyUtils', version: latencyutilsVersion
implementation 'org.apache.commons:commons-pool2'
implementation 'org.springframework.boot:spring-boot-autoconfigure'
implementation 'org.springframework:spring-jdbc'
implementation 'org.springframework:spring-oxm'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-aws-context', version: awsVersion
implementation group: 'org.springframework.cloud', name: 'spring-cloud-aws-autoconfigure', version: awsVersion
implementation (group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-storage', version: gcpVersion) {
exclude group: 'javax.annotation', module: 'javax.annotation-api'
}
implementation 'com.mysql:mysql-connector-j'
implementation 'org.postgresql:postgresql'
implementation group: 'com.ibm.db2', name: 'jcc', version: db2Version
implementation group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: mssqlVersion
implementation group: 'com.oracle.ojdbc', name: 'ojdbc8', version: oracleVersion
implementation group: 'org.xerial', name: 'sqlite-jdbc', version: sqliteVersion
testImplementation 'org.slf4j:slf4j-simple'
testImplementation group: 'com.redis', name: 'spring-batch-redis', version: springBatchRedisVersion, classifier: 'tests'
testImplementation group: 'org.awaitility', name: 'awaitility', version: awaitilityVersion
testImplementation group: 'org.testcontainers', name: 'postgresql', version: testcontainersVersion
testImplementation group: 'org.testcontainers', name: 'oracle-xe', version: testcontainersVersion
}

compileJava {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.redis.riot.core;

import com.redis.spring.batch.RedisItemWriter;
import com.redis.spring.batch.ValueType;

import io.lettuce.core.AbstractRedisClient;
import io.lettuce.core.codec.StringCodec;
Expand All @@ -19,6 +20,7 @@ public void setRedisWriterOptions(RedisWriterOptions redisWriterOptions) {

protected RedisItemWriter<String, String> writer() {
RedisItemWriter<String, String> writer = new RedisItemWriter<>(client, StringCodec.UTF8);
writer.setValueType(ValueType.STRUCT);
redisWriterOptions.configure(writer);
return writer;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.replicate;
package com.redis.riot.core;

import java.util.List;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.replicate;
package com.redis.riot.core;

import java.util.List;
import java.util.function.Function;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.replicate;
package com.redis.riot.core;

import java.time.Duration;

Expand All @@ -18,11 +18,6 @@

import com.redis.lettucemod.api.StatefulRedisModulesConnection;
import com.redis.lettucemod.util.RedisModulesUtils;
import com.redis.riot.core.AbstractExport;
import com.redis.riot.core.KeyValueOperatorOptions;
import com.redis.riot.core.RedisReaderOptions;
import com.redis.riot.core.RedisWriterOptions;
import com.redis.riot.core.StepBuilder;
import com.redis.spring.batch.KeyValue;
import com.redis.spring.batch.RedisItemReader;
import com.redis.spring.batch.RedisItemReader.Mode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.replicate;
package com.redis.riot.core;

public enum ReplicationMode {
SNAPSHOT, LIVE, LIVEONLY, COMPARE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.springframework.batch.item.support.ListItemWriter;
import org.springframework.expression.Expression;

import com.redis.riot.core.replicate.Replication;
import com.redis.spring.batch.test.AbstractTargetTestBase;
import com.redis.spring.batch.util.KeyComparisonItemReader;

Expand Down
19 changes: 19 additions & 0 deletions core/riot-db/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2022-2023 The RIOT authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
project_description = RIOT DB
automatic.module.name = com.redis.riot.db
49 changes: 49 additions & 0 deletions core/riot-db/riot-db.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020-2023 The RIOT authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
config {
licensing {
enabled = false
}
}

dependencies {
implementation project(':riot-core')
implementation 'org.springframework.boot:spring-boot-autoconfigure'
implementation 'org.springframework:spring-jdbc'
implementation 'com.mysql:mysql-connector-j'
implementation 'org.postgresql:postgresql'
implementation group: 'com.ibm.db2', name: 'jcc', version: db2Version
implementation group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: mssqlVersion
implementation group: 'com.oracle.ojdbc', name: 'ojdbc8', version: oracleVersion
implementation group: 'org.xerial', name: 'sqlite-jdbc', version: sqliteVersion
testImplementation group: 'com.redis', name: 'spring-batch-redis', version: springBatchRedisVersion, classifier: 'tests'
testImplementation group: 'org.testcontainers', name: 'postgresql', version: testcontainersVersion
testImplementation group: 'org.testcontainers', name: 'oracle-xe', version: testcontainersVersion
}

compileJava {
options.compilerArgs += ["-AprojectPath=${project.group}/${project.name}"]
}

if (!(project.findProperty('automatic.module.name.skip') ?: false).toBoolean()) {
jar {
manifest {
attributes('Automatic-Module-Name': project.findProperty('automatic.module.name'))
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.db;
package com.redis.riot.db;

public class DataSourceOptions {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.db;
package com.redis.riot.db;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.db;
package com.redis.riot.db;

import java.util.Map;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.db;
package com.redis.riot.db;

import javax.sql.DataSource;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core;
package com.redis.riot.db;

import java.io.FileNotFoundException;
import java.io.IOException;
Expand All @@ -14,7 +14,6 @@
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.testcontainers.containers.JdbcDatabaseContainer;

import com.redis.riot.core.db.DataSourceOptions;
import com.redis.spring.batch.test.AbstractTestBase;
import com.redis.testcontainers.RedisServer;
import com.redis.testcontainers.RedisStackContainer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core;
package com.redis.riot.db;

import java.io.IOException;
import java.sql.ResultSet;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core;
package com.redis.riot.db;

import java.io.IOException;
import java.io.LineNumberReader;
Expand Down
19 changes: 19 additions & 0 deletions core/riot-faker/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2022-2023 The RIOT authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
project_description = RIOT Faker
automatic.module.name = com.redis.riot.faker
39 changes: 39 additions & 0 deletions core/riot-faker/riot-faker.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020-2023 The RIOT authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
config {
licensing {
enabled = false
}
}

dependencies {
implementation project(':riot-core')
implementation group: 'net.datafaker', name: 'datafaker', version: datafakerVersion
}

compileJava {
options.compilerArgs += ["-AprojectPath=${project.group}/${project.name}"]
}

if (!(project.findProperty('automatic.module.name.skip') ?: false).toBoolean()) {
jar {
manifest {
attributes('Automatic-Module-Name': project.findProperty('automatic.module.name'))
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.faker;
package com.redis.riot.faker;

import java.util.LinkedHashMap;
import java.util.Locale;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.faker;
package com.redis.riot.faker;

import java.util.HashMap;
import java.util.LinkedHashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.faker;
package com.redis.riot.faker;

import java.lang.reflect.Array;
import java.lang.reflect.Field;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core;
package com.redis.riot.faker;

import java.util.LinkedHashMap;
import java.util.List;
Expand All @@ -8,7 +8,7 @@
import org.junit.jupiter.api.Test;
import org.springframework.batch.item.ExecutionContext;

import com.redis.riot.core.faker.FakerItemReader;
import com.redis.riot.faker.FakerItemReader;
import com.redis.spring.batch.util.BatchUtils;

class FakerReaderTests {
Expand Down
19 changes: 19 additions & 0 deletions core/riot-file/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright 2022-2023 The RIOT authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
project_description = RIOT File
automatic.module.name = com.redis.riot.file
45 changes: 45 additions & 0 deletions core/riot-file/riot-file.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2020-2023 The RIOT authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
config {
licensing {
enabled = false
}
}

dependencies {
implementation project(':riot-core')
implementation 'org.springframework:spring-oxm'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-aws-context', version: awsVersion
implementation group: 'org.springframework.cloud', name: 'spring-cloud-aws-autoconfigure', version: awsVersion
implementation (group: 'org.springframework.cloud', name: 'spring-cloud-gcp-starter-storage', version: gcpVersion) {
exclude group: 'javax.annotation', module: 'javax.annotation-api'
}
testImplementation group: 'com.redis', name: 'spring-batch-redis', version: springBatchRedisVersion, classifier: 'tests'
}

compileJava {
options.compilerArgs += ["-AprojectPath=${project.group}/${project.name}"]
}

if (!(project.findProperty('automatic.module.name.skip') ?: false).toBoolean()) {
jar {
manifest {
attributes('Automatic-Module-Name': project.findProperty('automatic.module.name'))
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.file;
package com.redis.riot.file;

public class AmazonS3Options {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.redis.riot.core.file;
package com.redis.riot.file;

import org.springframework.cloud.aws.core.io.s3.SimpleStorageProtocolResolver;

Expand Down
Loading

0 comments on commit 986fc8a

Please sign in to comment.