private HClientPool getClientFromLBPolicy(Set<CassandraHost> excludeHosts) { if ( hostPools.isEmpty() ) { throw new HectorException("All host pools marked down. Retry burden pushed out to client."); } return loadBalancingPolicy.getPool(hostPoolValues, excludeHosts); }
throw new HectorException("Failed to retrieve rows from Cassandra.",e); throw new HectorException("Failed to retrieve rows from Cassandra.",e);
@Override public List<CounterColumn> execute(Cassandra.Client cassandra) throws HectorException { try { List<ColumnOrSuperColumn> cosclist = cassandra.get_slice(key, columnParent, predicate, getThriftCl(OperationType.READ)); if (cosclist == null) { return null; } ArrayList<CounterColumn> result = new ArrayList<CounterColumn>(cosclist.size()); for (ColumnOrSuperColumn cosc : cosclist) { if (cosc.isSetCounter_column()) { result.add(cosc.getCounter_column()); } else { // Inconsistency throw new HectorException("Regular Column is part of the set of Counter Column"); } } return result; } catch (Exception e) { throw xtrans.translate(e); } } };
throw new HectorException("Unable to clone row with null column family"); throw new HectorException("Unable to clone row with null row key"); throw new HectorException("Unable to clone row with null clone key");
throw new HectorException("HConnectionManager returned a null client after aquisition - are we shutting down?");
/** * Will throw a runtime exception if neither columnsNames nor count were set. * @return */ public SlicePredicate toThrift() { SlicePredicate pred = new SlicePredicate(); switch (predicateType) { case ColumnNames: if (columnNames == null ) { return null; } pred.setColumn_names(toThriftColumnNames(columnNames)); break; case Range: Assert.isTrue(countSet, "Count was not set, neither were column-names set, can't execute"); SliceRange range = new SliceRange(findBytes(start), findBytes(finish), reversed, count); pred.setSlice_range(range); break; case Unknown: default: throw new HectorException( "Neither column names nor range were set, this is an invalid slice predicate"); } return pred; }
he = new PoolIllegalStateException(original); } else { he = new HectorException(original);
private HClientPool getClientFromLBPolicy(Set<CassandraHost> excludeHosts) { if ( hostPools.isEmpty() ) { throw new HectorException("All host pools marked down. Retry burden pushed out to client."); } return loadBalancingPolicy.getPool(hostPoolValues, excludeHosts); }
private HClientPool getClientFromLBPolicy(Set<CassandraHost> excludeHosts) { if ( hostPools.isEmpty() ) { throw new HectorException("All host pools marked down. Retry burden pushed out to client."); } return loadBalancingPolicy.getPool(hostPoolValues, excludeHosts); }
throw new HectorException("Failed to retrieve rows from Cassandra.",e); throw new HectorException("Failed to retrieve rows from Cassandra.",e);
@Override public List<CounterColumn> execute(Cassandra.Client cassandra) throws HectorException { try { List<ColumnOrSuperColumn> cosclist = cassandra.get_slice(key, columnParent, predicate, getThriftCl(OperationType.READ)); if (cosclist == null) { return null; } ArrayList<CounterColumn> result = new ArrayList<CounterColumn>(cosclist.size()); for (ColumnOrSuperColumn cosc : cosclist) { if (cosc.isSetCounter_column()) { result.add(cosc.getCounter_column()); } else { // Inconsistency throw new HectorException("Regular Column is part of the set of Counter Column"); } } return result; } catch (Exception e) { throw xtrans.translate(e); } } };
@Override public HClient borrowClient() throws HectorException { if ( !active.get() ) { throw new HInactivePoolException("Attempt to borrow on in-active pool: " + getName()); } HClient cassandraClient = availableClientQueue.poll(); int currentActiveClients = activeClientsCount.incrementAndGet(); try { if ( cassandraClient == null ) { if (currentActiveClients <= cassandraHost.getMaxActive()) { cassandraClient = createClient(); } else { // We can't grow so let's wait for a connection to become available. cassandraClient = waitForConnection(); } } if ( cassandraClient == null ) { throw new HectorException("HConnectionManager returned a null client after aquisition - are we shutting down?"); } } catch (RuntimeException e) { activeClientsCount.decrementAndGet(); throw e; } realActiveClientsCount.incrementAndGet(); return cassandraClient; }
@Override public List<CounterColumn> execute(Cassandra.Client cassandra) throws HectorException { try { List<ColumnOrSuperColumn> cosclist = cassandra.get_slice(key, columnParent, predicate, getThriftCl(OperationType.READ)); if (cosclist == null) { return null; } ArrayList<CounterColumn> result = new ArrayList<CounterColumn>(cosclist.size()); for (ColumnOrSuperColumn cosc : cosclist) { if (cosc.isSetCounter_column()) { result.add(cosc.getCounter_column()); } else { // Inconsistency throw new HectorException("Regular Column is part of the set of Counter Column"); } } return result; } catch (Exception e) { throw xtrans.translate(e); } } };
} catch (InterruptedException e) { throw new HectorException(e.getMessage());
throw new HectorException("HConnectionManager returned a null client after aquisition - are we shutting down?");
throw new HectorException("Unable to clone row with null column family"); throw new HectorException("Unable to clone row with null row key"); throw new HectorException("Unable to clone row with null clone key");
/** * Will throw a runtime exception if neither columnsNames nor count were set. * @return */ public SlicePredicate toThrift() { SlicePredicate pred = new SlicePredicate(); switch (predicateType) { case ColumnNames: if (columnNames == null ) { return null; } pred.setColumn_names(toThriftColumnNames(columnNames)); break; case Range: Assert.isTrue(countSet, "Count was not set, neither were column-names set, can't execute"); SliceRange range = new SliceRange(findBytes(start), findBytes(finish), reversed, count); pred.setSlice_range(range); break; case Unknown: default: throw new HectorException( "Neither column names nor range were set, this is an invalid slice predicate"); } return pred; }
/** * Will throw a runtime exception if neither columnsNames nor count were set. * @return */ public SlicePredicate toThrift() { SlicePredicate pred = new SlicePredicate(); switch (predicateType) { case ColumnNames: if (columnNames == null ) { return null; } pred.setColumn_names(toThriftColumnNames(columnNames)); break; case Range: Assert.isTrue(countSet, "Count was not set, neither were column-names set, can't execute"); SliceRange range = new SliceRange(findBytes(start), findBytes(finish), reversed, count); pred.setSlice_range(range); break; case Unknown: default: throw new HectorException( "Neither column names nor range were set, this is an invalid slice predicate"); } return pred; }
he = new PoolIllegalStateException(original); } else { he = new HectorException(original);
return new PoolIllegalStateException(original); } else { return new HectorException(original);