Skip to content

Commit

Permalink
change API "radiusStore()" -> "radiusStoreTo()"
Browse files Browse the repository at this point in the history
From @mrniko's feedback, to match RSortable API.
Read from current Geo, store to destName.
  • Loading branch information
coryshrmn committed Apr 28, 2017
1 parent cbb485c commit df0d135
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 70 deletions.
48 changes: 24 additions & 24 deletions redisson/src/main/java/org/redisson/RedissonGeo.java
Expand Up @@ -407,63 +407,63 @@ public RFuture<Map<V, GeoPosition>> radiusWithPositionAsync(V member, double rad
} }


@Override @Override
public int radiusStore(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit) { public int radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit) {
return get(radiusStoreAsync(fromKey, longitude, latitude, radius, geoUnit)); return get(radiusStoreToAsync(destName, longitude, latitude, radius, geoUnit));
} }


@Override @Override
public RFuture<Integer> radiusStoreAsync(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit) { public RFuture<Integer> radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit) {
return commandExecutor.writeAsync(getName(), 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, getName(), convert(longitude), convert(latitude), radius, geoUnit, "STORE", destName);
} }


@Override @Override
public int radiusStore(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { public int radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) {
return get(radiusStoreAsync(fromKey, longitude, latitude, radius, geoUnit, count)); return get(radiusStoreToAsync(destName, longitude, latitude, radius, geoUnit, count));
} }


@Override @Override
public RFuture<Integer> radiusStoreAsync(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) { public RFuture<Integer> radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count) {
return commandExecutor.writeAsync(getName(), 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, getName(), convert(longitude), convert(latitude), radius, geoUnit, "COUNT", count, "STORE", destName);
} }


@Override @Override
public int radiusStore(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { public int radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
return get(radiusStoreAsync(fromKey, longitude, latitude, radius, geoUnit, geoOrder, count)); return get(radiusStoreToAsync(destName, longitude, latitude, radius, geoUnit, geoOrder, count));
} }


@Override @Override
public RFuture<Integer> radiusStoreAsync(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { public RFuture<Integer> radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
return commandExecutor.writeAsync(getName(), 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, getName(), convert(longitude), convert(latitude), radius, geoUnit, geoOrder, "COUNT", count, "STORE", destName);
} }


@Override @Override
public int radiusStore(String fromKey, V member, double radius, GeoUnit geoUnit) { public int radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit) {
return get(radiusStoreAsync(fromKey, member, radius, geoUnit)); return get(radiusStoreToAsync(destName, member, radius, geoUnit));
} }


@Override @Override
public RFuture<Integer> radiusStoreAsync(String fromKey, V member, double radius, GeoUnit geoUnit) { public RFuture<Integer> radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit) {
return commandExecutor.writeAsync(getName(), codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, fromKey, member, radius, geoUnit, "STORE", getName()); return commandExecutor.writeAsync(getName(), codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, getName(), member, radius, geoUnit, "STORE", destName);
} }


@Override @Override
public int radiusStore(String fromKey, V member, double radius, GeoUnit geoUnit, int count) { public int radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, int count) {
return get(radiusStoreAsync(fromKey, member, radius, geoUnit, count)); return get(radiusStoreToAsync(destName, member, radius, geoUnit, count));
} }


@Override @Override
public RFuture<Integer> radiusStoreAsync(String fromKey, V member, double radius, GeoUnit geoUnit, int count) { public RFuture<Integer> radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, int count) {
return commandExecutor.writeAsync(getName(), codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, fromKey, member, radius, geoUnit, "COUNT", count, "STORE", getName()); return commandExecutor.writeAsync(getName(), codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, getName(), member, radius, geoUnit, "COUNT", count, "STORE", destName);
} }


@Override @Override
public int radiusStore(String fromKey, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { public int radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
return get(radiusStoreAsync(fromKey, member, radius, geoUnit, geoOrder, count)); return get(radiusStoreToAsync(destName, member, radius, geoUnit, geoOrder, count));
} }


