Examples of HectorTransportException


Examples of me.prettyprint.hector.api.exceptions.HectorTransportException

    if (original instanceof HectorException) {
      return (HectorException) original;
    } else if (original instanceof TApplicationException) {
      return new HCassandraInternalException(((TApplicationException)original).getType(), original.getMessage());
    } else if (original instanceof TException || original instanceof TTransportException) {
      return new HectorTransportException(original);
    } else if (original instanceof org.apache.cassandra.thrift.TimedOutException) {
      return new HTimedOutException(original);
    } else if (original instanceof org.apache.cassandra.thrift.InvalidRequestException) {
      // See bug https://issues.apache.org/jira/browse/CASSANDRA-1862
      // If a bootstrapping node is accessed it responds with IRE. It makes more sense to throw
View Full Code Here

Examples of me.prettyprint.hector.api.exceptions.HectorTransportException

                if (log.isDebugEnabled())
                    log.debug("keyspace reset from {} to {}", keyspaceName, keyspaceNameArg);
            } catch (InvalidRequestException ire) {
                throw new HInvalidRequestException(ire);
            } catch (TException e) {
                throw new HectorTransportException(e);
            }
        }
        return cassandraClient;
    }
View Full Code Here

Examples of me.prettyprint.hector.api.exceptions.HectorTransportException

    } catch (TTransportException e) {
      // Thrift exceptions aren't very good in reporting, so we have to catch the exception here and
      // add details to it.
      log.error("Unable to open transport to " + cassandraHost.getName(), e);
      //clientMonitor.incCounter(Counter.CONNECT_ERROR);
      throw new HectorTransportException("Unable to open transport to " + cassandraHost.getName() +" , " +
          e.getLocalizedMessage(), e);
    }
    return this;
  }
View Full Code Here

Examples of me.prettyprint.hector.api.exceptions.HectorTransportException

      try {
        cassandraClient.set_keyspace(keyspaceNameArg);       
      } catch (InvalidRequestException ire) {
        throw new HInvalidRequestException(ire);
      } catch (TException e) {
        throw new HectorTransportException(e);
      }
      keyspaceName = keyspaceNameArg;
    }
    return cassandraClient;
  }
View Full Code Here

Examples of me.prettyprint.hector.api.exceptions.HectorTransportException

    TSocket socket = new TSocket(cassandraHost.getHost(), cassandraHost.getPort(), timeout);
    if ( cassandraHost.getUseSocketKeepalive() ) {
      try {
        socket.getSocket().setKeepAlive(true);
      } catch (SocketException se) {
        throw new HectorTransportException("Could not set SO_KEEPALIVE on socket: ", se);
      }
    }
    if (cassandraHost.getUseThriftFramedTransport()) {
      transport = new TFramedTransport(socket);
    } else {
      transport = socket;
    }
   
    try {
      transport.open();
    } catch (TTransportException e) {
      // Thrift exceptions aren't very good in reporting, so we have to catch the exception here and
      // add details to it.
      log.debug("Unable to open transport to " + cassandraHost.getName());
      //clientMonitor.incCounter(Counter.CONNECT_ERROR);
      throw new HectorTransportException("Unable to open transport to " + cassandraHost.getName() +" , " +
          e.getLocalizedMessage(), e);
    }
    return this;
  }
View Full Code Here

Examples of me.prettyprint.hector.api.exceptions.HectorTransportException

      // TODO this may be an issue on the Cassandra side which warrants ivestigation.
      // I seem to remember these coming back as TimedOutException previously
      if ( ((TTransportException)original).getCause() instanceof SocketTimeoutException ) {
        return new HTimedOutException(original);
      } else {
        return new HectorTransportException(original);
      }
    } else if (original instanceof org.apache.cassandra.thrift.TimedOutException) {
      return new HTimedOutException(original);
    } else if (original instanceof org.apache.cassandra.thrift.InvalidRequestException) {
      // See bug https://issues.apache.org/jira/browse/CASSANDRA-1862
      // If a bootstrapping node is accessed it responds with IRE. It makes more sense to throw
      // UnavailableException.
      // Hector wraps this caveat and fixes this.
      String why = ((org.apache.cassandra.thrift.InvalidRequestException) original).getWhy();
      if (why != null && why.contains("bootstrap")) {
        return new HUnavailableException(original);
      }
      HInvalidRequestException e = new HInvalidRequestException(original);
      e.setWhy(why);
      return e;
    } else if (original instanceof HPoolExhaustedException ) {
      return (HPoolExhaustedException) original;
    } else if (original instanceof HPoolRecoverableException ) {
      return (HPoolRecoverableException) original;
    } else if (original instanceof HInactivePoolException ) {
      return (HInactivePoolException) original;
    } else if (original instanceof TProtocolException) {
      return new HInvalidRequestException(original);
    } else if (original instanceof org.apache.cassandra.thrift.NotFoundException) {
      return new HNotFoundException(original);
    } else if (original instanceof org.apache.cassandra.thrift.UnavailableException) {
      return new HUnavailableException(original);
    } else if (original instanceof TException) {
      return new HectorTransportException(original);
    } else if (original instanceof NoSuchElementException) {
      return new HPoolExhaustedException(original);
    } else if (original instanceof IllegalStateException) {
      return new PoolIllegalStateException(original);
    } else {
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.