Java Examples for org.apache.cassandra.service.TimedOutException

The following java examples will help you to understand the usage of org.apache.cassandra.service.TimedOutException. These source code samples are taken from different open source projects.

Example 1
Project: eQTL-GWT-Cassandra-master  File: CassandraSession.java View source code
public void flush() {
    for (Map.Entry<String, Map<String, List<ColumnOrSuperColumn>>> rowToStore : rowKey2columnFamily2objectsToStore.entrySet()) {
        while (true) {
            // we retry ad infinitum
            try {
                client.batch_insert("expressionqtl", rowToStore.getKey(), rowToStore.getValue(), ConsistencyLevel.ONE);
                break;
            } catch (InvalidRequestException e) {
                e.printStackTrace();
            } catch (UnavailableException e) {
                e.printStackTrace();
            } catch (TimedOutException e) {
                e.printStackTrace();
            } catch (TException e) {
                e.printStackTrace();
            }
            sleep1s();
        }
        rowToStore.getValue().clear();
    }
}