@Override @Override
public RFuture<Integer> radiusStoreAsync(String fromKey, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) { public RFuture<Integer> radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count) {
return commandExecutor.writeAsync(getName(), codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, fromKey, member, radius, geoUnit, geoOrder, "COUNT", count, "STORE", getName()); return commandExecutor.writeAsync(getName(), codec, RedisCommands.GEORADIUSBYMEMBER_STORE_INT, getName(), member, radius, geoUnit, geoOrder, "COUNT", count, "STORE", destName);
} }


} }
36 changes: 18 additions & 18 deletions redisson/src/main/java/org/redisson/api/RGeo.java
Expand Up @@ -450,43 +450,43 @@ public interface RGeo<V> extends RScoredSortedSet<V>, RGeoAsync<V> {
* borders of the area specified with the center location * borders of the area specified with the center location
* and the maximum distance from the center (the radius) * and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units. * in <code>GeoUnit</code> units.
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param longitude - longitude of object * @param longitude - longitude of object
* @param latitude - latitude of object * @param latitude - latitude of object
* @param radius - radius in geo units * @param radius - radius in geo units
* @param geoUnit - geo unit * @param geoUnit - geo unit
* @return length of result * @return length of result
*/ */
int radiusStore(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit); int radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit);


/** /**
* Finds the members of a sorted set, which are within the * Finds the members of a sorted set, which are within the
* borders of the area specified with the center location * borders of the area specified with the center location
* and the maximum distance from the center (the radius) * and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units and limited by count * in <code>GeoUnit</code> units and limited by count
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param longitude - longitude of object * @param longitude - longitude of object
* @param latitude - latitude of object * @param latitude - latitude of object
* @param radius - radius in geo units * @param radius - radius in geo units
* @param geoUnit - geo unit * @param geoUnit - geo unit
* @param count - result limit * @param count - result limit
* @return length of result * @return length of result
*/ */
int radiusStore(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit, int count); int radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count);


/** /**
* Finds the members of a sorted set, which are within the * Finds the members of a sorted set, which are within the
* borders of the area specified with the center location * borders of the area specified with the center location
* and the maximum distance from the center (the radius) * and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units with <code>GeoOrder</code> * in <code>GeoUnit</code> units with <code>GeoOrder</code>
* and limited by count * and limited by count
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param longitude - longitude of object * @param longitude - longitude of object
* @param latitude - latitude of object * @param latitude - latitude of object
* @param radius - radius in geo units * @param radius - radius in geo units
Expand All @@ -495,54 +495,54 @@ public interface RGeo<V> extends RScoredSortedSet<V>, RGeoAsync<V> {
* @param count - result limit * @param count - result limit
* @return length of result * @return length of result
*/ */
int radiusStore(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); int radiusStoreTo(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);


/** /**
* Finds the members of a sorted set, which are within the * Finds the members of a sorted set, which are within the
* borders of the area specified with the defined member location * borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius) * and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units. * in <code>GeoUnit</code> units.
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param member - object * @param member - object
* @param radius - radius in geo units * @param radius - radius in geo units
* @param geoUnit - geo unit * @param geoUnit - geo unit
* @return length of result * @return length of result
*/ */
int radiusStore(String fromKey, V member, double radius, GeoUnit geoUnit); int radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit);


/** /**
* Finds the members of a sorted set, which are within the * Finds the members of a sorted set, which are within the
* borders of the area specified with the defined member location * borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius) * and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units and limited by count * in <code>GeoUnit</code> units and limited by count
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param member - object * @param member - object
* @param radius - radius in geo units * @param radius - radius in geo units
* @param geoUnit - geo unit * @param geoUnit - geo unit
* @param count - result limit * @param count - result limit
* @return length of result * @return length of result
*/ */
int radiusStore(String fromKey, V member, double radius, GeoUnit geoUnit, int count); int radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, int count);


/** /**
* Finds the members of a sorted set, which are within the * Finds the members of a sorted set, which are within the
* borders of the area specified with the defined member location * borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius) * and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units with <code>GeoOrder</code> * in <code>GeoUnit</code> units with <code>GeoOrder</code>
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param member - object * @param member - object
* @param radius - radius in geo units * @param radius - radius in geo units
* @param geoUnit - geo unit * @param geoUnit - geo unit
* @param geoOrder - geo order * @param geoOrder - geo order
* @param count - result limit * @param count - result limit
* @return length of result * @return length of result
*/ */
int radiusStore(String fromKey, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); int radiusStoreTo(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);


} }
36 changes: 18 additions & 18 deletions redisson/src/main/java/org/redisson/api/RGeoAsync.java
Expand Up @@ -448,43 +448,43 @@ public interface RGeoAsync<V> extends RScoredSortedSetAsync<V> {
* borders of the area specified with the center location * borders of the area specified with the center location
* and the maximum distance from the center (the radius) * and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units. * in <code>GeoUnit</code> units.
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param longitude - longitude of object * @param longitude - longitude of object
* @param latitude - latitude of object * @param latitude - latitude of object
* @param radius - radius in geo units * @param radius - radius in geo units
* @param geoUnit - geo unit * @param geoUnit - geo unit
* @return length of result * @return length of result
*/ */
RFuture<Integer> radiusStoreAsync(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit); RFuture<Integer> radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit);


