Java Code Examples for org.apache.cassandra.config.DatabaseDescriptor#getWriteRpcTimeout()
The following examples show how to use
org.apache.cassandra.config.DatabaseDescriptor#getWriteRpcTimeout() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractWriteResponseHandler.java From stratio-cassandra with Apache License 2.0 | 5 votes |
public void get() throws WriteTimeoutException { long requestTimeout = writeType == WriteType.COUNTER ? DatabaseDescriptor.getCounterWriteRpcTimeout() : DatabaseDescriptor.getWriteRpcTimeout(); long timeout = TimeUnit.MILLISECONDS.toNanos(requestTimeout) - (System.nanoTime() - start); boolean success; try { success = condition.await(timeout, TimeUnit.NANOSECONDS); } catch (InterruptedException ex) { throw new AssertionError(ex); } if (!success) { int acks = ackCount(); int blockedFor = totalBlockFor(); // It's pretty unlikely, but we can race between exiting await above and here, so // that we could now have enough acks. In that case, we "lie" on the acks count to // avoid sending confusing info to the user (see CASSANDRA-6491). if (acks >= blockedFor) acks = blockedFor - 1; throw new WriteTimeoutException(writeType, consistencyLevel, acks, blockedFor); } }
Example 2
Source File: Mutation.java From stratio-cassandra with Apache License 2.0 | 4 votes |
public long getTimeout() { return DatabaseDescriptor.getWriteRpcTimeout(); }
Example 3
Source File: BatchlogManager.java From stratio-cassandra with Apache License 2.0 | 4 votes |
public long getBatchlogTimeout() { return DatabaseDescriptor.getWriteRpcTimeout() * 2; // enough time for the actual write + BM removal mutation }
Example 4
Source File: StorageProxy.java From stratio-cassandra with Apache License 2.0 | votes |
public Long getWriteRpcTimeout() { return DatabaseDescriptor.getWriteRpcTimeout(); }