@Override public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) { Assert.notNull(srcKey, "Source key must not be null!"); Assert.notNull(dstKey, "Destination key must not be null!"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, dstKey)) { try { return connection.getCluster().brpoplpush(srcKey, dstKey, timeout); } catch (Exception ex) { throw convertJedisAccessException(ex); } } List<byte[]> val = bRPop(timeout, srcKey); if (!CollectionUtils.isEmpty(val)) { lPush(dstKey, val.get(1)); return val.get(1); } return null; }
@Override public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) { Assert.notNull(srcKey, "Source key must not be null!"); Assert.notNull(dstKey, "Destination key must not be null!"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, dstKey)) { try { return connection.getCluster().rpoplpush(srcKey, dstKey); } catch (Exception ex) { throw convertJedisAccessException(ex); } } byte[] val = rPop(srcKey); lPush(dstKey, val); return val; }
@Override public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) { Assert.notNull(srcKey, "Source key must not be null!"); Assert.notNull(dstKey, "Destination key must not be null!"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, dstKey)) { try { return connection.getCluster().brpoplpush(srcKey, dstKey, timeout); } catch (Exception ex) { throw convertJedisAccessException(ex); } } List<byte[]> val = bRPop(timeout, srcKey); if (!CollectionUtils.isEmpty(val)) { lPush(dstKey, val.get(1)); return val.get(1); } return null; }
@Override public byte[] bRPopLPush(int timeout, byte[] srcKey, byte[] dstKey) { Assert.notNull(srcKey, "Source key must not be null!"); Assert.notNull(dstKey, "Destination key must not be null!"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, dstKey)) { try { return connection.getCluster().brpoplpush(srcKey, dstKey, timeout); } catch (Exception ex) { throw convertJedisAccessException(ex); } } List<byte[]> val = bRPop(timeout, srcKey); if (!CollectionUtils.isEmpty(val)) { lPush(dstKey, val.get(1)); return val.get(1); } return null; }
@Override public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) { Assert.notNull(srcKey, "Source key must not be null!"); Assert.notNull(dstKey, "Destination key must not be null!"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, dstKey)) { try { return connection.getCluster().rpoplpush(srcKey, dstKey); } catch (Exception ex) { throw convertJedisAccessException(ex); } } byte[] val = rPop(srcKey); lPush(dstKey, val); return val; }
@Override public byte[] rPopLPush(byte[] srcKey, byte[] dstKey) { Assert.notNull(srcKey, "Source key must not be null!"); Assert.notNull(dstKey, "Destination key must not be null!"); if (ClusterSlotHashUtil.isSameSlotForAllKeys(srcKey, dstKey)) { try { return connection.getCluster().rpoplpush(srcKey, dstKey); } catch (Exception ex) { throw convertJedisAccessException(ex); } } byte[] val = rPop(srcKey); lPush(dstKey, val); return val; }