Search in sources :

Example 1 with AllowAllAuthorizer

use of org.apache.cassandra.auth.AllowAllAuthorizer in project cassandra by apache.

the class CQLConnectionTest method setup.

@Before
public void setup() {
    DatabaseDescriptor.toolInitialization();
    DatabaseDescriptor.setAuthenticator(new AllowAllAuthenticator());
    DatabaseDescriptor.setAuthorizer(new AllowAllAuthorizer());
    DatabaseDescriptor.setNetworkAuthorizer(new AllowAllNetworkAuthorizer());
    long seed = new SecureRandom().nextLong();
    logger.info("seed: {}", seed);
    random = new Random(seed);
    address = InetAddress.getLoopbackAddress();
    try {
        try (ServerSocket serverSocket = new ServerSocket(0)) {
            port = serverSocket.getLocalPort();
        }
        Thread.sleep(250);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
    alloc = GlobalBufferPoolAllocator.instance;
    // set connection-local queue size to 0 so that all capacity is allocated from reserves
    DatabaseDescriptor.setNativeTransportReceiveQueueCapacityInBytes(0);
    // set transport to max frame size possible
    DatabaseDescriptor.setNativeTransportMaxFrameSize(256 * (int) ONE_MIB);
}
Also used : SecureRandom(java.security.SecureRandom) AllowAllAuthenticator(org.apache.cassandra.auth.AllowAllAuthenticator) AllowAllNetworkAuthorizer(org.apache.cassandra.auth.AllowAllNetworkAuthorizer) SecureRandom(java.security.SecureRandom) ServerSocket(java.net.ServerSocket) AllowAllAuthorizer(org.apache.cassandra.auth.AllowAllAuthorizer) IOException(java.io.IOException) Before(org.junit.Before)

Example 2 with AllowAllAuthorizer

use of org.apache.cassandra.auth.AllowAllAuthorizer in project cassandra by apache.

the class SimpleClientPerfTest method setup.

@Before
public void setup() {
    DatabaseDescriptor.toolInitialization();
    DatabaseDescriptor.setAuthenticator(new AllowAllAuthenticator());
    DatabaseDescriptor.setAuthorizer(new AllowAllAuthorizer());
    DatabaseDescriptor.setNetworkAuthorizer(new AllowAllNetworkAuthorizer());
    address = InetAddress.getLoopbackAddress();
    try {
        try (ServerSocket serverSocket = new ServerSocket(0)) {
            port = serverSocket.getLocalPort();
        }
        Thread.sleep(250);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : AllowAllAuthenticator(org.apache.cassandra.auth.AllowAllAuthenticator) AllowAllNetworkAuthorizer(org.apache.cassandra.auth.AllowAllNetworkAuthorizer) ServerSocket(java.net.ServerSocket) AllowAllAuthorizer(org.apache.cassandra.auth.AllowAllAuthorizer) OverloadedException(org.apache.cassandra.exceptions.OverloadedException) Before(org.junit.Before)

Example 3 with AllowAllAuthorizer

use of org.apache.cassandra.auth.AllowAllAuthorizer in project cassandra by apache.

the class SimpleClientBurnTest method setup.

@Before
public void setup() {
    DatabaseDescriptor.toolInitialization();
    DatabaseDescriptor.setAuthenticator(new AllowAllAuthenticator());
    DatabaseDescriptor.setAuthorizer(new AllowAllAuthorizer());
    DatabaseDescriptor.setNetworkAuthorizer(new AllowAllNetworkAuthorizer());
    long seed = new SecureRandom().nextLong();
    logger.info("seed: {}", seed);
    address = InetAddress.getLoopbackAddress();
    try {
        try (ServerSocket serverSocket = new ServerSocket(0)) {
            port = serverSocket.getLocalPort();
        }
        Thread.sleep(250);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : AllowAllAuthenticator(org.apache.cassandra.auth.AllowAllAuthenticator) AllowAllNetworkAuthorizer(org.apache.cassandra.auth.AllowAllNetworkAuthorizer) SecureRandom(java.security.SecureRandom) ServerSocket(java.net.ServerSocket) AllowAllAuthorizer(org.apache.cassandra.auth.AllowAllAuthorizer) Before(org.junit.Before)

Aggregations

ServerSocket (java.net.ServerSocket)3 AllowAllAuthenticator (org.apache.cassandra.auth.AllowAllAuthenticator)3 AllowAllAuthorizer (org.apache.cassandra.auth.AllowAllAuthorizer)3 AllowAllNetworkAuthorizer (org.apache.cassandra.auth.AllowAllNetworkAuthorizer)3 Before (org.junit.Before)3 SecureRandom (java.security.SecureRandom)2 IOException (java.io.IOException)1 OverloadedException (org.apache.cassandra.exceptions.OverloadedException)1