/** * Sets the rate for the rate limiter. When compaction_throughput_mb_per_sec is 0 or node is bootstrapping, * this sets the rate to Double.MAX_VALUE bytes per second. * @param throughPutMbPerSec throughput to set in mb per second */ public void setRate(final double throughPutMbPerSec) { double throughput = throughPutMbPerSec * 1024.0 * 1024.0; // if throughput is set to 0, throttling is disabled if (throughput == 0 || StorageService.instance.isBootstrapMode()) throughput = Double.MAX_VALUE; if (compactionRateLimiter.getRate() != throughput) compactionRateLimiter.setRate(throughput); }
/** * Sets the rate for the rate limiter. When compaction_throughput_mb_per_sec is 0 or node is bootstrapping, * this sets the rate to Double.MAX_VALUE bytes per second. * @param throughPutMbPerSec throughput to set in mb per second */ public void setRate(final double throughPutMbPerSec) { double throughput = throughPutMbPerSec * 1024.0 * 1024.0; // if throughput is set to 0, throttling is disabled if (throughput == 0 || StorageService.instance.isBootstrapMode()) throughput = Double.MAX_VALUE; if (compactionRateLimiter.getRate() != throughput) compactionRateLimiter.setRate(throughput); }
/** * Sets the rate for the rate limiter. When compaction_throughput_mb_per_sec is 0 or node is bootstrapping, * this sets the rate to Double.MAX_VALUE bytes per second. * @param throughPutMbPerSec throughput to set in mb per second */ public void setRate(final double throughPutMbPerSec) { double throughput = throughPutMbPerSec * 1024.0 * 1024.0; // if throughput is set to 0, throttling is disabled if (throughput == 0 || StorageService.instance.isBootstrapMode()) throughput = Double.MAX_VALUE; if (compactionRateLimiter.getRate() != throughput) compactionRateLimiter.setRate(throughput); }
public static PartitionIterator read(SinglePartitionReadCommand.Group group, ConsistencyLevel consistencyLevel) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException, ReflectiveOperationException { if (StorageService.instance.isBootstrapMode() && !systemKeyspaceQuery(group.commands)) { readMetrics.unavailables.mark(); throw new IsBootstrappingException(); } return readRegular(group, consistencyLevel); }
/** * Performs the actual reading of a row out of the StorageService, fetching * a specific set of column names from a given column family. */ public static PartitionIterator read(SinglePartitionReadCommand.Group group, ConsistencyLevel consistencyLevel, ClientState state, long queryStartNanoTime) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException { if (StorageService.instance.isBootstrapMode() && !systemKeyspaceQuery(group.commands)) { readMetrics.unavailables.mark(); readMetricsMap.get(consistencyLevel).unavailables.mark(); throw new IsBootstrappingException(); } return consistencyLevel.isSerialConsistency() ? readWithPaxos(group, consistencyLevel, state, queryStartNanoTime) : readRegular(group, consistencyLevel, queryStartNanoTime); }
/** * Performs the actual reading of a row out of the StorageService, fetching * a specific set of column names from a given column family. */ public static PartitionIterator read(SinglePartitionReadCommand.Group group, ConsistencyLevel consistencyLevel, ClientState state, long queryStartNanoTime) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException { if (StorageService.instance.isBootstrapMode() && !systemKeyspaceQuery(group.commands)) { readMetrics.unavailables.mark(); readMetricsMap.get(consistencyLevel).unavailables.mark(); throw new IsBootstrappingException(); } return consistencyLevel.isSerialConsistency() ? readWithPaxos(group, consistencyLevel, state, queryStartNanoTime) : readRegular(group, consistencyLevel, queryStartNanoTime); }
/** * Performs the actual reading of a row out of the StorageService, fetching * a specific set of column names from a given column family. */ public static PartitionIterator read(SinglePartitionReadCommand.Group group, ConsistencyLevel consistencyLevel, ClientState state, long queryStartNanoTime) throws UnavailableException, IsBootstrappingException, ReadFailureException, ReadTimeoutException, InvalidRequestException { if (StorageService.instance.isBootstrapMode() && !systemKeyspaceQuery(group.commands)) { readMetrics.unavailables.mark(); readMetricsMap.get(consistencyLevel).unavailables.mark(); throw new IsBootstrappingException(); } return consistencyLevel.isSerialConsistency() ? readWithPaxos(group, consistencyLevel, state, queryStartNanoTime) : readRegular(group, consistencyLevel, queryStartNanoTime); }
/** * Gets compaction rate limiter. When compaction_throughput_mb_per_sec is 0 or node is bootstrapping, * this returns rate limiter with the rate of Double.MAX_VALUE bytes per second. * Rate unit is bytes per sec. * * @return RateLimiter with rate limit set */ public RateLimiter getRateLimiter() { double currentThroughput = DatabaseDescriptor.getCompactionThroughputMbPerSec() * 1024.0 * 1024.0; // if throughput is set to 0, throttling is disabled if (currentThroughput == 0 || StorageService.instance.isBootstrapMode()) currentThroughput = Double.MAX_VALUE; if (compactionRateLimiter.getRate() != currentThroughput) compactionRateLimiter.setRate(currentThroughput); return compactionRateLimiter; }
public void doVerb(MessageIn<AbstractRangeCommand> message, int id) { try { if (StorageService.instance.isBootstrapMode()) { /* Don't service reads! */ throw new RuntimeException("Cannot service reads while bootstrapping!"); } RangeSliceReply reply = new RangeSliceReply(message.payload.executeLocally()); Tracing.trace("Enqueuing response to {}", message.from); MessagingService.instance().sendReply(reply.createMessage(), id, message.from); } catch (TombstoneOverwhelmingException e) { // error already logged. Drop the request } catch (Exception ex) { throw new RuntimeException(ex); } } }
public void doVerb(MessageIn<ReadCommand> message, int id) { if (StorageService.instance.isBootstrapMode()) { throw new RuntimeException("Cannot service reads while bootstrapping!"); } ReadCommand command = message.payload; Keyspace keyspace = Keyspace.open(command.ksName); Row row; try { row = command.getRow(keyspace); } catch (TombstoneOverwhelmingException e) { // error already logged. Drop the request return; } MessageOut<ReadResponse> reply = new MessageOut<ReadResponse>(MessagingService.Verb.REQUEST_RESPONSE, getResponse(command, row), ReadResponse.serializer); Tracing.trace("Enqueuing response to {}", message.from); MessagingService.instance().sendReply(reply, id, message.from); }
if (StorageService.instance.isBootstrapMode())
if (StorageService.instance.isBootstrapMode())
/** * Performs the actual reading of a row out of the StorageService, fetching * a specific set of column names from a given column family. */ public static List<Row> read(List<ReadCommand> commands, ConsistencyLevel consistencyLevel, ClientState state) throws UnavailableException, IsBootstrappingException, ReadTimeoutException, InvalidRequestException { if (StorageService.instance.isBootstrapMode() && !systemKeyspaceQuery(commands)) { readMetrics.unavailables.mark(); ClientRequestMetrics.readUnavailables.inc(); throw new IsBootstrappingException(); } return consistencyLevel.isSerialConsistency() ? readWithPaxos(commands, consistencyLevel, state) : readRegular(commands, consistencyLevel); }
if (StorageService.instance.isBootstrapMode())
if (StorageService.instance.isBootstrapMode()
if (StorageService.instance.isBootstrapMode()
public void doVerb(MessageIn<ReadCommand> message, int id) { if (StorageService.instance.isBootstrapMode()) { throw new RuntimeException("Cannot service reads while bootstrapping!"); } ReadCommand command = message.payload; command.setMonitoringTime(message.constructionTime, message.isCrossNode(), message.getTimeout(), message.getSlowQueryTimeout()); ReadResponse response; try (ReadExecutionController executionController = command.executionController(); UnfilteredPartitionIterator iterator = command.executeLocally(executionController)) { response = command.createResponse(iterator); } if (!command.complete()) { Tracing.trace("Discarding partial response to {} (timed out)", message.from); MessagingService.instance().incrementDroppedMessages(message, message.getLifetimeInMS()); return; } Tracing.trace("Enqueuing response to {}", message.from); MessageOut<ReadResponse> reply = new MessageOut<>(MessagingService.Verb.REQUEST_RESPONSE, response, serializer()); MessagingService.instance().sendReply(reply, id, message.from); } }
public void doVerb(MessageIn<ReadCommand> message, int id) { if (StorageService.instance.isBootstrapMode()) { throw new RuntimeException("Cannot service reads while bootstrapping!"); } ReadCommand command = message.payload; command.setMonitoringTime(message.constructionTime, message.isCrossNode(), message.getTimeout(), message.getSlowQueryTimeout()); ReadResponse response; try (ReadExecutionController executionController = command.executionController(); UnfilteredPartitionIterator iterator = command.executeLocally(executionController)) { response = command.createResponse(iterator); } if (!command.complete()) { Tracing.trace("Discarding partial response to {} (timed out)", message.from); MessagingService.instance().incrementDroppedMessages(message, message.getLifetimeInMS()); return; } Tracing.trace("Enqueuing response to {}", message.from); MessageOut<ReadResponse> reply = new MessageOut<>(MessagingService.Verb.REQUEST_RESPONSE, response, serializer()); MessagingService.instance().sendReply(reply, id, message.from); } }
public void doVerb(MessageIn<ReadCommand> message, int id) { if (StorageService.instance.isBootstrapMode()) { throw new RuntimeException("Cannot service reads while bootstrapping!"); } ReadCommand command = message.payload; command.setMonitoringTime(message.constructionTime, message.isCrossNode(), message.getTimeout(), message.getSlowQueryTimeout()); ReadResponse response; try (ReadExecutionController executionController = command.executionController(); UnfilteredPartitionIterator iterator = command.executeLocally(executionController)) { response = command.createResponse(iterator); } if (!command.complete()) { Tracing.trace("Discarding partial response to {} (timed out)", message.from); MessagingService.instance().incrementDroppedMessages(message, message.getLifetimeInMS()); return; } Tracing.trace("Enqueuing response to {}", message.from); MessageOut<ReadResponse> reply = new MessageOut<>(MessagingService.Verb.REQUEST_RESPONSE, response, serializer()); MessagingService.instance().sendReply(reply, id, message.from); } }
if (StorageService.instance.isBootstrapMode()