WIP radiusStore() impl, only empty tests fail

Failed Tests:

1. RedissonGeoTest.testRadiusStoreMemberEmpty
    org.redisson.client.RedisTimeoutException: Redis server response timeout (3000 ms) occured for command: (GEORADIUSBYMEMBER) with params: [test, Palermo, 200.0, km, STORE, test-store]
	at org.redisson.command.CommandAsyncService$10.run(CommandAsyncService.java:646)
    ...

2. RedissonGeoTest.testRadiusStoreEmpty
    org.redisson.client.RedisTimeoutException: Redis server response timeout (3000 ms) occured for command: (GEORADIUS) with params: [test, 15.0, 37.0, 200.0, km, STORE, test-store]
	at org.redisson.command.CommandAsyncService$10.run(CommandAsyncService.java:646)
    ...
pull/869/head
Cory Sherman
parent ca23bb99a2
commit fccab83a7a

@ -413,7 +413,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
@Override
public RFuture<Integer> radiusStoreAsync(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit) {
return commandExecutor.writeAsync(fromKey, LongCodec.INSTANCE, RedisCommands.GEORADIUS_STORE_INT, fromKey, convert(longitude), convert(latitude), radius, geoUnit, "STORE", getName());
return commandExecutor.writeAsync(getName(), LongCodec.INSTANCE, RedisCommands.GEORADIUS_STORE_INT, fromKey, convert(longitude), convert(latitude), radius, geoUnit, "STORE", getName());
}
@Override
@ -423,7 +423,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
@Override
public RFuture<Integer> radiusStoreAsync(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) {
return commandExecutor.writeAsync(fromKey, LongCodec.INSTANCE, RedisCommands.GEORADIUS_STORE_INT, fromKey, convert(longitude), convert(latitude), radius, geoUnit, "COUNT", count, "STORE", getName());
return commandExecutor.writeAsync(getName(), LongCodec.INSTANCE, RedisCommands.GEORADIUS_STORE_INT, fromKey, convert(longitude), convert(latitude), radius, geoUnit, "COUNT", count, "STORE", getName());
}
@Override
@ -433,7 +433,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
@Override
public RFuture<Integer> radiusStoreAsync(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
return commandExecutor.writeAsync(fromKey, LongCodec.INSTANCE, RedisCommands.GEORADIUS_STORE_INT, fromKey, convert(longitude), convert(latitude), radius, geoUnit, geoOrder, "COUNT", count, "STORE", getName());
return commandExecutor.writeAsync(getName(), LongCodec.INSTANCE, RedisCommands.GEORADIUS_STORE_INT, fromKey, convert(longitude), convert(latitude), radius, geoUnit, geoOrder, "COUNT", count, "STORE", getName());
}
@Override
@ -443,7 +443,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
@Override
public RFuture<Integer> radiusStoreAsync(String fromKey, V member, double radius, GeoUnit geoUnit) {
return commandExecutor.writeAsync(fromKey, codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, fromKey, member, radius, geoUnit, "STORE", getName());
return commandExecutor.writeAsync(getName(), codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, fromKey, member, radius, geoUnit, "STORE", getName());
}
@Override
@ -453,17 +453,17 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
@Override
public RFuture<Integer> radiusStoreAsync(String fromKey, V member, double radius, GeoUnit geoUnit, int count) {
return commandExecutor.writeAsync(fromKey, codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, fromKey, member, radius, geoUnit, "COUNT", count, "STORE", getName());
return commandExecutor.writeAsync(getName(), codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, fromKey, member, radius, geoUnit, "COUNT", count, "STORE", getName());
}
@Override
public int radiusStore(String fromKey, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
return get(radiusStoreAsync(fromKey, member, radius, geoUnit, count));
return get(radiusStoreAsync(fromKey, member, radius, geoUnit, geoOrder, count));
}
@Override
public RFuture<Integer> radiusStoreAsync(String fromKey, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
return commandExecutor.writeAsync(fromKey, codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, fromKey, member, radius, geoUnit, geoOrder, "COUNT", count, "STORE", getName());
return commandExecutor.writeAsync(getName(), codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, fromKey, member, radius, geoUnit, geoOrder, "COUNT", count, "STORE", getName());
}
}

@ -76,8 +76,8 @@ public interface RedisCommands {
RedisCommand<Double> GEODIST = new RedisCommand<Double>("GEODIST", new DoubleReplayConvertor(), 2, Arrays.asList(ValueType.OBJECT, ValueType.OBJECT, ValueType.STRING));
RedisCommand<List<Object>> GEORADIUS = new RedisCommand<List<Object>>("GEORADIUS", new ObjectListReplayDecoder<Object>());
RedisCommand<List<Object>> GEORADIUSBYMEMBER = new RedisCommand<List<Object>>("GEORADIUSBYMEMBER", new ObjectListReplayDecoder<Object>(), 2);
RedisCommand<Integer> GEORADIUS_STORE_INT = new RedisStrictCommand<Integer>("GEORADIUS", new IntegerReplayConvertor());
RedisCommand<Integer> GEORADIUSBYMEMBER_STORE_INT = new RedisStrictCommand<Integer>("GEORADIUSBYMEMBER", new IntegerReplayConvertor(), 2);
RedisStrictCommand<Integer> GEORADIUS_STORE_INT = new RedisStrictCommand<Integer>("GEORADIUS", new IntegerReplayConvertor());
RedisStrictCommand<Integer> GEORADIUSBYMEMBER_STORE_INT = new RedisStrictCommand<Integer>("GEORADIUSBYMEMBER", new IntegerReplayConvertor(), 2);
RedisStrictCommand<Integer> KEYSLOT = new RedisStrictCommand<Integer>("CLUSTER", "KEYSLOT", new IntegerReplayConvertor());
RedisStrictCommand<RType> TYPE = new RedisStrictCommand<RType>("TYPE", new TypeConvertor());

@ -974,6 +974,22 @@ public class RedissonScoredSortedSetTest extends BaseTest {
assertThat(out.getScore("two")).isEqualTo(4);
}
@Test
public void testIntersectionEmpty() {
RScoredSortedSet<String> set1 = redisson.getScoredSortedSet("simple1");
set1.add(1, "one");
set1.add(2, "two");
RScoredSortedSet<String> set2 = redisson.getScoredSortedSet("simple2");
set2.add(3, "three");
set2.add(4, "four");
RScoredSortedSet<String> out = redisson.getScoredSortedSet("out");
assertThat(out.intersection(set1.getName(), set2.getName())).isEqualTo(0);
assertThat(out.readAll()).isEmpty();
}
@Test
public void testIntersectionWithWeight() {
RScoredSortedSet<String> set1 = redisson.getScoredSortedSet("simple1");

Loading…
Cancel
Save