Search in sources :

Example 1 with Stage

use of org.apache.cassandra.concurrent.Stage in project cassandra by apache.

the class Gossiper method markAlive.

private void markAlive(final InetAddressAndPort addr, final EndpointState localState) {
    localState.markDead();
    Message<NoPayload> echoMessage = Message.out(ECHO_REQ, noPayload);
    logger.trace("Sending ECHO_REQ to {}", addr);
    RequestCallback echoHandler = msg -> {
        // force processing of the echo response onto the gossip stage, as it comes in on the REQUEST_RESPONSE stage
        runInGossipStageBlocking(() -> realMarkAlive(addr, localState));
    };
    MessagingService.instance().sendWithCallback(echoMessage, addr, echoHandler);
    GossiperDiagnostics.markedAlive(this, addr, localState);
}
Also used : ScheduledFuture(java.util.concurrent.ScheduledFuture) Stage(org.apache.cassandra.concurrent.Stage) LoggerFactory(org.slf4j.LoggerFactory) TimeoutException(java.util.concurrent.TimeoutException) Global.nanoTime(org.apache.cassandra.utils.Clock.Global.nanoTime) BooleanSupplier(java.util.function.BooleanSupplier) GOSSIP_DIGEST_SYN(org.apache.cassandra.net.Verb.GOSSIP_DIGEST_SYN) FBUtilities.getBroadcastAddressAndPort(org.apache.cassandra.utils.FBUtilities.getBroadcastAddressAndPort) Pair(org.apache.cassandra.utils.Pair) NoPayload(org.apache.cassandra.net.NoPayload) CassandraVersion(org.apache.cassandra.utils.CassandraVersion) DatabaseDescriptor(org.apache.cassandra.config.DatabaseDescriptor) DatabaseDescriptor.getClusterName(org.apache.cassandra.config.DatabaseDescriptor.getClusterName) ImmutableSet(com.google.common.collect.ImmutableSet) FBUtilities(org.apache.cassandra.utils.FBUtilities) RecomputingSupplier(org.apache.cassandra.utils.RecomputingSupplier) ImmutableMap(com.google.common.collect.ImmutableMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) NotScheduledFuture(org.apache.cassandra.utils.concurrent.NotScheduledFuture) Verb(org.apache.cassandra.net.Verb) NoSpamLogger(org.apache.cassandra.utils.NoSpamLogger) RequestCallback(org.apache.cassandra.net.RequestCallback) DISABLE_GOSSIP_ENDPOINT_REMOVAL(org.apache.cassandra.config.CassandraRelevantProperties.DISABLE_GOSSIP_ENDPOINT_REMOVAL) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) DatabaseDescriptor.getPartitionerName(org.apache.cassandra.config.DatabaseDescriptor.getPartitionerName) UncheckedInterruptedException(org.apache.cassandra.utils.concurrent.UncheckedInterruptedException) Entry(java.util.Map.Entry) org.apache.cassandra.concurrent(org.apache.cassandra.concurrent) NoPayload.noPayload(org.apache.cassandra.net.NoPayload.noPayload) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) InetAddressAndPort(org.apache.cassandra.locator.InetAddressAndPort) java.util(java.util) Iterables(com.google.common.collect.Iterables) Global.currentTimeMillis(org.apache.cassandra.utils.Clock.Global.currentTimeMillis) Message(org.apache.cassandra.net.Message) Supplier(java.util.function.Supplier) SystemKeyspace(org.apache.cassandra.db.SystemKeyspace) ConcurrentMap(java.util.concurrent.ConcurrentMap) Token(org.apache.cassandra.dht.Token) ImmutableList(com.google.common.collect.ImmutableList) JVMStabilityInspector(org.apache.cassandra.utils.JVMStabilityInspector) Nullable(javax.annotation.Nullable) MessagingService(org.apache.cassandra.net.MessagingService) Uninterruptibles(com.google.common.util.concurrent.Uninterruptibles) Logger(org.slf4j.Logger) ReentrantLock(java.util.concurrent.locks.ReentrantLock) GOSSIPER_QUARANTINE_DELAY(org.apache.cassandra.config.CassandraRelevantProperties.GOSSIPER_QUARANTINE_DELAY) Throwables(com.google.common.base.Throwables) StorageService(org.apache.cassandra.service.StorageService) UnknownHostException(java.net.UnknownHostException) GOSSIPER_SKIP_WAITING_TO_SETTLE(org.apache.cassandra.config.CassandraRelevantProperties.GOSSIPER_SKIP_WAITING_TO_SETTLE) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) ExpiringMemoizingSupplier(org.apache.cassandra.utils.ExpiringMemoizingSupplier) ECHO_REQ(org.apache.cassandra.net.Verb.ECHO_REQ) ConcurrentSkipListSet(java.util.concurrent.ConcurrentSkipListSet) FutureTask(org.apache.cassandra.concurrent.FutureTask) MBeanWrapper(org.apache.cassandra.utils.MBeanWrapper) Global.executorFactory(org.apache.cassandra.concurrent.ExecutorFactory.Global.executorFactory) SHUTDOWN_ANNOUNCE_DELAY_IN_MS(org.apache.cassandra.config.CassandraRelevantProperties.SHUTDOWN_ANNOUNCE_DELAY_IN_MS) VisibleForTesting(com.google.common.annotations.VisibleForTesting) ExecutorUtils(org.apache.cassandra.utils.ExecutorUtils) RequestCallback(org.apache.cassandra.net.RequestCallback) NoPayload(org.apache.cassandra.net.NoPayload)

Aggregations

VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 Throwables (com.google.common.base.Throwables)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Iterables (com.google.common.collect.Iterables)1 Sets (com.google.common.collect.Sets)1 Uninterruptibles (com.google.common.util.concurrent.Uninterruptibles)1 UnknownHostException (java.net.UnknownHostException)1 java.util (java.util)1 Entry (java.util.Map.Entry)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 ConcurrentMap (java.util.concurrent.ConcurrentMap)1 ConcurrentSkipListSet (java.util.concurrent.ConcurrentSkipListSet)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 ExecutionException (java.util.concurrent.ExecutionException)1 ScheduledFuture (java.util.concurrent.ScheduledFuture)1 TimeUnit (java.util.concurrent.TimeUnit)1 TimeoutException (java.util.concurrent.TimeoutException)1 ReentrantLock (java.util.concurrent.locks.ReentrantLock)1