@Override public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, Distance radius, GeoRadiusCommandArgs args) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(member, "Member must not be null!"); Assert.notNull(radius, "Radius must not be null!"); Assert.notNull(args, "Args must not be null!"); GeoArgs.Unit geoUnit = LettuceConverters.toGeoArgsUnit(radius.getMetric()); GeoArgs geoArgs = LettuceConverters.toGeoArgs(args); Converter<List<GeoWithin<byte[]>>, GeoResults<GeoLocation<byte[]>>> geoResultsConverter = LettuceConverters .geoRadiusResponseToGeoResultsConverter(radius.getMetric()); try { if (isPipelined()) { pipeline(connection.newLettuceResult( getAsyncConnection().georadiusbymember(key, member, radius.getValue(), geoUnit, geoArgs), geoResultsConverter)); return null; } if (isQueueing()) { transaction(connection.newLettuceResult( getAsyncConnection().georadiusbymember(key, member, radius.getValue(), geoUnit, geoArgs), geoResultsConverter)); return null; } return geoResultsConverter .convert(getConnection().georadiusbymember(key, member, radius.getValue(), geoUnit, geoArgs)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(within, "Within must not be null!"); Assert.notNull(args, "Args must not be null!"); GeoArgs geoArgs = LettuceConverters.toGeoArgs(args); Converter<List<GeoWithin<byte[]>>, GeoResults<GeoLocation<byte[]>>> geoResultsConverter = LettuceConverters .geoRadiusResponseToGeoResultsConverter(within.getRadius().getMetric()); try { if (isPipelined()) { pipeline(connection.newLettuceResult(getAsyncConnection().georadius(key, within.getCenter().getX(), within.getCenter().getY(), within.getRadius().getValue(), LettuceConverters.toGeoArgsUnit(within.getRadius().getMetric()), geoArgs), geoResultsConverter)); return null; } if (isQueueing()) { transaction(connection.newLettuceResult(getAsyncConnection().georadius(key, within.getCenter().getX(), within.getCenter().getY(), within.getRadius().getValue(), LettuceConverters.toGeoArgsUnit(within.getRadius().getMetric()), geoArgs), geoResultsConverter)); return null; } return geoResultsConverter .convert(getConnection().georadius(key, within.getCenter().getX(), within.getCenter().getY(), within.getRadius().getValue(), LettuceConverters.toGeoArgsUnit(within.getRadius().getMetric()), geoArgs)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, Distance radius, GeoRadiusCommandArgs args) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(member, "Member must not be null!"); Assert.notNull(radius, "Radius must not be null!"); Assert.notNull(args, "Args must not be null!"); GeoArgs.Unit geoUnit = LettuceConverters.toGeoArgsUnit(radius.getMetric()); GeoArgs geoArgs = LettuceConverters.toGeoArgs(args); Converter<List<GeoWithin<byte[]>>, GeoResults<GeoLocation<byte[]>>> geoResultsConverter = LettuceConverters .geoRadiusResponseToGeoResultsConverter(radius.getMetric()); try { if (isPipelined()) { pipeline(connection.newLettuceResult( getAsyncConnection().georadiusbymember(key, member, radius.getValue(), geoUnit, geoArgs), geoResultsConverter)); return null; } if (isQueueing()) { transaction(connection.newLettuceResult( getAsyncConnection().georadiusbymember(key, member, radius.getValue(), geoUnit, geoArgs), geoResultsConverter)); return null; } return geoResultsConverter .convert(getConnection().georadiusbymember(key, member, radius.getValue(), geoUnit, geoArgs)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public GeoResults<GeoLocation<byte[]>> geoRadiusByMember(byte[] key, byte[] member, Distance radius, GeoRadiusCommandArgs args) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(member, "Member must not be null!"); Assert.notNull(radius, "Radius must not be null!"); Assert.notNull(args, "Args must not be null!"); GeoArgs.Unit geoUnit = LettuceConverters.toGeoArgsUnit(radius.getMetric()); GeoArgs geoArgs = LettuceConverters.toGeoArgs(args); Converter<List<GeoWithin<byte[]>>, GeoResults<GeoLocation<byte[]>>> geoResultsConverter = LettuceConverters .geoRadiusResponseToGeoResultsConverter(radius.getMetric()); try { if (isPipelined()) { pipeline(connection.newLettuceResult( getAsyncConnection().georadiusbymember(key, member, radius.getValue(), geoUnit, geoArgs), geoResultsConverter)); return null; } if (isQueueing()) { transaction(connection.newLettuceResult( getAsyncConnection().georadiusbymember(key, member, radius.getValue(), geoUnit, geoArgs), geoResultsConverter)); return null; } return geoResultsConverter .convert(getConnection().georadiusbymember(key, member, radius.getValue(), geoUnit, geoArgs)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(within, "Within must not be null!"); Assert.notNull(args, "Args must not be null!"); GeoArgs geoArgs = LettuceConverters.toGeoArgs(args); Converter<List<GeoWithin<byte[]>>, GeoResults<GeoLocation<byte[]>>> geoResultsConverter = LettuceConverters .geoRadiusResponseToGeoResultsConverter(within.getRadius().getMetric()); try { if (isPipelined()) { pipeline(connection.newLettuceResult(getAsyncConnection().georadius(key, within.getCenter().getX(), within.getCenter().getY(), within.getRadius().getValue(), LettuceConverters.toGeoArgsUnit(within.getRadius().getMetric()), geoArgs), geoResultsConverter)); return null; } if (isQueueing()) { transaction(connection.newLettuceResult(getAsyncConnection().georadius(key, within.getCenter().getX(), within.getCenter().getY(), within.getRadius().getValue(), LettuceConverters.toGeoArgsUnit(within.getRadius().getMetric()), geoArgs), geoResultsConverter)); return null; } return geoResultsConverter .convert(getConnection().georadius(key, within.getCenter().getX(), within.getCenter().getY(), within.getRadius().getValue(), LettuceConverters.toGeoArgsUnit(within.getRadius().getMetric()), geoArgs)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }
@Override public GeoResults<GeoLocation<byte[]>> geoRadius(byte[] key, Circle within, GeoRadiusCommandArgs args) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(within, "Within must not be null!"); Assert.notNull(args, "Args must not be null!"); GeoArgs geoArgs = LettuceConverters.toGeoArgs(args); Converter<List<GeoWithin<byte[]>>, GeoResults<GeoLocation<byte[]>>> geoResultsConverter = LettuceConverters .geoRadiusResponseToGeoResultsConverter(within.getRadius().getMetric()); try { if (isPipelined()) { pipeline(connection.newLettuceResult(getAsyncConnection().georadius(key, within.getCenter().getX(), within.getCenter().getY(), within.getRadius().getValue(), LettuceConverters.toGeoArgsUnit(within.getRadius().getMetric()), geoArgs), geoResultsConverter)); return null; } if (isQueueing()) { transaction(connection.newLettuceResult(getAsyncConnection().georadius(key, within.getCenter().getX(), within.getCenter().getY(), within.getRadius().getValue(), LettuceConverters.toGeoArgsUnit(within.getRadius().getMetric()), geoArgs), geoResultsConverter)); return null; } return geoResultsConverter .convert(getConnection().georadius(key, within.getCenter().getX(), within.getCenter().getY(), within.getRadius().getValue(), LettuceConverters.toGeoArgsUnit(within.getRadius().getMetric()), geoArgs)); } catch (Exception ex) { throw convertLettuceAccessException(ex); } }