/** /**
* Finds the members of a sorted set, which are within the * Finds the members of a sorted set, which are within the
* borders of the area specified with the center location * borders of the area specified with the center location
* and the maximum distance from the center (the radius) * and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units and limited by count * in <code>GeoUnit</code> units and limited by count
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param longitude - longitude of object * @param longitude - longitude of object
* @param latitude - latitude of object * @param latitude - latitude of object
* @param radius - radius in geo units * @param radius - radius in geo units
* @param geoUnit - geo unit * @param geoUnit - geo unit
* @param count - result limit * @param count - result limit
* @return length of result * @return length of result
*/ */
RFuture<Integer> radiusStoreAsync(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit, int count); RFuture<Integer> radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, int count);


/** /**
* Finds the members of a sorted set, which are within the * Finds the members of a sorted set, which are within the
* borders of the area specified with the center location * borders of the area specified with the center location
* and the maximum distance from the center (the radius) * and the maximum distance from the center (the radius)
* in <code>GeoUnit</code> units with <code>GeoOrder</code> * in <code>GeoUnit</code> units with <code>GeoOrder</code>
* and limited by count * and limited by count
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param longitude - longitude of object * @param longitude - longitude of object
* @param latitude - latitude of object * @param latitude - latitude of object
* @param radius - radius in geo units * @param radius - radius in geo units
Expand All @@ -493,54 +493,54 @@ public interface RGeoAsync<V> extends RScoredSortedSetAsync<V> {
* @param count - result limit * @param count - result limit
* @return length of result * @return length of result
*/ */
RFuture<Integer> radiusStoreAsync(String fromKey, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); RFuture<Integer> radiusStoreToAsync(String destName, double longitude, double latitude, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);


/** /**
* Finds the members of a sorted set, which are within the * Finds the members of a sorted set, which are within the
* borders of the area specified with the defined member location * borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius) * and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units. * in <code>GeoUnit</code> units.
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param member - object * @param member - object
* @param radius - radius in geo units * @param radius - radius in geo units
* @param geoUnit - geo unit * @param geoUnit - geo unit
* @return length of result * @return length of result
*/ */
RFuture<Integer> radiusStoreAsync(String fromKey, V member, double radius, GeoUnit geoUnit); RFuture<Integer> radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit);


/** /**
* Finds the members of a sorted set, which are within the * Finds the members of a sorted set, which are within the
* borders of the area specified with the defined member location * borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius) * and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units and limited by count * in <code>GeoUnit</code> units and limited by count
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param member - object * @param member - object
* @param radius - radius in geo units * @param radius - radius in geo units
* @param geoUnit - geo unit * @param geoUnit - geo unit
* @param count - result limit * @param count - result limit
* @return length of result * @return length of result
*/ */
RFuture<Integer> radiusStoreAsync(String fromKey, V member, double radius, GeoUnit geoUnit, int count); RFuture<Integer> radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, int count);


/** /**
* Finds the members of a sorted set, which are within the * Finds the members of a sorted set, which are within the
* borders of the area specified with the defined member location * borders of the area specified with the defined member location
* and the maximum distance from the defined member location (the radius) * and the maximum distance from the defined member location (the radius)
* in <code>GeoUnit</code> units with <code>GeoOrder</code> * in <code>GeoUnit</code> units with <code>GeoOrder</code>
* Store result to current Geo. * Store result to <code>destName</code>.
* *
* @param fromKey - source Geo key * @param destName - Geo object destination
* @param member - object * @param member - object
* @param radius - radius in geo units * @param radius - radius in geo units
* @param geoUnit - geo unit * @param geoUnit - geo unit
* @param geoOrder - geo order * @param geoOrder - geo order
* @param count - result limit * @param count - result limit
* @return length of result * @return length of result
*/ */
RFuture<Integer> radiusStoreAsync(String fromKey, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count); RFuture<Integer> radiusStoreToAsync(String destName, V member, double radius, GeoUnit geoUnit, GeoOrder geoOrder, int count);


} }

0 comments on commit df0d135

Please sign in to comment.