protected Map<String, ColumnFamily> readColumnFamily( List<ReadCommand> commands, ConsistencyLevel consistency) throws InvalidRequestException, UnavailableException, TimedOutException { // TODO - Support multiple column families per row, right now row only contains 1 column family Map<String, ColumnFamily> columnFamilyKeyMap = new HashMap<String, ColumnFamily>(); if (consistency == ConsistencyLevel.ZERO) throw newInvalidRequestException( "Consistency level zero may not be applied to read operations"); if (consistency == ConsistencyLevel.ALL) throw newInvalidRequestException( "Consistency level all is not yet supported on read operations"); List<Row> rows; try { rows = StorageProxy.readProtocol(commands, thriftConsistencyLevel(consistency)); } catch (TimeoutException e) { throw new TimedOutException(); } catch (IOException e) { throw new RuntimeException(e); } // FIXME: This suckage brought to you by StorageService and StorageProxy // which throw Thrift exceptions directly. catch (org.apache.cassandra.thrift.UnavailableException e) { throw new UnavailableException(); } for (Row row : rows) { columnFamilyKeyMap.put(row.key, row.cf); } return columnFamilyKeyMap; }