Skip to content

Commit

Permalink
created modules for each connector
Browse files Browse the repository at this point in the history
  • Loading branch information
jruaux committed Jun 24, 2020
1 parent e82ed51 commit 317d0e4
Show file tree
Hide file tree
Showing 159 changed files with 1,461 additions and 1,020 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ buildNumber.properties
.DS_Store
.asciidoctor/
bin/
/build/
/.gradle/
build/
.gradle/
*.log
/.externalToolBuilders/
.idea
.idea/
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ RIOT is a data import/export tool for Redis. Use RIOT to bulk load/unload data f

Download the {repo-url}/releases/latest[latest release] and untar/unzip the archive.

Launch the `riot` script (`riot.bat` for Windows) and follow the usage information provided.
Launch the `riot-file` script (`riot.bat` for Windows) and follow the usage information provided.

=== Install via Homebrew

```
$ brew install jruaux/tap/riot
$ riot --help
riot --help
```

=== Tab Completion
Expand Down
220 changes: 12 additions & 208 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,214 +1,18 @@
plugins {
id 'application'
id 'java'
id 'java-library'
id 'maven-publish'
id 'org.springframework.boot' version '2.3.1.RELEASE'
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
id 'com.jfrog.bintray' version '1.8.5'
id 'com.github.ben-manes.versions' version '0.28.0'
id 'net.researchgate.release' version '2.8.1'
id 'com.github.breadmoirai.github-release' version '2.2.12'
id 'org.asciidoctor.jvm.convert' version '3.2.0'
id 'org.ajoberstar.git-publish' version '2.1.3'
}

repositories {
jcenter()
mavenCentral()
mavenLocal()
}

ext {
set('springCloudVersion', "Hoxton.SR5")
}

bootJar {
enabled = false
}

jar {
enabled = true
}

dependencies {
implementation 'com.redislabs:picocli-redis:2.0.0'
implementation 'org.slf4j:slf4j-jdk14'
implementation 'org.latencyutils:LatencyUtils:2.0.3'
implementation 'com.redislabs:spring-batch-redis:2.1.1-SNAPSHOT'
// implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
// implementation 'org.springframework.kafka:spring-kafka'
implementation 'com.redislabs:spring-batch-redisearch:2.3.1'
implementation 'org.springframework.batch:spring-batch-core'
implementation 'org.springframework.boot:spring-boot-autoconfigure'
implementation 'org.springframework:spring-jdbc'
implementation 'org.springframework.cloud:spring-cloud-aws-context'
implementation 'org.springframework.cloud:spring-cloud-aws-autoconfigure'
implementation 'org.ruaux:spring-batch-resource:1.0.0'
implementation 'org.ruaux:spring-batch-faker:1.0.1'
implementation 'org.ruaux:spring-batch-xml:1.0.0'
implementation 'com.zaxxer:HikariCP'
implementation 'me.tongfei:progressbar:0.8.1'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.slf4j:slf4j-jdk14'
testImplementation 'org.codehaus.plexus:plexus-utils:3.3.0'
testImplementation 'org.hsqldb:hsqldb'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
testImplementation 'it.ozimov:embedded-redis:0.7.3'
testImplementation 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'
// implementation 'org.xerial:sqlite-jdbc:3.28.0'
// implementation 'com.ibm.db2:jcc:11.5.0.0'
// implementation 'com.microsoft.sqlserver:mssql-jdbc:7.4.1.jre8'
// implementation 'com.oracle.ojdbc:ojdbc8:19.3.0.0'
// implementation 'org.postgresql:postgresql:42.2.8'
}

configurations {
all*.exclude module : 'spring-boot-starter-logging'
}

dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}

test {
useJUnitPlatform()
}

bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : ''
key = project.hasProperty('bintrayKey') ? project.property('bintrayKey') : ''
publications = ['mavenJava']
publish = true
pkg {
repo = 'maven'
name = 'riot'
licenses = ['Apache-2.0']
vcsUrl = 'https://github.com/Redislabs-Solution-Architects/riot.git'
version {
gpg {
sign = true
}
mavenCentralSync {
sync = true
user = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : ''
password = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : ''
}
subprojects {
group = 'com.redislabs.riot'
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
jcenter()
mavenCentral()
mavenLocal()
}
}
}

