From 689cdff312962a6d40475634d29f6b2f17c46066 Mon Sep 17 00:00:00 2001 From: Julien Ruaux Date: Sat, 8 Jun 2019 01:03:33 -0700 Subject: [PATCH] added faker help --- README.adoc | 76 +++++++++++++++- .../redislabs/riot/cli/CommandsBuilder.java | 32 ------- .../redislabs/riot/cli/in/GeneratorHelp.java | 56 ++++++++++++ .../riot/cli/in/GeneratorImport.java | 17 ++-- .../com/redislabs/riot/cli/in/Import.java | 2 +- .../riot/cli/in/SimpleGeneratorImport.java | 2 +- .../in/redis/AbstractRediSearchImport.java | 8 +- .../riot/cli/in/redis/SearchImport.java | 6 +- .../riot/cli/in/redis/SuggestImport.java | 8 +- .../riot/generator/GeneratorFaker.java | 28 ++++++ .../riot/generator/GeneratorReader.java | 20 ++-- .../generator/GeneratorReaderBuilder.java | 30 ------ .../redis/writer/AbstractRedisCommands.java | 29 ------ .../riot/redis/writer/JedisCommands.java | 79 ---------------- .../riot/redis/writer/LettuceCommands.java | 91 ------------------- .../riot/redis/writer/RedisCommands.java | 37 -------- ...ava => AbstractLettuSearchItemWriter.java} | 2 +- .../writer/search/AggregateOperation.java | 20 ---- ...dWriter.java => LettuSearchAddWriter.java} | 2 +- ...ter.java => LettuSearchSuggestWriter.java} | 2 +- .../riot/redis/writer/search/MapTemplate.java | 63 ------------- .../writer/search/RediSearchProperties.java | 56 ------------ .../redis/writer/search/RediSearchType.java | 6 -- .../riot/redis/writer/search/SchemaField.java | 22 ----- .../search/aggregate/ApplyOperation.java | 11 --- .../search/aggregate/FilterOperation.java | 9 -- .../writer/search/aggregate/FirstValue.java | 14 --- .../writer/search/aggregate/FirstValueBy.java | 13 --- .../search/aggregate/GroupOperation.java | 14 --- .../search/aggregate/LimitOperation.java | 10 -- .../search/aggregate/PropertyReducer.java | 12 --- .../writer/search/aggregate/Quantile.java | 12 --- .../writer/search/aggregate/RandomSample.java | 12 --- .../search/aggregate/ReduceFunction.java | 21 ----- .../writer/search/aggregate/Reducer.java | 9 -- .../search/aggregate/SortOperation.java | 16 ---- 36 files changed, 188 insertions(+), 659 deletions(-) delete mode 100644 src/main/java/com/redislabs/riot/cli/CommandsBuilder.java create mode 100644 src/main/java/com/redislabs/riot/cli/in/GeneratorHelp.java create mode 100644 src/main/java/com/redislabs/riot/generator/GeneratorFaker.java delete mode 100644 src/main/java/com/redislabs/riot/generator/GeneratorReaderBuilder.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/AbstractRedisCommands.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/JedisCommands.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/LettuceCommands.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/RedisCommands.java rename src/main/java/com/redislabs/riot/redis/writer/search/{AbstractRediSearchItemWriter.java => AbstractLettuSearchItemWriter.java} (86%) delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/AggregateOperation.java rename src/main/java/com/redislabs/riot/redis/writer/search/{SearchAddWriter.java => LettuSearchAddWriter.java} (92%) rename src/main/java/com/redislabs/riot/redis/writer/search/{SuggestWriter.java => LettuSearchSuggestWriter.java} (92%) delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/MapTemplate.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/RediSearchProperties.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/RediSearchType.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/SchemaField.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/ApplyOperation.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FilterOperation.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FirstValue.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FirstValueBy.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/GroupOperation.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/LimitOperation.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/PropertyReducer.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/Quantile.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/RandomSample.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/ReduceFunction.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/Reducer.java delete mode 100644 src/main/java/com/redislabs/riot/redis/writer/search/aggregate/SortOperation.java diff --git a/README.adoc b/README.adoc index e7ad39a93..e4050ac61 100644 --- a/README.adoc +++ b/README.adoc @@ -187,7 +187,7 @@ riot import json --url https://raw.githubusercontent.com/rethinkdb/beerthink/mas ==== People [source,shell] ---- -riot import --max 100 gen --field id=sequence --field firstName=faker.name.firstName --field lastName=faker.name.lastName --field address=faker.address.fullAddress hash --keyspace person --keys id +riot import faker --max 100 --field id=sequence --field firstName=name.firstName --field lastName=name.lastName --field address=address.fullAddress hash --keyspace person --keys id ---- [source,plaintext] @@ -204,7 +204,7 @@ riot import --max 100 gen --field id=sequence --field firstName=faker.name.first ==== Game of Thrones [source,shell] ---- -riot import --max 100 gen --field name=faker.gameOfThrones.character set --keyspace got:characters --fields name +riot import faker --max 100 --field name=gameOfThrones.character set --keyspace got:characters --fields name ---- [source,plaintext] @@ -220,9 +220,75 @@ riot import --max 100 gen --field name=faker.gameOfThrones.character set --keysp ==== Faker Generators -These are the https://github.com/DiUS/java-faker[Faker generators] available: - -`address, ancient, app, artist, avatar, beer, book, bool, business, cat, chuckNorris, code, color, commerce, company, country, crypto, currency, dateAndTime, demographic, dog, dragonBall, educator, esports, file, finance, food, friends, funnyName, gameOfThrones, hacker, harryPotter, hipster, hitchhikersGuideToTheGalaxy, hobbit, howIMetYourMother, idNumber, internet, job, leagueOfLegends, lebowski, lordOfTheRings, lorem, matz, medical, music, name, number, options, overwatch, phoneNumber, pokemon, randomService, rickAndMorty, robin, rockBand, shakespeare, slackEmoji, space, starTrek, stock, superhero, team, twinPeaks, university, weather, witcher, yoda, zelda` +https://github.com/DiUS/java-faker[Faker] generators: + +* *address*: state timeZone lastName country latitude longitude firstName streetAddressNumber streetName zipCode streetAddress secondaryAddress stateAbbr streetSuffix streetPrefix citySuffix cityPrefix city cityName countryCode buildingNumber fullAddress +* *ancient*: primordial titan god hero +* *app*: name version author +* *artist*: name +* *avatar*: image +* *beer*: name yeast malt hop style +* *book*: title publisher author genre +* *bool*: bool +* *business*: creditCardNumber creditCardType creditCardExpiry +* *cat*: name registry breed +* *chuckNorris*: fact +* *code*: asin isbnGs1 isbnGroup isbnRegistrant isbn10 isbn13 imei ean8 gtin8 ean13 gtin13 +* *color*: name hex +* *commerce*: productName material price promotionCode department color +* *company*: name suffix url industry profession buzzword catchPhrase logo domainName bs domainSuffix +* *country*: flag currencyCode currency countryCode2 countryCode3 capital +* *crypto*: sha1 sha256 md5 sha512 +* *currency*: name code +* *date*: birthday +* *demographic*: educationalAttainment demonym race sex maritalStatus +* *dog*: name size memePhrase age sound coatLength gender breed +* *dragonBall*: character +* *educator*: secondarySchool course campus university +* *esports*: event player league game team +* *file*: fileName extension mimeType +* *finance*: creditCard bic iban randomCreditCardType createCountryCodeToBasicBankAccountNumberPatternMap +* *food*: spice ingredient measurement +* *friends*: location character quote +* *funnyName*: name +* *gameOfThrones*: character dragon house quote city +* *hacker*: abbreviation adjective noun verb ingverb +* *harryPotter*: location character quote book +* *hipster*: word +* *hitchhikersGuideToTheGalaxy*: location character specie marvinQuote starship quote planet +* *hobbit*: location character thorinsCompany quote +* *howIMetYourMother*: character catchPhrase highFive quote +* *idNumber*: valid ssnValid validSvSeSsn invalidSvSeSsn invalid +* *internet*: url uuid domainName password image avatar slug emailAddress safeEmailAddress domainWord domainSuffix macAddress ipV4Address privateIpV4Address publicIpV4Address ipV4Cidr ipV6Address ipV6Cidr userAgentAny +* *job*: field position title keySkills seniority +* *leagueOfLegends*: location summonerSpell masteries champion rank quote +* *lebowski*: character actor quote +* *lordOfTheRings*: location character +* *lorem*: character words word characters sentence paragraph +* *matz*: quote +* *medical*: medicineName symptoms diseaseName hospitalName +* *music*: key instrument chord genre +* *name*: name prefix suffix title lastName fullName firstName nameWithMiddle username +* *number*: digit randomDigit randomDigitNotZero randomNumber +* *overwatch*: location quote hero +* *phoneNumber*: phoneNumber cellPhone +* *pokemon*: name location +* *rickAndMorty*: location character quote +* *robin*: quote +* *rockBand*: name +* *shakespeare*: hamletQuote asYouLikeItQuote kingRichardIIIQuote romeoAndJulietQuote +* *slackEmoji*: people nature activity foodAndDrink celebration travelAndPlaces objectsAndSymbols custom emoji +* *space*: company planet moon galaxy nebula starCluster constellation star agency agencyAbbreviation meteorite nasaSpaceCraft distanceMeasurement +* *starTrek*: location character specie villain +* *stock*: nyseSymbol nsdqSymbol +* *superhero*: name prefix suffix descriptor power +* *team*: name state sport creature +* *twinPeaks*: location character quote +* *university*: name prefix suffix +* *weather*: temperatureCelsius temperatureFahrenheit description +* *witcher*: location character school monster quote witcher +* *yoda*: quote +* *zelda*: character game === Export to Databases diff --git a/src/main/java/com/redislabs/riot/cli/CommandsBuilder.java b/src/main/java/com/redislabs/riot/cli/CommandsBuilder.java deleted file mode 100644 index b1e04f94d..000000000 --- a/src/main/java/com/redislabs/riot/cli/CommandsBuilder.java +++ /dev/null @@ -1,32 +0,0 @@ - -package com.redislabs.riot.cli; - -import com.redislabs.riot.redis.writer.JedisCommands; -import com.redislabs.riot.redis.writer.LettuceCommands; -import com.redislabs.riot.redis.writer.RedisCommands; - -import lombok.Setter; - -public class CommandsBuilder { - - @Setter - private RedisDriver driver; - - public RedisCommands build() { - switch (driver) { - case Lettuce: - return lettuceCommands(); - default: - return jedisCommands(); - } - } - - protected RedisCommands jedisCommands() { - return new JedisCommands(); - } - - protected RedisCommands lettuceCommands() { - return new LettuceCommands(); - } - -} diff --git a/src/main/java/com/redislabs/riot/cli/in/GeneratorHelp.java b/src/main/java/com/redislabs/riot/cli/in/GeneratorHelp.java new file mode 100644 index 000000000..59ee5322d --- /dev/null +++ b/src/main/java/com/redislabs/riot/cli/in/GeneratorHelp.java @@ -0,0 +1,56 @@ +package com.redislabs.riot.cli.in; + +import java.lang.reflect.Method; +import java.lang.reflect.Parameter; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import org.springframework.core.convert.Property; + +import com.github.javafaker.Faker; + +import picocli.CommandLine.Command; + +@Command(name = "faker-help", description = "Print all faker entities") +public class GeneratorHelp implements Runnable { + + private final static List EXCLUDES = Arrays.asList("instance", "options"); + + @Override + public void run() { + Arrays.asList(Faker.class.getDeclaredMethods()).stream().filter(this::accept) + .sorted((m1, m2) -> m1.getName().compareTo(m2.getName())).forEach(this::print); + } + + public boolean accept(Method method) { + if (EXCLUDES.contains(method.getName())) { + return false; + } + return method.getReturnType().getPackage().equals(Faker.class.getPackage()); + } + + public void print(Method method) { + System.out.println(method.getName() + ": " + + String.join(" ", + Arrays.asList(method.getReturnType().getDeclaredMethods()).stream() + .filter(m -> m.getParameters().length == 0).map(m -> describe(m)) + .collect(Collectors.toList()))); + } + + private String describe(Method method) { + String description = method.getName(); + if (method.getParameters().length > 0) { + description += "("; + description += String.join(", ", + Arrays.asList(method.getParameters()).stream().map(p -> describe(p)).collect(Collectors.toList())); + description += ")"; + } + return description; + } + + private String describe(Parameter parameter) { + return parameter.getType().getSimpleName(); + } + +} diff --git a/src/main/java/com/redislabs/riot/cli/in/GeneratorImport.java b/src/main/java/com/redislabs/riot/cli/in/GeneratorImport.java index 1154fd3bb..5895d458c 100644 --- a/src/main/java/com/redislabs/riot/cli/in/GeneratorImport.java +++ b/src/main/java/com/redislabs/riot/cli/in/GeneratorImport.java @@ -5,13 +5,15 @@ import java.util.Locale; import java.util.Map; +import org.springframework.expression.Expression; +import org.springframework.expression.spel.standard.SpelExpressionParser; + import com.redislabs.riot.generator.GeneratorReader; -import com.redislabs.riot.generator.GeneratorReaderBuilder; import picocli.CommandLine.Command; import picocli.CommandLine.Option; -@Command(name = "gen", description = "Import randomly generated data") +@Command(name = "faker", description = "Import randomly generated data") public class GeneratorImport extends AbstractImportReaderCommand { @Option(names = "--map", description = "SpEL expression to generate maps.", paramLabel = "") @@ -23,10 +25,13 @@ public class GeneratorImport extends AbstractImportReaderCommand { @Override public GeneratorReader reader() { - GeneratorReaderBuilder builder = new GeneratorReaderBuilder(); - builder.setFields(fieldExpressions); - builder.setLocale(locale); - return builder.build(); + SpelExpressionParser parser = new SpelExpressionParser(); + Map fieldExpressionMap = new LinkedHashMap(); + fieldExpressions.forEach((k, v) -> fieldExpressionMap.put(k, parser.parseExpression(v))); + GeneratorReader reader = new GeneratorReader(); + reader.setFieldExpressions(fieldExpressionMap); + reader.setLocale(locale); + return reader; } @Override diff --git a/src/main/java/com/redislabs/riot/cli/in/Import.java b/src/main/java/com/redislabs/riot/cli/in/Import.java index c016a7d1a..d0e802edc 100644 --- a/src/main/java/com/redislabs/riot/cli/in/Import.java +++ b/src/main/java/com/redislabs/riot/cli/in/Import.java @@ -11,7 +11,7 @@ @Command(name = "import", description = "Import into Redis", subcommands = { DelimitedFileImport.class, FixedLengthFileImport.class, JsonFileImport.class, DatabaseImport.class, GeneratorImport.class, - SimpleGeneratorImport.class }) + GeneratorHelp.class, SimpleGeneratorImport.class }) public class Import extends JobCommand, Map> { } diff --git a/src/main/java/com/redislabs/riot/cli/in/SimpleGeneratorImport.java b/src/main/java/com/redislabs/riot/cli/in/SimpleGeneratorImport.java index 5337250dd..2429516d6 100644 --- a/src/main/java/com/redislabs/riot/cli/in/SimpleGeneratorImport.java +++ b/src/main/java/com/redislabs/riot/cli/in/SimpleGeneratorImport.java @@ -4,7 +4,7 @@ import picocli.CommandLine.Command; -@Command(name = "sgen", description = "Import simple generated data") +@Command(name = "simple", description = "Import simple generated data") public class SimpleGeneratorImport extends AbstractImportReaderCommand { @Override diff --git a/src/main/java/com/redislabs/riot/cli/in/redis/AbstractRediSearchImport.java b/src/main/java/com/redislabs/riot/cli/in/redis/AbstractRediSearchImport.java index 5313e832a..42af52059 100644 --- a/src/main/java/com/redislabs/riot/cli/in/redis/AbstractRediSearchImport.java +++ b/src/main/java/com/redislabs/riot/cli/in/redis/AbstractRediSearchImport.java @@ -6,7 +6,7 @@ import com.redislabs.riot.cli.in.AbstractImportWriterCommand; import com.redislabs.riot.redis.writer.LettuceWriter; -import com.redislabs.riot.redis.writer.search.AbstractRediSearchItemWriter; +import com.redislabs.riot.redis.writer.search.AbstractLettuSearchItemWriter; import lombok.Getter; import picocli.CommandLine.Option; @@ -35,13 +35,13 @@ protected ItemWriter> writer() { protected abstract ItemWriter> jedisSearchWriter(); - private AbstractRediSearchItemWriter lettuceItemWriter() { - AbstractRediSearchItemWriter writer = rediSearchItemWriter(); + private AbstractLettuSearchItemWriter lettuceItemWriter() { + AbstractLettuSearchItemWriter writer = rediSearchItemWriter(); writer.setIndex(index); writer.setConverter(redisConverter()); return writer; } - protected abstract AbstractRediSearchItemWriter rediSearchItemWriter(); + protected abstract AbstractLettuSearchItemWriter rediSearchItemWriter(); } diff --git a/src/main/java/com/redislabs/riot/cli/in/redis/SearchImport.java b/src/main/java/com/redislabs/riot/cli/in/redis/SearchImport.java index 5458cbb73..65db9f3a7 100644 --- a/src/main/java/com/redislabs/riot/cli/in/redis/SearchImport.java +++ b/src/main/java/com/redislabs/riot/cli/in/redis/SearchImport.java @@ -7,7 +7,7 @@ import com.redislabs.lettusearch.search.AddOptions; import com.redislabs.lettusearch.search.Language; import com.redislabs.riot.redis.writer.search.JedisSearchWriter; -import com.redislabs.riot.redis.writer.search.SearchAddWriter; +import com.redislabs.riot.redis.writer.search.LettuSearchAddWriter; import io.redisearch.client.AddOptions.ReplacementPolicy; import io.redisearch.client.Client; @@ -36,8 +36,8 @@ public class SearchImport extends AbstractRediSearchImport { private String payload; @Override - protected SearchAddWriter rediSearchItemWriter() { - SearchAddWriter writer = new SearchAddWriter(); + protected LettuSearchAddWriter rediSearchItemWriter() { + LettuSearchAddWriter writer = new LettuSearchAddWriter(); writer.setDefaultScore(defaultScore); writer.setOptions(AddOptions.builder().ifCondition(ifCondition).language(language).noSave(noSave) .replace(replace).replacePartial(partial).build()); diff --git a/src/main/java/com/redislabs/riot/cli/in/redis/SuggestImport.java b/src/main/java/com/redislabs/riot/cli/in/redis/SuggestImport.java index 4bc55fe70..93c574d26 100644 --- a/src/main/java/com/redislabs/riot/cli/in/redis/SuggestImport.java +++ b/src/main/java/com/redislabs/riot/cli/in/redis/SuggestImport.java @@ -4,8 +4,8 @@ import org.springframework.batch.item.ItemWriter; -import com.redislabs.riot.redis.writer.search.AbstractRediSearchItemWriter; -import com.redislabs.riot.redis.writer.search.SuggestWriter; +import com.redislabs.riot.redis.writer.search.AbstractLettuSearchItemWriter; +import com.redislabs.riot.redis.writer.search.LettuSearchSuggestWriter; import picocli.CommandLine.Command; import picocli.CommandLine.Option; @@ -25,8 +25,8 @@ public class SuggestImport extends AbstractRediSearchImport { private String payload; @Override - protected AbstractRediSearchItemWriter rediSearchItemWriter() { - SuggestWriter writer = new SuggestWriter(); + protected AbstractLettuSearchItemWriter rediSearchItemWriter() { + LettuSearchSuggestWriter writer = new LettuSearchSuggestWriter(); writer.setDefaultScore(defaultScore); writer.setField(suggest); writer.setIncrement(increment); diff --git a/src/main/java/com/redislabs/riot/generator/GeneratorFaker.java b/src/main/java/com/redislabs/riot/generator/GeneratorFaker.java new file mode 100644 index 000000000..3a68de265 --- /dev/null +++ b/src/main/java/com/redislabs/riot/generator/GeneratorFaker.java @@ -0,0 +1,28 @@ +package com.redislabs.riot.generator; + +import java.util.Locale; + +import com.github.javafaker.Faker; + +public class GeneratorFaker extends Faker { + + private GeneratorReader reader; + + public GeneratorFaker(Locale locale, GeneratorReader reader) { + super(locale); + this.reader = reader; + } + + public long sequence() { + return reader.getSequence(); + } + + public int partitions() { + return reader.getPartitions(); + } + + public int partitionIndex() { + return reader.getPartitionIndex(); + } + +} diff --git a/src/main/java/com/redislabs/riot/generator/GeneratorReader.java b/src/main/java/com/redislabs/riot/generator/GeneratorReader.java index b6da498ef..7ffa6bc5c 100644 --- a/src/main/java/com/redislabs/riot/generator/GeneratorReader.java +++ b/src/main/java/com/redislabs/riot/generator/GeneratorReader.java @@ -8,9 +8,8 @@ import org.springframework.batch.item.ItemStreamException; import org.springframework.expression.EvaluationContext; import org.springframework.expression.Expression; -import org.springframework.expression.spel.support.SimpleEvaluationContext; +import org.springframework.expression.spel.support.SimpleEvaluationContext.Builder; -import com.github.javafaker.Faker; import com.redislabs.riot.AbstractReader; import com.redislabs.riot.batch.IndexedPartitioner; @@ -23,7 +22,6 @@ public class GeneratorReader extends AbstractReader { private Locale locale; @Setter private Map fieldExpressions; - private Faker faker; private ThreadLocal context = new ThreadLocal<>(); private ThreadLocal partitionIndex = new ThreadLocal<>(); private ThreadLocal partitions = new ThreadLocal<>(); @@ -31,30 +29,24 @@ public class GeneratorReader extends AbstractReader { @Override public void open(ExecutionContext executionContext) throws ItemStreamException { - this.faker = new Faker(locale); this.partitionIndex.set(IndexedPartitioner.getPartitionIndex(executionContext)); this.partitions.set(IndexedPartitioner.getPartitions(executionContext)); super.open(executionContext); } - public int partitions() { + public int getPartitions() { return partitions.get(); } - public int partitionIndex() { + public int getPartitionIndex() { return partitionIndex.get(); } - public Faker faker() { - return faker; - } - @Override protected void doOpen() throws Exception { ReflectivePropertyAccessor accessor = new ReflectivePropertyAccessor(); - EvaluationContext evaluationContext = new SimpleEvaluationContext.Builder(accessor).withRootObject(this) - .build(); - context.set(evaluationContext); + GeneratorFaker faker = new GeneratorFaker(locale, this); + context.set(new Builder(accessor).withRootObject(faker).build()); current.set(0l); } @@ -63,7 +55,7 @@ public void setMaxItemCount(int count) { super.setMaxItemCount(count); } - public long sequence() { + public long getSequence() { // Start at 1 return start(maxItemCount) + current.get() + 1; } diff --git a/src/main/java/com/redislabs/riot/generator/GeneratorReaderBuilder.java b/src/main/java/com/redislabs/riot/generator/GeneratorReaderBuilder.java deleted file mode 100644 index 3d04b9238..000000000 --- a/src/main/java/com/redislabs/riot/generator/GeneratorReaderBuilder.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.redislabs.riot.generator; - -import java.util.LinkedHashMap; -import java.util.Locale; -import java.util.Map; - -import org.springframework.expression.Expression; -import org.springframework.expression.spel.standard.SpelExpressionParser; - -import lombok.Setter; - -public class GeneratorReaderBuilder { - - private SpelExpressionParser parser = new SpelExpressionParser(); - - @Setter - private Map fields; - @Setter - private Locale locale = Locale.ENGLISH; - - public GeneratorReader build() { - Map fieldExpressionMap = new LinkedHashMap(); - fields.forEach((k, v) -> fieldExpressionMap.put(k, parser.parseExpression(v))); - GeneratorReader reader = new GeneratorReader(); - reader.setFieldExpressions(fieldExpressionMap); - reader.setLocale(locale); - return reader; - } - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/AbstractRedisCommands.java b/src/main/java/com/redislabs/riot/redis/writer/AbstractRedisCommands.java deleted file mode 100644 index 5ab3a9609..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/AbstractRedisCommands.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.redislabs.riot.redis.writer; - -import java.util.HashMap; -import java.util.Map; - -import org.springframework.core.convert.ConversionService; -import org.springframework.core.convert.support.DefaultConversionService; - -public abstract class AbstractRedisCommands implements RedisCommands { - - private ConversionService converter = new DefaultConversionService(); - - protected Map stringMap(Map item) { - Map stringMap = new HashMap(); - item.forEach((k, v) -> put(stringMap, k, v)); - return stringMap; - } - - private void put(Map map, String key, Object value) { - if (value == null) { - return; - } - if (value instanceof Map) { - ((Map) value).forEach((k, v) -> put(map, key + "." + converter.convert(k, String.class), v)); - } else { - map.put(key, converter.convert(value, String.class)); - } - } -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/JedisCommands.java b/src/main/java/com/redislabs/riot/redis/writer/JedisCommands.java deleted file mode 100644 index fa3968928..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/JedisCommands.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.redislabs.riot.redis.writer; - -import java.util.Map; - -import com.redislabs.lettusearch.search.AddOptions; - -import redis.clients.jedis.Pipeline; -import redis.clients.jedis.StreamEntryID; - -public class JedisCommands extends AbstractRedisCommands { - - @Override - public Object geoadd(Object redis, String key, double longitude, double latitude, String member) { - return ((Pipeline) redis).geoadd(key, longitude, latitude, member); - } - - @Override - public Object hmset(Object redis, String key, Map item) { - return ((Pipeline) redis).hmset(key, stringMap(item)); - } - - @Override - public Object rpush(Object redis, String key, String member) { - return ((Pipeline) redis).rpush(key, member); - } - - @Override - public Object lpush(Object redis, String key, String member) { - return ((Pipeline) redis).lpush(key, member); - } - - @Override - public Object sadd(Object redis, String key, String member) { - return ((Pipeline) redis).sadd(key, member); - } - - @Override - public Object xadd(Object redis, String key, String id, Map item, long maxlen, - boolean approximateTrimming) { - return ((Pipeline) redis).xadd(key, new StreamEntryID(id), stringMap(item), maxlen, approximateTrimming); - } - - @Override - public Object xadd(Object redis, String key, Map item) { - return ((Pipeline) redis).xadd(key, new StreamEntryID(), stringMap(item)); - } - - @Override - public Object xadd(Object redis, String key, Map item, long maxlen, boolean approximateTrimming) { - return ((Pipeline) redis).xadd(key, new StreamEntryID(), stringMap(item), maxlen, approximateTrimming); - } - - @Override - public Object xadd(Object redis, String key, String id, Map item) { - return ((Pipeline) redis).xadd(key, new StreamEntryID(id), stringMap(item)); - } - - @Override - public Object set(Object redis, String key, String string) { - return ((Pipeline) redis).set(key, string); - } - - @Override - public Object zadd(Object redis, String key, double score, String member) { - return ((Pipeline) redis).zadd(key, score, member); - } - - @Override - public Object ftadd(Object redis, String index, String docId, double score, Map item, - AddOptions options, String payload) { - throw new RuntimeException("FT.ADD Not supported in JedisCommands"); - } - - @Override - public Object sugadd(Object redis, String index, String string, double score, boolean increment, String payload) { - throw new RuntimeException("SUG.ADD Not supported in JedisCommands"); - } - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/LettuceCommands.java b/src/main/java/com/redislabs/riot/redis/writer/LettuceCommands.java deleted file mode 100644 index 225091f52..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/LettuceCommands.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.redislabs.riot.redis.writer; - -import java.util.Map; - -import com.redislabs.lettusearch.RediSearchAsyncCommands; -import com.redislabs.lettusearch.search.AddOptions; - -import io.lettuce.core.XAddArgs; -import io.lettuce.core.api.async.RedisAsyncCommands; - -@SuppressWarnings("unchecked") -public class LettuceCommands extends AbstractRedisCommands { - - @Override - public Object geoadd(Object redis, String key, double longitude, double latitude, String member) { - return ((RedisAsyncCommands) redis).geoadd(key, longitude, latitude, member); - } - - @Override - public Object hmset(Object redis, String key, Map item) { - return ((RedisAsyncCommands) redis).hmset(key, stringMap(item)); - } - - @Override - public Object rpush(Object redis, String key, String member) { - return ((RedisAsyncCommands) redis).rpush(key, member); - } - - @Override - public Object lpush(Object redis, String key, String member) { - return ((RedisAsyncCommands) redis).lpush(key, member); - } - - @Override - public Object sadd(Object redis, String key, String member) { - return ((RedisAsyncCommands) redis).sadd(key, member); - } - - @Override - public Object xadd(Object redis, String key, String id, Map item, long maxlen, - boolean approximateTrimming) { - XAddArgs args = new XAddArgs(); - args.approximateTrimming(approximateTrimming); - args.id(id); - args.maxlen(maxlen); - return ((RedisAsyncCommands) redis).xadd(key, args, stringMap(item)); - } - - @Override - public Object xadd(Object redis, String key, Map item) { - return ((RedisAsyncCommands) redis).xadd(key, stringMap(item)); - } - - @Override - public Object xadd(Object redis, String key, Map item, long maxlen, boolean approximateTrimming) { - XAddArgs args = new XAddArgs(); - args.approximateTrimming(approximateTrimming); - args.maxlen(maxlen); - return ((RedisAsyncCommands) redis).xadd(key, args, stringMap(item)); - } - - @Override - public Object xadd(Object redis, String key, String id, Map item) { - XAddArgs args = new XAddArgs(); - args.id(id); - return ((RedisAsyncCommands) redis).xadd(key, args, stringMap(item)); - } - - @Override - public Object set(Object redis, String key, String string) { - return ((RedisAsyncCommands) redis).set(key, string); - } - - @Override - public Object zadd(Object redis, String key, double score, String member) { - return ((RedisAsyncCommands) redis).zadd(key, score, member); - } - - @Override - public Object ftadd(Object redis, String index, String docId, double score, Map item, - AddOptions options, String payload) { - return ((RediSearchAsyncCommands) redis).add(index, docId, score, stringMap(item), options, - payload); - } - - @Override - public Object sugadd(Object redis, String index, String string, double score, boolean increment, String payload) { - return ((RediSearchAsyncCommands) redis).sugadd(index, string, score, increment, payload); - } - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/RedisCommands.java b/src/main/java/com/redislabs/riot/redis/writer/RedisCommands.java deleted file mode 100644 index af86b4a6c..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/RedisCommands.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.redislabs.riot.redis.writer; - -import java.util.Map; - -import com.redislabs.lettusearch.search.AddOptions; - -public interface RedisCommands { - - Object geoadd(Object redis, String key, double longitude, double latitude, String member); - - Object hmset(Object redis, String key, Map item); - - Object rpush(Object redis, String key, String member); - - Object lpush(Object redis, String key, String member); - - Object sadd(Object redis, String key, String member); - - Object set(Object redis, String key, String string); - - Object zadd(Object redis, String key, double score, String member); - - Object xadd(Object redis, String key, Map item, long maxlen, boolean approximateTrimming); - - Object xadd(Object redis, String key, String id, Map item, long maxlen, - boolean approximateTrimming); - - Object xadd(Object redis, String key, Map item); - - Object xadd(Object redis, String key, String id, Map item); - - Object ftadd(Object redis, String index, String docId, double score, Map item, AddOptions options, - String payload); - - Object sugadd(Object redis, String index, String string, double score, boolean increment, String payload); - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/AbstractRediSearchItemWriter.java b/src/main/java/com/redislabs/riot/redis/writer/search/AbstractLettuSearchItemWriter.java similarity index 86% rename from src/main/java/com/redislabs/riot/redis/writer/search/AbstractRediSearchItemWriter.java rename to src/main/java/com/redislabs/riot/redis/writer/search/AbstractLettuSearchItemWriter.java index f6810890b..3dcf49829 100644 --- a/src/main/java/com/redislabs/riot/redis/writer/search/AbstractRediSearchItemWriter.java +++ b/src/main/java/com/redislabs/riot/redis/writer/search/AbstractLettuSearchItemWriter.java @@ -10,7 +10,7 @@ import io.lettuce.core.api.async.RedisAsyncCommands; import lombok.Setter; -public abstract class AbstractRediSearchItemWriter extends AbstractRedisItemWriter implements LettuceItemWriter { +public abstract class AbstractLettuSearchItemWriter extends AbstractRedisItemWriter implements LettuceItemWriter { @Setter private String index; diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/AggregateOperation.java b/src/main/java/com/redislabs/riot/redis/writer/search/AggregateOperation.java deleted file mode 100644 index 87eedec02..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/AggregateOperation.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.redislabs.riot.redis.writer.search; - -import com.redislabs.riot.redis.writer.search.aggregate.ApplyOperation; -import com.redislabs.riot.redis.writer.search.aggregate.FilterOperation; -import com.redislabs.riot.redis.writer.search.aggregate.GroupOperation; -import com.redislabs.riot.redis.writer.search.aggregate.LimitOperation; -import com.redislabs.riot.redis.writer.search.aggregate.SortOperation; - -import lombok.Data; - -@Data -public class AggregateOperation { - - private ApplyOperation apply; - private FilterOperation filter; - private LimitOperation limit; - private SortOperation sort; - private GroupOperation group; - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/SearchAddWriter.java b/src/main/java/com/redislabs/riot/redis/writer/search/LettuSearchAddWriter.java similarity index 92% rename from src/main/java/com/redislabs/riot/redis/writer/search/SearchAddWriter.java rename to src/main/java/com/redislabs/riot/redis/writer/search/LettuSearchAddWriter.java index c48925b8f..578f38ce5 100644 --- a/src/main/java/com/redislabs/riot/redis/writer/search/SearchAddWriter.java +++ b/src/main/java/com/redislabs/riot/redis/writer/search/LettuSearchAddWriter.java @@ -9,7 +9,7 @@ import lombok.Setter; @Setter -public class SearchAddWriter extends AbstractRediSearchItemWriter { +public class LettuSearchAddWriter extends AbstractLettuSearchItemWriter { @Setter private String scoreField; diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/SuggestWriter.java b/src/main/java/com/redislabs/riot/redis/writer/search/LettuSearchSuggestWriter.java similarity index 92% rename from src/main/java/com/redislabs/riot/redis/writer/search/SuggestWriter.java rename to src/main/java/com/redislabs/riot/redis/writer/search/LettuSearchSuggestWriter.java index 6bdb6b8dc..6f5887d52 100644 --- a/src/main/java/com/redislabs/riot/redis/writer/search/SuggestWriter.java +++ b/src/main/java/com/redislabs/riot/redis/writer/search/LettuSearchSuggestWriter.java @@ -8,7 +8,7 @@ import lombok.Setter; @Setter -public class SuggestWriter extends AbstractRediSearchItemWriter { +public class LettuSearchSuggestWriter extends AbstractLettuSearchItemWriter { private String field; private String scoreField; diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/MapTemplate.java b/src/main/java/com/redislabs/riot/redis/writer/search/MapTemplate.java deleted file mode 100644 index cae6cfdb1..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/MapTemplate.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.redislabs.riot.redis.writer.search; - -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.springframework.lang.Nullable; - -public class MapTemplate { - - private static final Pattern NAMES_PATTERN = Pattern.compile("\\{([^/]+?)\\}"); - - public String expand(String source, Map variables) { - if (source == null) { - return null; - } - if (source.indexOf('{') == -1) { - return source; - } - if (source.indexOf(':') != -1) { - source = sanitizeSource(source); - } - Matcher matcher = NAMES_PATTERN.matcher(source); - StringBuffer sb = new StringBuffer(); - while (matcher.find()) { - String match = matcher.group(1); - String varName = getVariableName(match); - Object varValue = variables.get(varName); - String formatted = getVariableValueAsString(varValue); - formatted = Matcher.quoteReplacement(formatted); - matcher.appendReplacement(sb, formatted); - } - matcher.appendTail(sb); - return sb.toString(); - } - - private String getVariableValueAsString(@Nullable Object variableValue) { - return (variableValue != null ? variableValue.toString() : ""); - } - - private String getVariableName(String match) { - int colonIdx = match.indexOf(':'); - return (colonIdx != -1 ? match.substring(0, colonIdx) : match); - } - - private String sanitizeSource(String source) { - int level = 0; - StringBuilder sb = new StringBuilder(); - for (char c : source.toCharArray()) { - if (c == '{') { - level++; - } - if (c == '}') { - level--; - } - if (level > 1 || (level == 1 && c == '}')) { - continue; - } - sb.append(c); - } - return sb.toString(); - } -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/RediSearchProperties.java b/src/main/java/com/redislabs/riot/redis/writer/search/RediSearchProperties.java deleted file mode 100644 index 7696d8f32..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/RediSearchProperties.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.redislabs.riot.redis.writer.search; - -import java.util.ArrayList; -import java.util.List; - -import org.springframework.boot.context.properties.ConfigurationProperties; - -import com.redislabs.lettusearch.search.SortBy.Direction; - -import lombok.Data; - -@Data -@ConfigurationProperties(prefix = "") -public class RediSearchProperties { - - private RediSearchType type = RediSearchType.Search; - private String index; - private boolean drop = false; - private boolean dropKeepDocs = false; - private boolean create = true; - private String[] keys = new String[0]; - private List schema = new ArrayList<>(); - private String language; - private String score; - private String payload; - private double defaultScore = 1d; - private boolean replace; - private boolean replacePartial; - private boolean noSave; - private String query; - private boolean verbatim; - private boolean noContent; - private boolean noStopWords; - private SortByConfiguration sortBy; - private LimitConfiguration limit; - private boolean withPayloads; - private boolean withScores; - private boolean withSchema; - private List loads = new ArrayList<>(); - private List operations = new ArrayList<>(); - private String field; - private boolean increment; - - @Data - public static class LimitConfiguration { - private long num; - private long offset; - } - - @Data - public static class SortByConfiguration { - private String field; - private Direction direction; - } - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/RediSearchType.java b/src/main/java/com/redislabs/riot/redis/writer/search/RediSearchType.java deleted file mode 100644 index d30fc055e..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/RediSearchType.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.redislabs.riot.redis.writer.search; - -public enum RediSearchType { - - Search, Suggest -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/SchemaField.java b/src/main/java/com/redislabs/riot/redis/writer/search/SchemaField.java deleted file mode 100644 index 7220c0130..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/SchemaField.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.redislabs.riot.redis.writer.search; - -import com.redislabs.lettusearch.search.field.PhoneticMatcher; - -import lombok.Data; - -@Data -public class SchemaField { - - private String name; - private Type type = Type.Text; - private boolean sortable; - private boolean noIndex; - private Double weight; - private boolean noStem; - private PhoneticMatcher matcher; - - public static enum Type { - Text, Numeric, Geo, Tag - } - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/ApplyOperation.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/ApplyOperation.java deleted file mode 100644 index b9c1ca9d3..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/ApplyOperation.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import lombok.Data; - -@Data -public class ApplyOperation { - - private String expression; - private String as; - -} \ No newline at end of file diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FilterOperation.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FilterOperation.java deleted file mode 100644 index 79a124f96..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FilterOperation.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import lombok.Data; - -@Data -public class FilterOperation { - - private String expression; -} \ No newline at end of file diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FirstValue.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FirstValue.java deleted file mode 100644 index 8be5b2083..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FirstValue.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import com.redislabs.lettusearch.aggregate.reducer.By; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@Data -@EqualsAndHashCode(callSuper = true) -public class FirstValue extends PropertyReducer { - - private By by; - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FirstValueBy.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FirstValueBy.java deleted file mode 100644 index 73ae5e40c..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/FirstValueBy.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import com.redislabs.lettusearch.aggregate.Order; - -import lombok.Data; - -@Data -public class FirstValueBy { - - private String property; - private Order order; - -} \ No newline at end of file diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/GroupOperation.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/GroupOperation.java deleted file mode 100644 index 0f066ae2d..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/GroupOperation.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import java.util.ArrayList; -import java.util.List; - -import lombok.Data; - -@Data -public class GroupOperation { - - private List properties = new ArrayList<>(); - private List reducers = new ArrayList<>(); - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/LimitOperation.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/LimitOperation.java deleted file mode 100644 index 647f48265..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/LimitOperation.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import lombok.Data; - -@Data -public class LimitOperation { - - private long offset; - private long num; -} \ No newline at end of file diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/PropertyReducer.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/PropertyReducer.java deleted file mode 100644 index 9d826b0aa..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/PropertyReducer.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@Data -@EqualsAndHashCode(callSuper = true) -public class PropertyReducer extends Reducer { - - private String property; - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/Quantile.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/Quantile.java deleted file mode 100644 index 131f2ac4c..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/Quantile.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@Data -@EqualsAndHashCode(callSuper = true) -public class Quantile extends PropertyReducer { - - private double quantile; - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/RandomSample.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/RandomSample.java deleted file mode 100644 index 9bdaf636f..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/RandomSample.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -@Data -@EqualsAndHashCode(callSuper = true) -public class RandomSample extends PropertyReducer { - - private int size; - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/ReduceFunction.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/ReduceFunction.java deleted file mode 100644 index a224a9666..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/ReduceFunction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import lombok.Data; - -@Data -public class ReduceFunction { - - private PropertyReducer avg; - private Reducer count; - private PropertyReducer countDistinct; - private PropertyReducer countDistinctish; - private FirstValue firstValue; - private PropertyReducer max; - private PropertyReducer min; - private Quantile quantile; - private RandomSample randomSample; - private PropertyReducer stdDev; - private PropertyReducer sum; - private PropertyReducer toList; - -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/Reducer.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/Reducer.java deleted file mode 100644 index a7e7b6780..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/Reducer.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import lombok.Data; - -@Data -public class Reducer { - - private String as; -} diff --git a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/SortOperation.java b/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/SortOperation.java deleted file mode 100644 index 1ba4eed8a..000000000 --- a/src/main/java/com/redislabs/riot/redis/writer/search/aggregate/SortOperation.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.redislabs.riot.redis.writer.search.aggregate; - -import java.util.LinkedHashMap; -import java.util.Map; - -import com.redislabs.lettusearch.aggregate.Order; - -import lombok.Data; - -@Data -public class SortOperation { - - private Map properties = new LinkedHashMap<>(); - private Long max; - -} \ No newline at end of file