redis.clients.jedis.JedisCluster.geodist()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中redis.clients.jedis.JedisCluster.geodist()方法的一些代码示例,展示了JedisCluster.geodist()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JedisCluster.geodist()方法的具体详情如下:
包路径:redis.clients.jedis.JedisCluster
类名称:JedisCluster
方法名:geodist

JedisCluster.geodist介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Distance geoDist(byte[] key, byte[] member1, byte[] member2) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(member1, "Member1 must not be null!");
  Assert.notNull(member2, "Member2 must not be null!");
  try {
    return JedisConverters.distanceConverterForMetric(DistanceUnit.METERS)
        .convert(connection.getCluster().geodist(key, member1, member2));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: spring-projects/spring-data-redis

@Override
public Distance geoDist(byte[] key, byte[] member1, byte[] member2, Metric metric) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(member1, "Member1 must not be null!");
  Assert.notNull(member2, "Member2 must not be null!");
  Assert.notNull(metric, "Metric must not be null!");
  GeoUnit geoUnit = JedisConverters.toGeoUnit(metric);
  try {
    return JedisConverters.distanceConverterForMetric(metric)
        .convert(connection.getCluster().geodist(key, member1, member2, geoUnit));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: net.oschina.j2cache/j2cache-core

@Override
public Double geodist(byte[] bytes, byte[] bytes1, byte[] bytes2) {
  return cluster.geodist(bytes, bytes1, bytes2);
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

public Double geodist(String key, String member1, String member2, GeoUnit unit) {
  return jedisCluster.geodist(key, member1, member2, unit);
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

public Double geodist(byte[] key, byte[] member1, byte[] member2, GeoUnit unit) {
  return jedisCluster.geodist(key, member1, member2, unit);
}

代码示例来源:origin: net.oschina.j2cache/j2cache-core

@Override
public Double geodist(byte[] bytes, byte[] bytes1, byte[] bytes2, GeoUnit geoUnit) {
  return cluster.geodist(bytes, bytes1, bytes2, geoUnit);
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

public Double geodist(String key, String member1, String member2) {
  return jedisCluster.geodist(key, member1, member2);
}

代码示例来源:origin: org.nutz/nutz-integration-jedis

public Double geodist(byte[] key, byte[] member1, byte[] member2) {
  return jedisCluster.geodist(key, member1, member2);
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public Distance geoDist(byte[] key, byte[] member1, byte[] member2) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(member1, "Member1 must not be null!");
  Assert.notNull(member2, "Member2 must not be null!");
  try {
    return JedisConverters.distanceConverterForMetric(DistanceUnit.METERS)
        .convert(connection.getCluster().geodist(key, member1, member2));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public Distance geoDist(byte[] key, byte[] member1, byte[] member2) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(member1, "Member1 must not be null!");
  Assert.notNull(member2, "Member2 must not be null!");
  try {
    return JedisConverters.distanceConverterForMetric(DistanceUnit.METERS)
        .convert(connection.getCluster().geodist(key, member1, member2));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: org.springframework.data/spring-data-redis

@Override
public Distance geoDist(byte[] key, byte[] member1, byte[] member2, Metric metric) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(member1, "Member1 must not be null!");
  Assert.notNull(member2, "Member2 must not be null!");
  Assert.notNull(metric, "Metric must not be null!");
  GeoUnit geoUnit = JedisConverters.toGeoUnit(metric);
  try {
    return JedisConverters.distanceConverterForMetric(metric)
        .convert(connection.getCluster().geodist(key, member1, member2, geoUnit));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
public Distance geoDist(byte[] key, byte[] member1, byte[] member2, Metric metric) {
  Assert.notNull(key, "Key must not be null!");
  Assert.notNull(member1, "Member1 must not be null!");
  Assert.notNull(member2, "Member2 must not be null!");
  Assert.notNull(metric, "Metric must not be null!");
  GeoUnit geoUnit = JedisConverters.toGeoUnit(metric);
  try {
    return JedisConverters.distanceConverterForMetric(metric)
        .convert(connection.getCluster().geodist(key, member1, member2, geoUnit));
  } catch (Exception ex) {
    throw convertJedisAccessException(ex);
  }
}

相关文章

微信公众号

最新文章

更多

JedisCluster类方法