@Override public Long convert(byte[] source) { return Long.valueOf(JedisConverters.toString(source)); } });
/** * Convert the given {@code source} value to the corresponding {@link ValueEncoding}. * * @param source can be {@literal null}. * @return the {@link ValueEncoding} for given {@code source}. Never {@literal null}. * @since 2.1 */ public static ValueEncoding toEncoding(@Nullable byte[] source) { return ValueEncoding.of(toString(source)); }
@Override public Integer clusterGetSlotForKey(byte[] key) { return clusterCommandExecutor.executeCommandOnArbitraryNode((JedisClusterCommandCallback<Integer>) client -> client .clusterKeySlot(JedisConverters.toString(key)).intValue()).getValue(); }
return JedisConverters.toString((byte[]) result);
@Override public String scriptLoad(byte[] script) { Assert.notNull(script, "Script must not be null!"); if (isQueueing() || isPipelined()) { throw new UnsupportedOperationException(); } try { return JedisConverters.toString(connection.getJedis().scriptLoad(script)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public void restore(byte[] key, long ttlInMillis, byte[] serializedValue, boolean replace) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(serializedValue, "Serialized value must not be null!"); if (ttlInMillis > Integer.MAX_VALUE) { throw new UnsupportedOperationException("Jedis does not support ttlInMillis exceeding Integer.MAX_VALUE."); } connection.getClusterCommandExecutor().executeCommandOnSingleNode((JedisClusterCommandCallback<String>) client -> { if (!replace) { return client.restore(key, Long.valueOf(ttlInMillis).intValue(), serializedValue); } return JedisConverters.toString(this.connection.execute("RESTORE", key, Arrays.asList(JedisConverters.toBytes(ttlInMillis), serializedValue, JedisConverters.toBytes ("REPLACE")))); }, connection.clusterGetNodeForKey(key)); }
@Override public Long convert(byte[] source) { return Long.valueOf(JedisConverters.toString(source)); } });
@Override public Long convert(byte[] source) { return Long.valueOf(JedisConverters.toString(source)); } });
/** * Convert the given {@code source} value to the corresponding {@link ValueEncoding}. * * @param source can be {@literal null}. * @return the {@link ValueEncoding} for given {@code source}. Never {@literal null}. * @since 2.1 */ public static ValueEncoding toEncoding(@Nullable byte[] source) { return ValueEncoding.of(toString(source)); }
/** * Convert the given {@code source} value to the corresponding {@link ValueEncoding}. * * @param source can be {@literal null}. * @return the {@link ValueEncoding} for given {@code source}. Never {@literal null}. * @since 2.1 */ public static ValueEncoding toEncoding(@Nullable byte[] source) { return ValueEncoding.of(toString(source)); }
@Override public Integer clusterGetSlotForKey(byte[] key) { return clusterCommandExecutor.executeCommandOnArbitraryNode((JedisClusterCommandCallback<Integer>) client -> client .clusterKeySlot(JedisConverters.toString(key)).intValue()).getValue(); }
@Override public Integer clusterGetSlotForKey(byte[] key) { return clusterCommandExecutor.executeCommandOnArbitraryNode((JedisClusterCommandCallback<Integer>) client -> client .clusterKeySlot(JedisConverters.toString(key)).intValue()).getValue(); }
return JedisConverters.toString((byte[]) result);
return JedisConverters.toString((byte[]) result);
@Override public String scriptLoad(byte[] script) { Assert.notNull(script, "Script must not be null!"); if (isQueueing() || isPipelined()) { throw new UnsupportedOperationException(); } try { return JedisConverters.toString(connection.getJedis().scriptLoad(script)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public String scriptLoad(byte[] script) { Assert.notNull(script, "Script must not be null!"); if (isQueueing() || isPipelined()) { throw new UnsupportedOperationException(); } try { return JedisConverters.toString(connection.getJedis().scriptLoad(script)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
@Override public void restore(byte[] key, long ttlInMillis, byte[] serializedValue, boolean replace) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(serializedValue, "Serialized value must not be null!"); if (ttlInMillis > Integer.MAX_VALUE) { throw new UnsupportedOperationException("Jedis does not support ttlInMillis exceeding Integer.MAX_VALUE."); } connection.getClusterCommandExecutor().executeCommandOnSingleNode((JedisClusterCommandCallback<String>) client -> { if (!replace) { return client.restore(key, Long.valueOf(ttlInMillis).intValue(), serializedValue); } return JedisConverters.toString(this.connection.execute("RESTORE", key, Arrays.asList(JedisConverters.toBytes(ttlInMillis), serializedValue, JedisConverters.toBytes ("REPLACE")))); }, connection.clusterGetNodeForKey(key)); }
@Override public void restore(byte[] key, long ttlInMillis, byte[] serializedValue, boolean replace) { Assert.notNull(key, "Key must not be null!"); Assert.notNull(serializedValue, "Serialized value must not be null!"); if (ttlInMillis > Integer.MAX_VALUE) { throw new UnsupportedOperationException("Jedis does not support ttlInMillis exceeding Integer.MAX_VALUE."); } connection.getClusterCommandExecutor().executeCommandOnSingleNode((JedisClusterCommandCallback<String>) client -> { if (!replace) { return client.restore(key, Long.valueOf(ttlInMillis).intValue(), serializedValue); } return JedisConverters.toString(this.connection.execute("RESTORE", key, Arrays.asList(JedisConverters.toBytes(ttlInMillis), serializedValue, JedisConverters.toBytes ("REPLACE")))); }, connection.clusterGetNodeForKey(key)); }