Search in sources :

Example 11 with StoreRepository

use of voldemort.server.StoreRepository in project voldemort by voldemort.

the class StorageServiceTest method setUp.

@Override
@Before
public void setUp() {
    // this is turned off by default
    config.setEnableServerRouting(true);
    metadataDir = new File(config.getMetadataDirectory());
    metadataDir.mkdir();
    config.setBdbCacheSize(100000);
    this.scheduler = new SchedulerService(1, new MockTime());
    this.storeRepository = new StoreRepository();
    storage = new StorageService(storeRepository, mdStore, scheduler, config);
    storage.start();
}
Also used : SchedulerService(voldemort.common.service.SchedulerService) StoreRepository(voldemort.server.StoreRepository) File(java.io.File) MockTime(voldemort.MockTime) Before(org.junit.Before)

Example 12 with StoreRepository

use of voldemort.server.StoreRepository 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 13 with StoreRepository

use of voldemort.server.StoreRepository 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)

Example 14 with StoreRepository

use of voldemort.server.StoreRepository in project voldemort by voldemort.

the class ClientRequestExecutorPoolTest method startServer.

private void startServer() {
    RequestHandlerFactory handlerFactory = ServerTestUtils.getSocketRequestHandlerFactory(new StoreRepository());
    this.server = ServerTestUtils.getSocketService(useNio, handlerFactory, port, 10, 10 + 3, 10000);
    this.server.start();
}
Also used : RequestHandlerFactory(voldemort.server.protocol.RequestHandlerFactory) StoreRepository(voldemort.server.StoreRepository)

Aggregations

StoreRepository (voldemort.server.StoreRepository)14 InMemoryStorageEngine (voldemort.store.memory.InMemoryStorageEngine)6 ByteArray (voldemort.utils.ByteArray)6 ClientRequestExecutorPool (voldemort.store.socket.clientrequest.ClientRequestExecutorPool)5 Before (org.junit.Before)4 VoldemortConfig (voldemort.server.VoldemortConfig)4 VoldemortServer (voldemort.server.VoldemortServer)4 StoreDefinition (voldemort.store.StoreDefinition)4 File (java.io.File)3 Properties (java.util.Properties)3 MockTime (voldemort.MockTime)3 Cluster (voldemort.cluster.Cluster)3 RequestHandlerFactory (voldemort.server.protocol.RequestHandlerFactory)3 SocketStoreFactory (voldemort.store.socket.SocketStoreFactory)3 StoreDefinitionsMapper (voldemort.xml.StoreDefinitionsMapper)3 StringReader (java.io.StringReader)2 Node (voldemort.cluster.Node)2 SchedulerService (voldemort.common.service.SchedulerService)2 MetadataStore (voldemort.store.metadata.MetadataStore)2 SlopStorageEngine (voldemort.store.slop.SlopStorageEngine)2