Search in sources :

Example 11 with SocketDestination

use of voldemort.store.socket.SocketDestination in project voldemort by voldemort.

the class ClientRequestExecutorPoolTest method testNonExistentHost.

@Test
public void testNonExistentHost() throws Exception {
    SocketDestination nonExistentHost = new SocketDestination("unknown.invalid", port, RequestFormatType.VOLDEMORT_V1);
    testConnectionFailure(pool, nonExistentHost, UnresolvedAddressException.class);
}
Also used : SocketDestination(voldemort.store.socket.SocketDestination) Test(org.junit.Test)

Example 12 with SocketDestination

use of voldemort.store.socket.SocketDestination in project voldemort by voldemort.

the class ClientRequestExecutorPoolTest method setUp.

@Before
public void setUp() throws IOException {
    this.port = ServerTestUtils.findFreePort();
    this.pool = new ClientRequestExecutorPool(2, maxConnectionsPerNode, CONNECTION_TIMEOUT_MS, SOCKET_TIMEOUT_MS, IDLE_CONNECTION_TIMEOUT_MS, 32 * 1024, false, true, new String());
    this.dest1 = new SocketDestination("localhost", port, RequestFormatType.VOLDEMORT_V1);
    startServer();
    this.nonRespondingPort = ServerTestUtils.findFreePort();
    this.nonRespondingDest = new SocketDestination("localhost", nonRespondingPort, RequestFormatType.VOLDEMORT_V1);
    this.nonRespondingServer = new NonRespondingSocketService(nonRespondingPort);
    this.nonRespondingServer.start();
}
Also used : NonRespondingSocketService(voldemort.server.niosocket.NonRespondingSocketService) SocketDestination(voldemort.store.socket.SocketDestination) ClientRequestExecutorPool(voldemort.store.socket.clientrequest.ClientRequestExecutorPool) Before(org.junit.Before)

Example 13 with SocketDestination

use of voldemort.store.socket.SocketDestination in project voldemort by voldemort.

the class NioSelectorManagerTest method setUp.

@Before
public void setUp() throws IOException {
    this.port = ServerTestUtils.findFreePort();
    StoreRepository repository = new StoreRepository();
    sleepyStore = new SleepyStore<ByteArray, byte[], byte[]>(Long.MAX_VALUE, new InMemoryStorageEngine<ByteArray, byte[], byte[]>(STORE_NAME));
    repository.addLocalStore(sleepyStore);
    repository.addRoutedStore(sleepyStore);
    this.pool = new ClientRequestExecutorPool(50, 300, 250, 32 * 1024);
    this.dest1 = new SocketDestination("localhost", port, RequestFormatType.VOLDEMORT_V1);
    final Store<ByteArray, byte[], byte[]> socketStore = pool.create(STORE_NAME, "localhost", port, RequestFormatType.VOLDEMORT_V1, RequestRoutingType.NORMAL);
    factory = ServerTestUtils.getSocketRequestHandlerFactory(repository);
    socketService = ServerTestUtils.getSocketService(true, factory, port, numSelectors, 10, 1000, MAX_HEART_BEAT_MS);
    socketService.start();
}
Also used : InMemoryStorageEngine(voldemort.store.memory.InMemoryStorageEngine) SocketDestination(voldemort.store.socket.SocketDestination) ClientRequestExecutorPool(voldemort.store.socket.clientrequest.ClientRequestExecutorPool) ByteArray(voldemort.utils.ByteArray) StoreRepository(voldemort.server.StoreRepository) Before(org.junit.Before)

Example 14 with SocketDestination

use of voldemort.store.socket.SocketDestination in project voldemort by voldemort.

the class SocketPoolTest method setUp.

@Override
@Before
public void setUp() {
    this.port = ServerTestUtils.findFreePort();
    this.pool = new SocketPool(maxConnectionsPerNode, 1000, 1000, 32 * 1024);
    this.dest1 = new SocketDestination("localhost", port, RequestFormatType.VOLDEMORT_V1);
    RequestHandlerFactory handlerFactory = ServerTestUtils.getSocketRequestHandlerFactory(new StoreRepository());
    this.server = ServerTestUtils.getSocketService(useNio, handlerFactory, port, 10, 10 + 3, 10000);
    this.server.start();
}
Also used : SocketPool(voldemort.client.protocol.admin.SocketPool) SocketDestination(voldemort.store.socket.SocketDestination) RequestHandlerFactory(voldemort.server.protocol.RequestHandlerFactory) StoreRepository(voldemort.server.StoreRepository) Before(org.junit.Before)

Aggregations

SocketDestination (voldemort.store.socket.SocketDestination)14 Test (org.junit.Test)5 Before (org.junit.Before)4 Node (voldemort.cluster.Node)4 IOException (java.io.IOException)3 ExecutionException (java.util.concurrent.ExecutionException)3 VoldemortException (voldemort.VoldemortException)3 InsufficientOperationalNodesException (voldemort.store.InsufficientOperationalNodesException)3 ClientRequestExecutorPool (voldemort.store.socket.clientrequest.ClientRequestExecutorPool)3 Pair (voldemort.utils.Pair)3 SocketAndStreams (voldemort.client.protocol.admin.SocketAndStreams)2 AbstractSocketService (voldemort.server.AbstractSocketService)2 StoreRepository (voldemort.server.StoreRepository)2 ClientRequestHandlerFactory (voldemort.server.protocol.ClientRequestHandlerFactory)2 TestStats (voldemort.socketpool.AbstractSocketPoolTest.TestStats)2 ByteArray (voldemort.utils.ByteArray)2 ResourcePoolConfig (voldemort.utils.pool.ResourcePoolConfig)2 DataInputStream (java.io.DataInputStream)1 DataOutputStream (java.io.DataOutputStream)1 ArrayList (java.util.ArrayList)1