@Override public RedisListCommands listCommands() { return new LettuceClusterListCommands(this); }
@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)) { return super.bRPopLPush(timeout, srcKey, dstKey); } 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)) { return super.rPopLPush(srcKey, dstKey); } 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)) { return super.rPopLPush(srcKey, dstKey); } 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)) { return super.bRPopLPush(timeout, srcKey, dstKey); } List<byte[]> val = bRPop(timeout, srcKey); if (!CollectionUtils.isEmpty(val)) { lPush(dstKey, val.get(1)); return val.get(1); } return null; } }
@Override public RedisListCommands listCommands() { return new LettuceClusterListCommands(this); }
@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)) { return super.rPopLPush(srcKey, dstKey); } 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)) { return super.bRPopLPush(timeout, srcKey, dstKey); } List<byte[]> val = bRPop(timeout, srcKey); if (!CollectionUtils.isEmpty(val)) { lPush(dstKey, val.get(1)); return val.get(1); } return null; } }
@Override public RedisListCommands listCommands() { return new LettuceClusterListCommands(this); }