task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.allJava
}

task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

artifacts {
archives sourcesJar, javadocJar
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId 'com.redislabs'
artifactId 'riot'

pom {
name = 'RIOT'
packaging = 'jar'
description = 'Redis Input/Output Tool'
url = 'https://github.com/Redislabs-Solution-Architects/riot'

scm {
connection = 'scm:git:git://github.com/Redislabs-Solution-Architects/riot.git'
developerConnection = 'scm:git:git@github.com:Redislabs-Solution-Architects/riot.git'
url = 'https://github.com/Redislabs-Solution-Architects/riot'
}

licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id = 'jruaux'
name = 'Julien Ruaux'
}
}
}
}
}
}

group = 'com.redislabs'
description = 'RIOT'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

application {
mainClassName = 'com.redislabs.riot.Riot'
}

jar {
manifest {
attributes("Implementation-Title": "RIOT", "Implementation-Version": archiveVersion)
}
}

tasks.withType(Tar) {
compression = Compression.GZIP
}

asciidoctor {
outputOptions {
separateOutputDirs = false
}
attributes 'commandsdir': 'src/test/resources/commands'
}

task printVersion {
doLast {
println project.version
}
}

githubRelease {
token = project.hasProperty('githubToken') ? project.property('githubToken') : ''
owner "Redislabs-Solution-Architects"
repo "riot"
releaseAssets distZip, distTar
body changelog()
}

gitPublish {
repoUri = 'git@github.com:Redislabs-Solution-Architects/riot.git'
referenceRepoUri = 'file:///Users/jruaux/git/riot/'

branch = 'gh-pages'

contents {
from 'build/docs/asciidoc'
}
}

gitPublishPush.dependsOn asciidoctor

afterReleaseBuild.dependsOn ":githubRelease"
afterReleaseBuild.dependsOn bintrayUpload
afterReleaseBuild.dependsOn gitPublishPush
}
36 changes: 36 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
plugins {
id 'java-library'
}

archivesBaseName = 'riot-core'

bootJar {
enabled = false
}

jar {
enabled = true
}

test {
useJUnitPlatform()
}

dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
api 'com.redislabs:picocli-redis:2.0.2'
api 'com.redislabs:spring-batch-redis:2.2.1'
api 'com.redislabs:spring-batch-redisearch:2.4.1'
implementation 'me.tongfei:progressbar:0.8.1'
implementation 'org.apache.commons:commons-lang3'
implementation 'org.latencyutils:LatencyUtils:2.0.3'
implementation 'org.slf4j:slf4j-api'
api 'org.springframework.batch:spring-batch-core'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml'
testImplementation 'org.junit.jupiter:junit-jupiter-engine'
}

configurations {
all*.exclude module : 'spring-boot-starter-logging'
}
25 changes: 25 additions & 0 deletions core/src/main/java/com/redislabs/riot/AbstractExportCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.redislabs.riot;

import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.redis.RedisKeyValueItemReader;
import org.springframework.batch.item.redis.support.KeyValue;
import picocli.CommandLine;

@CommandLine.Command
public abstract class AbstractExportCommand<O> extends AbstractTransferCommand<KeyValue<String>, O> {

@CommandLine.Mixin
private RedisExportOptions options = new RedisExportOptions();
@CommandLine.Option(names = "--key-regex", description = "Regular expression for key-field extraction", paramLabel = "<regex>")
private String keyRegex;

@Override
protected String taskName() {
return "Exporting";
}

public ItemReader<KeyValue<String>> reader() {
return configure(RedisKeyValueItemReader.builder().scanCount(options.getScanCount()).scanMatch(options.getScanMatch()).batch(options.getBatchSize()).queueCapacity(options.getQueueCapacity()).threads(options.getThreads())).build();
}

}
Loading

0 comments on commit 317d0e4

Please sign in to comment.