Package voldemort.store.socket.clientrequest

Examples of voldemort.store.socket.clientrequest.ClientRequestExecutorPool


        cluster = ServerTestUtils.getLocalCluster(2);
        stores = ServerTestUtils.getStoreDefs(2);
        bsURL = cluster.getNodes().iterator().next().getSocketUrl().toString();

        for(Node node: cluster.getNodes()) {
            SocketStoreFactory ssf = new ClientRequestExecutorPool(2, 10000, 100000, 1024);
            VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true,
                                                                                node.getId(),
                                                                                TestUtils.createTempDir()
                                                                                         .getAbsolutePath(),
                                                                                cluster,
View Full Code Here


        cluster = ClusterTestUtils.getZZZCluster();
        oldStores = ClusterTestUtils.getZZZStoreDefsInMemory();
        bsURL = cluster.getNodes().iterator().next().getSocketUrl().toString();

        for(Node node: cluster.getNodes()) {
            SocketStoreFactory ssf = new ClientRequestExecutorPool(2, 10000, 100000, 1024);
            VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true,
                                                                                node.getId(),
                                                                                TestUtils.createTempDir()
                                                                                         .getAbsolutePath(),
                                                                                cluster,
View Full Code Here

    @Before
    public void setUp() throws IOException {

        partitionToKeysMap = new HashMap<Integer, Set<String>>();

        SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(2,
                                                                              10000,
                                                                              100000,
                                                                              32 * 1024);

        final int numServers = 2;
View Full Code Here

                                       storeDef.getOwners(),
                                       storeDef.getMemoryFootprintMB());
        storeDefs.set(0, storeDef);
        SocketStoreClientFactory socketStoreClientFactory = new SocketStoreClientFactory(clientConfig);
        for(Integer nodeId: cluster.getNodeIds()) {
            SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(2,
                                                                                  10000,
                                                                                  100000,
                                                                                  1024);
            VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true,
                                                                                nodeId,
View Full Code Here

        cluster = ServerTestUtils.getLocalCluster(2);
        stores = ServerTestUtils.getStoreDefs(2);
        bsURL = cluster.getNodes().iterator().next().getSocketUrl().toString();

        for(Node node: cluster.getNodes()) {
            SocketStoreFactory ssf = new ClientRequestExecutorPool(2, 10000, 100000, 1024);
            VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true,
                                                                                node.getId(),
                                                                                TestUtils.createTempDir()
                                                                                         .getAbsolutePath(),
                                                                                cluster,
View Full Code Here

        cluster = ClusterTestUtils.getZZZCluster();
        oldStores = ClusterTestUtils.getZZZStoreDefsInMemory();
        bsURL = cluster.getNodes().iterator().next().getSocketUrl().toString();

        for(Node node: cluster.getNodes()) {
            SocketStoreFactory ssf = new ClientRequestExecutorPool(2, 10000, 100000, 1024);
            VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true,
                                                                                node.getId(),
                                                                                TestUtils.createTempDir()
                                                                                         .getAbsolutePath(),
                                                                                cluster,
View Full Code Here

        cluster = ServerTestUtils.getLocalCluster(2);
        stores = ServerTestUtils.getStoreDefs(2);
        bsURL = cluster.getNodes().iterator().next().getSocketUrl().toString();

        for(Node node: cluster.getNodes()) {
            SocketStoreFactory ssf = new ClientRequestExecutorPool(2, 10000, 100000, 1024);
            VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true,
                                                                                node.getId(),
                                                                                TestUtils.createTempDir()
                                                                                         .getAbsolutePath(),
                                                                                cluster,
View Full Code Here

     * @throws IOException
     */
    public void startServer(int nodeId) throws IOException {
        if(logger.isInfoEnabled())
            logger.info("Starting server of node [" + nodeId + "]");
        SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(2,
                                                                              10000,
                                                                              100000,
                                                                              1024);
        List<StoreDefinition> stores = new ArrayList<StoreDefinition>();
        stores.add(storeDef);
        // start a voldemort server
        VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true,
                                                                            nodeId,
                                                                            TestUtils.createTempDir()
                                                                                     .getAbsolutePath(),
                                                                            cluster,
                                                                            stores,
                                                                            new Properties());
        config.setNioAdminConnectorSelectors(1);
        config.setNioConnectorSelectors(5);
        config.setSlopFrequencyMs(DEFAULT_SLOP_PUSH_INTERVAL_S * 1000);
        config.setSlopStoreType("memory");
        config.setFailureDetectorAsyncRecoveryInterval(DEFAULT_ASYNC_RECOVERY_INTERVAL_S * 1000);

        VoldemortServer vs = ServerTestUtils.startVoldemortServer(socketStoreFactory, config);
        socketStoreFactory.close();
        voldemortServers.put(nodeId, vs);

        VoldemortService vsrv = vs.getService(ServiceType.STORAGE);
        StoreRepository sr = ((StorageService) vsrv).getStoreRepository();

View Full Code Here

        final ResourcePoolConfig config = new ResourcePoolConfig().setTimeout(50,
                                                                              TimeUnit.MILLISECONDS)
                                                                  .setMaxPoolSize(20);

        ClientRequestExecutorPool clientRequestExecutorPool = new ClientRequestExecutorPool(config.getMaxPoolSize(),
                                                                                            (int) config.getTimeout(TimeUnit.MILLISECONDS),
                                                                                            100,
                                                                                            1000);

        try {
            ResourceFactory<SocketDestination, ClientRequestExecutor> factory = clientRequestExecutorPool.getFactory();
            final AbstractSocketPoolTest<SocketDestination, ClientRequestExecutor> test = new AbstractSocketPoolTest<SocketDestination, ClientRequestExecutor>() {

                @Override
                protected void doSomethingWithResource(SocketDestination key,
                                                       ClientRequestExecutor resource)
                        throws Exception {
                    Thread.sleep(100);
                    int random = (int) (Math.random() * 10);
                    if(random >= 5)
                        resource.close();
                }

                @Override
                protected SocketDestination getRequestKey() throws Exception {
                    return new SocketDestination("localhost", 7666, RequestFormatType.VOLDEMORT_V1);
                }

            };

            // borrow timeout >> doSomething() no timeout expected
            TestStats testStats = test.startTest(factory, config, 50, 200);
            assertEquals("We should see some timeoutRequests", true, testStats.timeoutRequests > 0);
            server.stop();
        } finally {
            clientRequestExecutorPool.close();
        }
    }
View Full Code Here

        String storeDefinitionFile = "test/common/voldemort/config/single-store.xml";
        StoreDefinition storeDefinition = new StoreDefinitionsMapper().readStoreList(new File(storeDefinitionFile))
                                                                      .get(0);

        SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(clientConfig.getSelectors(),
                                                                              clientConfig.getMaxConnectionsPerNode(),
                                                                              clientConfig.getConnectionTimeout(TimeUnit.MILLISECONDS),
                                                                              clientConfig.getSocketTimeout(TimeUnit.MILLISECONDS),
                                                                              clientConfig.getSocketBufferSize(),
                                                                              clientConfig.getSocketKeepAlive());
View Full Code Here

TOP

Related Classes of voldemort.store.socket.clientrequest.ClientRequestExecutorPool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.