Examples of RedisException


Examples of com.lambdaworks.redis.RedisException

            case '+': return SINGLE;
            case '-': return ERROR;
            case ':': return INTEGER;
            case '$': return BULK;
            case '*': return MULTI;
            defaultthrow new RedisException("Invalid first byte");
        }
    }
View Full Code Here

Examples of com.lambdaworks.redis.RedisException

     * {@link RedisException} containing the error message.
     *
     * @throws RedisException if the server returned an error.
     */
    protected void errorCheck() throws RedisException {
        if (error != null) throw new RedisException(error);
    }
View Full Code Here

Examples of com.lambdaworks.redis.RedisException

    @Override
    public <T> RedisCommand<K, V, T> write(RedisCommand<K, V, T> command) {
        try {

            if (closed) {
                throw new RedisException("Connection is closed");
            }

            try {
                writeLock.lock();
                Channel channel = this.channel.get();
View Full Code Here

Examples of com.lambdaworks.redis.RedisException

            }

            try {
                channel.get().close().sync();
            } catch (InterruptedException e) {
                throw new RedisException(e);
            }

            channel.set(null);
        }
    }
View Full Code Here

Examples of com.lambdaworks.redis.RedisException

    @Override
    public void complete(int depth) {
        if (depth == 1) {
            Command<K, V, ?> cmd = queue.remove();
            CommandOutput<K, V, ?> o = cmd.getOutput();
            output.add(!o.hasError() ? o.get() : new RedisException(o.getError()));
            cmd.complete();
        } else if (depth == 0 && !queue.isEmpty()) {
            for (Command<K, V, ?> cmd : queue) {
                cmd.complete();
            }
View Full Code Here

Examples of com.lambdaworks.redis.RedisException

            case '+': return SINGLE;
            case '-': return ERROR;
            case ':': return INTEGER;
            case '$': return BULK;
            case '*': return MULTI;
            defaultthrow new RedisException("Invalid first byte");
        }
    }
View Full Code Here

Examples of com.lambdaworks.redis.RedisException

                if (output.getError().startsWith("MOVED")) {
                    String[] parts = output.getError().split(" ");
                    int slot = Integer.valueOf(parts[1]);
                    promise.setFailure(new RedisMovedException(slot));
                } else {
                    promise.setFailure(new RedisException(output.getError()));
                }
            } else {
                promise.setSuccess((T)res);
            }
        }
View Full Code Here

Examples of com.lambdaworks.redis.RedisException

        output.add(bytes == null ? null : codec.decodeValue(bytes));
    }

    @Override
    public void setError(ByteBuffer error) {
        output.add(new RedisException(decodeAscii(error)));
    }
View Full Code Here

Examples of com.lambdaworks.redis.RedisException

                String node = iterator.next();
                RedisClusterNode partition = parseNode(node);
                result.addPartition(partition);
            }
        } catch (Exception e) {
            throw new RedisException("Cannot parse " + nodes, e);
        }

        return result;
    }
View Full Code Here

Examples of com.lambdaworks.redis.RedisException

    @SuppressWarnings({ "unchecked", "hiding", "rawtypes" })
    public <K, V> RedisAsyncConnectionImpl<K, V> getConnection(Intent intent, int slot) {
        logger.debug("getConnection(" + intent + ", " + slot + ")");
        RedisClusterNode partition = partitions.getPartitionBySlot(slot);
        if (partition == null) {
            throw new RedisException("Cannot determine a partition for slot " + slot + " (Partitions: " + partitions + ")");
        }

        try {
            PoolKey key = new PoolKey(intent, partition.getUri());
            RedisAsyncConnection connection = partitionPool.borrowObject(key);
            partitionPool.returnObject(key, connection);
            return (RedisAsyncConnectionImpl<K, V>) connection;
        } catch (Exception e) {
            throw new RedisException(e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.