redis.clients.jedis.exceptions.JedisException.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(61)

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

JedisException.<init>介绍

暂无

代码示例

代码示例来源:origin: sohutv/cachecloud

public static String encode(final byte[] data) {
  try {
   return new String(data, Protocol.CHARSET);
  } catch (UnsupportedEncodingException e) {
   throw new JedisException(e);
  }
 }
}

代码示例来源:origin: sohutv/cachecloud

protected void returnResourceObject(final T resource) {
 if (resource == null) {
  return;
 }
 try {
  internalPool.returnObject(resource);
 } catch (Exception e) {
  throw new JedisException("Could not return the resource to the pool", e);
 }
}

代码示例来源:origin: sohutv/cachecloud

public void addObjects(int count) {
  try {
   for (int i = 0; i < count; i++) {
    this.internalPool.addObject();
   }
  } catch (Exception e) {
   throw new JedisException("Error trying to add idle objects", e);
  }
 }
}

代码示例来源:origin: sohutv/cachecloud

public static byte[] encode(final String str) {
 try {
  if (str == null) {
   throw new JedisDataException("value sent to redis cannot be null");
  }
  return str.getBytes(Protocol.CHARSET);
 } catch (UnsupportedEncodingException e) {
  throw new JedisException(e);
 }
}

代码示例来源:origin: sohutv/cachecloud

protected void returnBrokenResourceObject(final T resource) {
 try {
  internalPool.invalidateObject(resource);
 } catch (Exception e) {
  throw new JedisException("Could not return the resource to the pool", e);
 }
}

代码示例来源:origin: sohutv/cachecloud

protected void closeInternalPool() {
 try {
  internalPool.close();
 } catch (Exception e) {
  throw new JedisException("Could not destroy the pool", e);
 }
}

代码示例来源:origin: Netflix/conductor

@Override public String get(final String key) {
  try {
    return redis.get(key);
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public Long move(final String key, final int dbIndex) {
  try {
    return redis.move(key, dbIndex);
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public String hget(final String key, final String field) {
  try {
    return redis.hget(key, field);
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public Set<String> hkeys(final String key) {
  try {
    return redis.hkeys(key);
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public List<String> hvals(final String key) {
  try {
    return redis.hvals(key);
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public String lpop(final String key) {
  try {
    return redis.lpop(key);
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public String rpop(final String key) {
  try {
    return redis.rpop(key);
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public String spop(final String key) {
  try {
    return redis.spop(key);
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public String watch(final String ... keys) {
  try {
    for (String key : keys) {
      redis.watch(key);
    }
    return "OK";
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}
/*

代码示例来源:origin: Netflix/conductor

@Override public Long zcount(final String key, final String min, final String max) {
  try {
    return redis.zcount(key, Double.parseDouble(min), Double.parseDouble(max));
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public Long zremrangeByRank(final String key, final long start, final long end) {
  try {
    return redis.zremrangebyrank(key, start, end);
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public Set<Tuple> zrevrangeByScoreWithScores(final String key, final double max, final double min) {
  try {
    return toTupleSet(redis.zrevrangebyscore(key, String.valueOf(max), String.valueOf(min), "withscores"));
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: Netflix/conductor

@Override public Set<Tuple> zrevrangeByScoreWithScores(final String key, final String max, final String min) {
  try {
    return toTupleSet(redis.zrevrangebyscore(key, max, min, "withscores"));
  }
  catch (Exception e) {
    throw new JedisException(e);
  }
}

代码示例来源:origin: sohutv/cachecloud

@Override
protected void returnResource(final Jedis resource) {
 if (resource != null) {
  try {
   resource.resetState();
   returnResourceObject(resource);
  } catch (Exception e) {
   returnBrokenResource(resource);
   throw new JedisException("Could not return the resource to the pool", e);
  }
 }
}
 private final String host;

相关文章

微信公众号

最新文章

更多