Package org.apache.cassandra.exceptions

Examples of org.apache.cassandra.exceptions.UnavailableException


    {
        if (endpoints.size() < blockfor)
        {
            logger.debug("Live nodes {} do not satisfy ConsistencyLevel ({} required)",
                         StringUtils.join(endpoints, ", "), blockfor);
            throw new UnavailableException(consistencyLevel, blockfor, endpoints.size());
        }
    }
View Full Code Here


        // Throw exception if any of the DC doesn't have livenodes to accept write.
        for (String dc: strategy.getDatacenters())
        {
            if (dcEndpoints.get(dc).get() < responses.get(dc).get())
                throw new UnavailableException(consistencyLevel, responses.get(dc).get(), dcEndpoints.get(dc).get());
        }
    }
View Full Code Here

        {
            // Ensure there are blockFor distinct living nodes (hints (local) are ok).
            // Thus we include the local node (coordinator) as a valid replica if it is there already.
            int effectiveEndpoints = writeEndpoints.contains(FBUtilities.getBroadcastAddress()) ? writeEndpoints.size() : writeEndpoints.size() + 1;
            if (effectiveEndpoints < responses.get())
                throw new UnavailableException(consistencyLevel, responses.get(), effectiveEndpoints);
            return;
        }

        // count destinations that are part of the desired target set
        int liveNodes = 0;
        for (InetAddress destination : writeEndpoints)
        {
            if (FailureDetector.instance.isAlive(destination))
                liveNodes++;
        }
        if (liveNodes < responses.get())
        {
            throw new UnavailableException(consistencyLevel, responses.get(), liveNodes);
        }
    }
View Full Code Here

                liveNodes++;
        }

        if (liveNodes < responses.get())
        {
            throw new UnavailableException(consistencyLevel, responses.get(), liveNodes);
        }
    }
View Full Code Here

                }
                builder.append("] are insufficient to satisfy LOCAL_QUORUM requirement of ").append(blockfor).append(" live nodes in '").append(localdc).append("'");
                logger.debug(builder.toString());
            }

            throw new UnavailableException(consistencyLevel, blockfor, localEndpoints);
        }
    }
View Full Code Here

                        case UNAVAILABLE:
                            assert err.error instanceof UnavailableException;
                            if (metricsEnabled())
                                metrics().getErrorMetrics().getUnavailables().inc();

                            UnavailableException ue = (UnavailableException)err.error;
                            ConsistencyLevel ucl = ConsistencyLevel.from(ue.consistency);
                            retry = retryPolicy.onUnavailable(query, ucl, ue.required, ue.alive, queryRetries);
                            break;
                        case OVERLOADED:
                            // Try another node
View Full Code Here

                        case UNAVAILABLE:
                            assert err.error instanceof UnavailableException;
                            if (metricsEnabled())
                                metrics().getErrorMetrics().getUnavailables().inc();

                            UnavailableException ue = (UnavailableException)err.error;
                            ConsistencyLevel ucl = ConsistencyLevel.from(ue.consistency);
                            retry = retryPolicy.onUnavailable(query, ucl, ue.required, ue.alive, queryRetries);
                            break;
                        case OVERLOADED:
                            // Try another node
View Full Code Here

                        case UNAVAILABLE:
                            assert err.error instanceof UnavailableException;
                            if (metricsEnabled())
                                metrics().getErrorMetrics().getUnavailables().inc();

                            UnavailableException ue = (UnavailableException)err.error;
                            ConsistencyLevel ucl = ConsistencyLevel.from(ue.consistency);
                            retry = retryPolicy.onUnavailable(query, ucl, ue.required, ue.alive, queryRetries);
                            break;
                        case OVERLOADED:
                            // Try another node
View Full Code Here

                        case UNAVAILABLE:
                            assert err.error instanceof UnavailableException;
                            if (metricsEnabled())
                                metrics().getErrorMetrics().getUnavailables().inc();

                            UnavailableException ue = (UnavailableException)err.error;
                            ConsistencyLevel ucl = ConsistencyLevel.from(ue.consistency);
                            retry = retryPolicy.onUnavailable(query, ucl, ue.required, ue.alive, queryRetries);
                            break;
                        case OVERLOADED:
                            // Try another node
View Full Code Here

                        case UNAVAILABLE:
                            assert err.error instanceof UnavailableException;
                            if (metricsEnabled())
                                metrics().getErrorMetrics().getUnavailables().inc();

                            UnavailableException ue = (UnavailableException)err.error;
                            ConsistencyLevel ucl = ConsistencyLevel.from(ue.consistency);
                            retry = retryPolicy.onUnavailable(query, ucl, ue.required, ue.alive, queryRetries);
                            break;
                        case OVERLOADED:
                            // Try another node
View Full Code Here

TOP

Related Classes of org.apache.cassandra.exceptions.UnavailableException

Copyright © 2018 www.massapicom. 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.