|
|
|
@ -55,6 +55,10 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
private static final MultiDecoder<Map<Object, Object>> postitionDecoder = new ListMultiDecoder(new CodecDecoder(), new GeoPositionDecoder(), new ObjectListReplayDecoder(ListMultiDecoder.RESET), new GeoMapReplayDecoder());
|
|
|
|
|
private static final MultiDecoder<Map<Object, Object>> distanceDecoder = new ListMultiDecoder(new GeoDistanceDecoder(), new GeoMapReplayDecoder());
|
|
|
|
|
private static final RedisCommand<Map<Object, Object>> GEORADIUS_RO_DISTANCE = new RedisCommand<Map<Object, Object>>("GEORADIUS_RO", distanceDecoder);
|
|
|
|
|
private static final RedisCommand<Map<Object, Object>> GEORADIUS_RO_POS = new RedisCommand<Map<Object, Object>>("GEORADIUS_RO", postitionDecoder);
|
|
|
|
|
private static final RedisCommand<Map<Object, Object>> GEORADIUSBYMEMBER_RO_DISTANCE = new RedisCommand<Map<Object, Object>>("GEORADIUSBYMEMBER_RO", distanceDecoder);
|
|
|
|
|
private static final RedisCommand<Map<Object, Object>> GEORADIUSBYMEMBER_RO_POS = new RedisCommand<Map<Object, Object>>("GEORADIUSBYMEMBER_RO", postitionDecoder);
|
|
|
|
|
|
|
|
|
|
public RedissonGeo(CommandAsyncExecutor connectionManager, String name, RedissonClient redisson) {
|
|
|
|
|
super(connectionManager, name, redisson);
|
|
|
|
@ -134,7 +138,9 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
params.add(encode(member));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MultiDecoder<Map<Object, Object>> decoder = new ListMultiDecoder(new GeoPositionDecoder(), new ObjectListReplayDecoder(ListMultiDecoder.RESET), new GeoPositionMapDecoder((List<Object>)Arrays.asList(members)));
|
|
|
|
|
MultiDecoder<Map<Object, Object>> decoder = new ListMultiDecoder(0, new GeoPositionDecoder(),
|
|
|
|
|
// new ObjectListReplayDecoder(ListMultiDecoder.RESET),
|
|
|
|
|
new GeoPositionMapDecoder((List<Object>)Arrays.asList(members)));
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEOPOS", decoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, command, params.toArray());
|
|
|
|
|
}
|
|
|
|
@ -189,8 +195,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, Double>> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUS_RO", distanceDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUS_RO_DISTANCE, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
radius, geoUnit, "WITHDIST");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -201,8 +206,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, Double>> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUS_RO", distanceDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUS_RO_DISTANCE, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
radius, geoUnit, "WITHDIST", "COUNT", count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -213,8 +217,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, Double>> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUS_RO", distanceDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUS_RO_DISTANCE, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
radius, geoUnit, "WITHDIST", geoOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -225,8 +228,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, Double>> radiusWithDistanceAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUS_RO", distanceDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUS_RO_DISTANCE, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
radius, geoUnit, "WITHDIST", "COUNT", count, geoOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -237,8 +239,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, GeoPosition>> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUS_RO", postitionDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), convert(longitude), convert(latitude), radius, geoUnit, "WITHCOORD");
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUS_RO_POS, getName(), convert(longitude), convert(latitude), radius, geoUnit, "WITHCOORD");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -248,8 +249,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, GeoPosition>> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, int count) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUS_RO", postitionDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUS_RO_POS, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
radius, geoUnit, "WITHCOORD", "COUNT", count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -260,8 +260,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, GeoPosition>> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUS_RO", postitionDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUS_RO_POS, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
radius, geoUnit, "WITHCOORD", geoOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -272,8 +271,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, GeoPosition>> radiusWithPositionAsync(double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUS_RO", postitionDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUS_RO_POS, getName(), convert(longitude), convert(latitude),
|
|
|
|
|
radius, geoUnit, "WITHCOORD", "COUNT", count, geoOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -324,8 +322,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, Double>> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit) {
|
|
|
|
|
RedisCommand command = new RedisCommand("GEORADIUSBYMEMBER_RO", distanceDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), encode(member), radius, geoUnit, "WITHDIST");
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUSBYMEMBER_RO_DISTANCE, getName(), encode(member), radius, geoUnit, "WITHDIST");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -335,8 +332,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, Double>> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, int count) {
|
|
|
|
|
RedisCommand command = new RedisCommand("GEORADIUSBYMEMBER_RO", distanceDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), encode(member), radius, geoUnit, "WITHDIST", "COUNT", count);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUSBYMEMBER_RO_DISTANCE, getName(), encode(member), radius, geoUnit, "WITHDIST", "COUNT", count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -346,8 +342,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, Double>> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) {
|
|
|
|
|
RedisCommand command = new RedisCommand("GEORADIUSBYMEMBER_RO", distanceDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), encode(member), radius, geoUnit, "WITHDIST", geoOrder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUSBYMEMBER_RO_DISTANCE, getName(), encode(member), radius, geoUnit, "WITHDIST", geoOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -357,8 +352,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, Double>> radiusWithDistanceAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
|
|
|
|
|
RedisCommand command = new RedisCommand("GEORADIUSBYMEMBER_RO", distanceDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), encode(member), radius, geoUnit, "WITHDIST", "COUNT", count, geoOrder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUSBYMEMBER_RO_DISTANCE, getName(), encode(member), radius, geoUnit, "WITHDIST", "COUNT", count, geoOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -368,8 +362,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, GeoPosition>> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUSBYMEMBER_RO", postitionDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), encode(member), radius, geoUnit, "WITHCOORD");
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUSBYMEMBER_RO_POS, getName(), encode(member), radius, geoUnit, "WITHCOORD");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -379,8 +372,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, GeoPosition>> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, int count) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUSBYMEMBER_RO", postitionDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), encode(member), radius, geoUnit, "WITHCOORD", "COUNT", count);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUSBYMEMBER_RO_POS, getName(), encode(member), radius, geoUnit, "WITHCOORD", "COUNT", count);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -390,8 +382,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, GeoPosition>> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUSBYMEMBER_RO", postitionDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), encode(member), radius, geoUnit, "WITHCOORD", geoOrder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUSBYMEMBER_RO_POS, getName(), encode(member), radius, geoUnit, "WITHCOORD", geoOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -401,8 +392,7 @@ public class RedissonGeo<V> extends RedissonScoredSortedSet<V> implements RGeo<V
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public RFuture<Map<V, GeoPosition>> radiusWithPositionAsync(V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
|
|
|
|
|
RedisCommand<Map<Object, Object>> command = new RedisCommand<Map<Object, Object>>("GEORADIUSBYMEMBER_RO", postitionDecoder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, command, getName(), encode(member), radius, geoUnit, "WITHCOORD", "COUNT", count, geoOrder);
|
|
|
|
|
return commandExecutor.readAsync(getName(), codec, GEORADIUSBYMEMBER_RO_POS, getName(), encode(member), radius, geoUnit, "WITHCOORD", "COUNT", count, geoOrder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|