Search in sources :

Example 1 with InterceptibleThread

use of org.apache.cassandra.simulator.systems.InterceptibleThread in project cassandra by apache.

the class SimulationRunner method beforeAll.

@BeforeClass
public static void beforeAll() {
    // Disallow time on the bootstrap classloader
    for (CassandraRelevantProperties property : Arrays.asList(CLOCK_GLOBAL, CLOCK_MONOTONIC_APPROX, CLOCK_MONOTONIC_PRECISE)) property.setString("org.apache.cassandra.simulator.systems.SimulatedTime$Throwing");
    // make sure static initializer gets called
    try {
        Clock.Global.nanoTime();
    } catch (IllegalStateException e) {
    }
    // TODO (cleanup): disable unnecessary things like compaction logger threads etc
    System.setProperty("cassandra.libjemalloc", "-");
    System.setProperty("cassandra.dtest.api.log.topology", "false");
    // this property is used to allow non-members of the ring to exist in gossip without breaking RF changes
    // it would be nice not to rely on this, but hopefully we'll have consistent range movements before it matters
    System.setProperty("cassandra.allow_alter_rf_during_range_movement", "true");
    for (CassandraRelevantProperties property : Arrays.asList(CLOCK_GLOBAL, CLOCK_MONOTONIC_APPROX, CLOCK_MONOTONIC_PRECISE)) property.setString("org.apache.cassandra.simulator.systems.SimulatedTime$Global");
    CASSANDRA_JMX_REMOTE_PORT.setString("");
    RING_DELAY.setInt(0);
    PAXOS_REPAIR_RETRY_TIMEOUT_IN_MS.setLong(NANOSECONDS.toMillis(Long.MAX_VALUE));
    SHUTDOWN_ANNOUNCE_DELAY_IN_MS.setInt(0);
    DETERMINISM_UNSAFE_UUID_NODE.setBoolean(true);
    GOSSIPER_SKIP_WAITING_TO_SETTLE.setInt(0);
    BATCH_COMMIT_LOG_SYNC_INTERVAL.setInt(-1);
    DISABLE_SSTABLE_ACTIVITY_TRACKING.setBoolean(false);
    // compression causes variation in file size for e.g. UUIDs, IP addresses, random file paths
    DETERMINISM_SSTABLE_COMPRESSION_DEFAULT.setBoolean(false);
    DETERMINISM_CONSISTENT_DIRECTORY_LISTINGS.setBoolean(true);
    TEST_IGNORE_SIGAR.setBoolean(true);
    SYSTEM_AUTH_DEFAULT_RF.setInt(3);
    MIGRATION_DELAY.setInt(Integer.MAX_VALUE);
    DISABLE_GOSSIP_ENDPOINT_REMOVAL.setBoolean(true);
    MEMTABLE_OVERHEAD_SIZE.setInt(100);
    IGNORE_MISSING_NATIVE_FILE_HINTS.setBoolean(true);
    IS_DISABLED_MBEAN_REGISTRATION.setBoolean(true);
    // load InterceptibleThread class to avoid infinite loop in InterceptorOfGlobalMethods
    if (Thread.currentThread() instanceof InterceptibleThread)
        ;
    new InterceptedWait.CaptureSites(Thread.currentThread(), false).toString(// ensure self reconcile verify can work without infinite looping
    ste -> !ste.getClassName().equals(SelfReconcile.class.getName()));
    InterceptorOfGlobalMethods.Global.unsafeReset();
    ThreadLocalRandom.current();
}
Also used : SelfReconcile(org.apache.cassandra.simulator.debug.SelfReconcile) InterceptibleThread(org.apache.cassandra.simulator.systems.InterceptibleThread) InterceptedWait(org.apache.cassandra.simulator.systems.InterceptedWait) CassandraRelevantProperties(org.apache.cassandra.config.CassandraRelevantProperties) BeforeClass(org.junit.BeforeClass)

Aggregations

CassandraRelevantProperties (org.apache.cassandra.config.CassandraRelevantProperties)1 SelfReconcile (org.apache.cassandra.simulator.debug.SelfReconcile)1 InterceptedWait (org.apache.cassandra.simulator.systems.InterceptedWait)1 InterceptibleThread (org.apache.cassandra.simulator.systems.InterceptibleThread)1 BeforeClass (org.junit.BeforeClass)1