public static boolean isReadyForBootstrap() { return ((ThreadPoolExecutor) StageManager.getStage(Stage.MIGRATION)).getActiveCount() == 0; }
void executeMutation(final Mutation mutation) { CompletableFuture<Void> fut = CompletableFuture.runAsync(new WrappedRunnable() { protected void runMayThrow() { mutateWithCatch(mutation); } }, StageManager.getStage(Stage.TRACING)); boolean ret = pendingFutures.add(fut); if (!ret) logger.warn("Failed to insert pending future, tracing synchronization may not work"); }
void executeMutation(final Mutation mutation) { CompletableFuture<Void> fut = CompletableFuture.runAsync(new WrappedRunnable() { protected void runMayThrow() { mutateWithCatch(mutation); } }, StageManager.getStage(Stage.TRACING)); boolean ret = pendingFutures.add(fut); if (!ret) logger.warn("Failed to insert pending future, tracing synchronization may not work"); }
public void doVerb(final MessageIn<Collection<Mutation>> message, int id) { logger.trace("Received schema mutation push from {}", message.from); StageManager.getStage(Stage.MIGRATION).submit(new WrappedRunnable() { public void runMayThrow() throws ConfigurationException { SchemaKeyspace.mergeSchemaAndAnnounceVersion(message.payload); } }); } }
public void apply(IMutation mutation, Iterable<InetAddress> targets, AbstractWriteResponseHandler<IMutation> responseHandler, String localDataCenter, ConsistencyLevel consistencyLevel) { StageManager.getStage(Stage.COUNTER_MUTATION) .execute(counterWriteTask(mutation, targets, responseHandler, localDataCenter)); } };
public void apply(IMutation mutation, Iterable<InetAddress> targets, AbstractWriteResponseHandler<IMutation> responseHandler, String localDataCenter, ConsistencyLevel consistencyLevel) { StageManager.getStage(Stage.COUNTER_MUTATION) .execute(counterWriteTask(mutation, targets, responseHandler, localDataCenter)); } };
public void doVerb(final MessageIn<Collection<Mutation>> message, int id) { logger.trace("Received schema mutation push from {}", message.from); StageManager.getStage(Stage.MIGRATION).submit(new WrappedRunnable() { public void runMayThrow() throws ConfigurationException { SchemaKeyspace.mergeSchemaAndAnnounceVersion(message.payload); } }); } }
public void doVerb(final MessageIn<Collection<Mutation>> message, int id) { logger.trace("Received schema mutation push from {}", message.from); StageManager.getStage(Stage.MIGRATION).submit(new WrappedRunnable() { public void runMayThrow() throws ConfigurationException { SchemaKeyspace.mergeSchemaAndAnnounceVersion(message.payload); } }); } }
public void doVerb(final MessageIn<Collection<Mutation>> message, int id) { logger.debug("Received schema mutation push from {}", message.from); StageManager.getStage(Stage.MIGRATION).submit(new WrappedRunnable() { public void runMayThrow() throws Exception { DefsTables.mergeSchema(message.payload); } }); } }
public void apply(IMutation mutation, Iterable<InetAddress> targets, AbstractWriteResponseHandler responseHandler, String localDataCenter, ConsistencyLevel consistencyLevel) { StageManager.getStage(Stage.COUNTER_MUTATION) .execute(counterWriteTask(mutation, targets, responseHandler, localDataCenter)); } };
private static Future<Void> submitHint(HintRunnable runnable) { StorageMetrics.totalHintsInProgress.inc(runnable.targets.size()); for (InetAddress target : runnable.targets) getHintsInProgressFor(target).incrementAndGet(); return (Future<Void>) StageManager.getStage(Stage.MUTATION).submit(runnable); }
private static Future<Void> submitHint(HintRunnable runnable) { StorageMetrics.totalHintsInProgress.inc(runnable.targets.size()); for (InetAddress target : runnable.targets) getHintsInProgressFor(target).incrementAndGet(); return (Future<Void>) StageManager.getStage(Stage.MUTATION).submit(runnable); }
private static Future<Void> submitHint(HintRunnable runnable) { StorageMetrics.totalHintsInProgress.inc(runnable.targets.size()); for (InetAddress target : runnable.targets) getHintsInProgressFor(target).incrementAndGet(); return (Future<Void>) StageManager.getStage(Stage.MUTATION).submit(runnable); }
public void response(MessageIn<ReadResponse> message) { repairResolver.preprocess(message); if (received.incrementAndGet() == blockfor) { StageManager.getStage(Stage.READ_REPAIR).execute(new WrappedRunnable() { protected void runMayThrow() { repairResolver.compareResponses(); } }); } }
private static Future<?> submitMigrationTask(InetAddress endpoint) { /* * Do not de-ref the future because that causes distributed deadlock (CASSANDRA-3832) because we are * running in the gossip stage. */ return StageManager.getStage(Stage.MIGRATION).submit(new MigrationTask(endpoint)); }
private static Future<?> submitMigrationTask(InetAddress endpoint) { /* * Do not de-ref the future because that causes distributed deadlock (CASSANDRA-3832) because we are * running in the gossip stage. */ return StageManager.getStage(Stage.MIGRATION).submit(new MigrationTask(endpoint)); }
private static Future<?> submitMigrationTask(InetAddress endpoint) { /* * Do not de-ref the future because that causes distributed deadlock (CASSANDRA-3832) because we are * running in the gossip stage. */ return StageManager.getStage(Stage.MIGRATION).submit(new MigrationTask(endpoint)); }
private static Future<Void> submitHint(HintRunnable runnable) { StorageMetrics.totalHintsInProgress.inc(); getHintsInProgressFor(runnable.target).incrementAndGet(); return (Future<Void>) StageManager.getStage(Stage.MUTATION).submit(runnable); }
public void receive(MessageIn message, int id) { TraceState state = Tracing.instance.initializeFromMessage(message); if (state != null) state.trace("{} message received from {}", message.verb, message.from); // message sinks are a testing hook for (IMessageSink ms : messageSinks) if (!ms.allowIncomingMessage(message, id)) return; Runnable runnable = new MessageDeliveryTask(message, id); LocalAwareExecutorService stage = StageManager.getStage(message.getMessageType()); assert stage != null : "No stage for message type " + message.verb; stage.execute(runnable, ExecutorLocals.create(state)); }
private UnfilteredPartitionIterator executeReadCommand(ReadCommand cmd) { DataResolver resolver = new DataResolver(keyspace, cmd, ConsistencyLevel.ONE, 1, queryStartNanoTime); ReadCallback handler = new ReadCallback(resolver, ConsistencyLevel.ONE, cmd, Collections.singletonList(source), queryStartNanoTime); if (StorageProxy.canDoLocalRequest(source)) StageManager.getStage(Stage.READ).maybeExecuteImmediately(new StorageProxy.LocalReadRunnable(cmd, handler)); else MessagingService.instance().sendRRWithFailure(cmd.createMessage(MessagingService.current_version), source, handler); // We don't call handler.get() because we want to preserve tombstones since we're still in the middle of merging node results. handler.awaitResults(); assert resolver.responses.size() == 1; return resolver.responses.get(0).payload.makeIterator(command); } }