diff --git a/.gitignore b/.gitignore index 237882cc1..b1b2848c2 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ buildNumber.properties /.factorypath /.project .DS_Store +/.asciidoctor/ diff --git a/pom.xml b/pom.xml index 26da15987..55df2b90d 100644 --- a/pom.xml +++ b/pom.xml @@ -12,14 +12,14 @@ com.redislabs riot - 0.2.3 + 0.2.4 jar RIOT Redis Input/Output Tool com.redislabs.riot.RiotApplication - + default diff --git a/src/main/java/com/redislabs/riot/cli/AbstractCommand.java b/src/main/java/com/redislabs/riot/cli/AbstractCommand.java index e61604ece..05dc6a311 100644 --- a/src/main/java/com/redislabs/riot/cli/AbstractCommand.java +++ b/src/main/java/com/redislabs/riot/cli/AbstractCommand.java @@ -36,10 +36,10 @@ public enum RedisDriver { private int chunkSize = JobBuilder.DEFAULT_CHUNK_SIZE; @Option(names = "--sleep", description = "Sleep duration in milliseconds between each read.") private Long sleep; - @Option(names = { "-s", "--host" }, description = "Redis server host. (default: localhost).") + @Option(names = "--host", description = "Redis server host. (default: localhost).") private InetAddress host; @Getter - @Option(names = { "-h", "--port" }, description = "Redis server port. (default: ${DEFAULT-VALUE}).") + @Option(names = "--port", description = "Redis server port. (default: ${DEFAULT-VALUE}).") private int port = RedisURI.DEFAULT_REDIS_PORT; @Option(names = "--command-timeout", description = "Redis command timeout in seconds for synchronous command execution (default: ${DEFAULT-VALUE}).") private long commandTimeout = RedisURI.DEFAULT_TIMEOUT; diff --git a/src/main/java/com/redislabs/riot/cli/in/ImportCommand.java b/src/main/java/com/redislabs/riot/cli/in/ImportCommand.java index 16e397266..be137c026 100644 --- a/src/main/java/com/redislabs/riot/cli/in/ImportCommand.java +++ b/src/main/java/com/redislabs/riot/cli/in/ImportCommand.java @@ -12,7 +12,7 @@ import picocli.CommandLine.Command; @Component -@Command(name = "import", description = "Import data into Redis", subcommands = { DelimitedImportSubCommand.class, +@Command(name = "import", description = "Import into Redis", subcommands = { DelimitedImportSubCommand.class, FixedLengthImportSubCommand.class, JsonImportSubCommand.class, DatabaseImportSubCommand.class, GeneratorImportSubCommand.class, SimpleGeneratorImportSubCommand.class }) public class ImportCommand extends AbstractCommand, Map> { diff --git a/src/main/java/com/redislabs/riot/cli/out/ExportCommand.java b/src/main/java/com/redislabs/riot/cli/out/ExportCommand.java new file mode 100644 index 000000000..ea7e17f5b --- /dev/null +++ b/src/main/java/com/redislabs/riot/cli/out/ExportCommand.java @@ -0,0 +1,15 @@ +package com.redislabs.riot.cli.out; + +import java.util.Map; + +import org.springframework.stereotype.Component; + +import com.redislabs.riot.cli.AbstractCommand; + +import picocli.CommandLine.Command; + +@Component +@Command(name = "export", description = "Export from Redis", subcommands = { }) +public class ExportCommand extends AbstractCommand, Map> { + +} diff --git a/src/main/java/com/redislabs/riot/cli/redis/StreamImportSubSubCommand.java b/src/main/java/com/redislabs/riot/cli/redis/StreamImportSubSubCommand.java index ded5a446b..f84d522a8 100644 --- a/src/main/java/com/redislabs/riot/cli/redis/StreamImportSubSubCommand.java +++ b/src/main/java/com/redislabs/riot/cli/redis/StreamImportSubSubCommand.java @@ -7,14 +7,28 @@ import picocli.CommandLine.Option; @Command(name = "stream", description = "Stream data structure") -public class StreamImportSubSubCommand extends AbstractSingleRedisImportSubSubCommand { +public class StreamImportSubSubCommand extends AbstractRedisImportSubSubCommand { + @Option(names = "--keyspace", required = true, description = "Redis keyspace prefix.") + private String keyspace; + @Option(names = "--keys", arity = "1..*", description = "Key fields.") + private String[] keys = new String[0]; @Option(names = "--approximate-trimming", description = "Apply efficient trimming for capped streams using the ~ flag.") private boolean approximateTrimming; @Option(names = "--maxlen", description = "Limit stream to maxlen entries.") private Long maxlen; @Option(names = "--id", description = "Field used for stream entry IDs.") private String idField; + + @Override + protected String getKeyspace() { + return keyspace; + } + + @Override + protected String[] getKeys() { + return keys; + } @Override protected AbstractRedisItemWriter redisItemWriter() {