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