Package voldemort.store.socket.clientrequest

Examples of voldemort.store.socket.clientrequest.ClientRequestExecutorPool


    @Override
    protected Store<ByteArray, byte[], byte[]> getSocketStore(String storeName,
                                                              String host,
                                                              int port,
                                                              boolean isRouted) {
        SocketStoreFactory storeFactory = new ClientRequestExecutorPool(2,
                                                                        60 * 1000,
                                                                        60 * 1000,
                                                                        32 * 1024);
        RequestRoutingType requestRoutingType = RequestRoutingType.getRequestRoutingType(isRouted,
                                                                                         false);
        return storeFactory.create(storeName,
                                   host,
                                   port,
                                   RequestFormatType.PROTOCOL_BUFFERS,
                                   requestRoutingType);
    }
View Full Code Here


    private StoreClient<String, String> dstGloballyResolvingStoreClient;

    @Before
    public void setUpClusters() {
        // setup four nodes with one store and one partition
        final SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(2,
                                                                                    10000,
                                                                                    100000,
                                                                                    32 * 1024);

        try {
View Full Code Here

    @Test
    public void testOnePartitionEndToEndBasedOnVersion() throws Exception {
        long now = System.currentTimeMillis();

        // setup four nodes with one store and one partition
        final SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(2,
                                                                                    10000,
                                                                                    100000,
                                                                                    32 * 1024);
        VoldemortServer[] servers = new VoldemortServer[4];
        int partitionMap[][] = { { 0 }, { 1 }, { 2 }, { 3 } };
View Full Code Here

        storeDef = getStoreDef();

        // create voldemort servers
        for(Integer nodeId = 0; nodeId < NUM_NODES_TOTAL; nodeId++) {
            SocketStoreFactory socketStoreFactory;
            socketStoreFactory = new ClientRequestExecutorPool(2, 10000, 100000, 1024);
            List<StoreDefinition> stores = new ArrayList<StoreDefinition>();
            stores.add(storeDef);
            VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(true,
                                                                                nodeId,
                                                                                TestUtils.createTempDir()
View Full Code Here

        public SocketStoreClientFactoryForTest(String testStoreName, String slopStoreName) {
            this.storeName = testStoreName;
            this.slopStoreName = slopStoreName;
            config = new ClientConfig();
            storeFactory = new ClientRequestExecutorPool(config.getSelectors(),
                                                         config.getMaxConnectionsPerNode(),
                                                         config.getConnectionTimeout(TimeUnit.MILLISECONDS),
                                                         SOCKET_TIMEOUT_MS,
                                                         config.getSocketBufferSize(),
                                                         config.getSocketKeepAlive(),
View Full Code Here

    private List<VoldemortServer> servers;
    private StoreClient<String, String> storeClient;

    @Before
    public void setUp() throws Exception {
        SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(2,
                                                                              10000,
                                                                              100000,
                                                                              32 * 1024);

        int numServers = 2;
View Full Code Here

     *
     * @return bootstrap url
     */
    public static String setUpCluster() {
        // setup four nodes with one store and one partition
        final SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(2,
                                                                                    10000,
                                                                                    100000,
                                                                                    32 * 1024);
        VoldemortServer[] servers = new VoldemortServer[4];
        int partitionMap[][] = { { 0 }, { 1 }, { 2 }, { 3 } };
View Full Code Here

        /** * Do Socket tests ** */
        String storeName = "test";
        StoreRepository repository = new StoreRepository();
        repository.addLocalStore(new InMemoryStorageEngine<ByteArray, byte[], byte[]>(storeName));
        SocketStoreFactory storeFactory = new ClientRequestExecutorPool(10, 1000, 1000, 32 * 1024);
        final Store<ByteArray, byte[], byte[]> socketStore = storeFactory.create(storeName,
                                                                                 "localhost",
                                                                                 6666,
                                                                                 RequestFormatType.VOLDEMORT_V1,
                                                                                 RequestRoutingType.NORMAL);
        RequestHandlerFactory factory = ServerTestUtils.getSocketRequestHandlerFactory(repository);
        AbstractSocketService socketService = ServerTestUtils.getSocketService(useNio,
                                                                               factory,
                                                                               6666,
                                                                               50,
                                                                               50,
                                                                               1000);
        socketService.start();

        PerformanceTest socketWriteTest = new PerformanceTest() {

            @Override
            public void doOperation(int i) {
                byte[] bytes = String.valueOf(i).getBytes();
                ByteArray key = new ByteArray(bytes);
                socketStore.put(key, new Versioned<byte[]>(bytes), null);
            }
        };
        System.out.println("###########################################");
        System.out.println("Performing socket write test.");
        socketWriteTest.run(numRequests, numThreads);
        socketWriteTest.printStats();
        System.out.println();

        PerformanceTest socketReadTest = new PerformanceTest() {

            @Override
            public void doOperation(int i) {
                try {
                    socketStore.get(TestUtils.toByteArray(String.valueOf(i)), null);
                } catch(Exception e) {
                    System.out.println("Failure on i = " + i);
                    e.printStackTrace();
                }
            }
        };
        System.out.println("Performing socket read test.");
        socketReadTest.run(numRequests, 1);
        socketReadTest.printStats();
        System.out.println();
        System.out.println();

        socketStore.close();
        storeFactory.close();
        socketService.stop();

        /** * Do HTTP tests ** */
        repository.addLocalStore(new InMemoryStorageEngine<ByteArray, byte[], byte[]>(storeName));
        HttpService httpService = new HttpService(null,
View Full Code Here

        clientConfig.setBootstrapUrls(cluster.getNodes().iterator().next().getSocketUrl().toString());
        clientConfig.setClientZoneId(clientZoneId);
        setupZoneAffinitySettings();
        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

    @Override
    @Before
    public void setUp() throws Exception {
        super.setUp();
        this.socketPort = ServerTestUtils.findFreePort();
        socketStoreFactory = new ClientRequestExecutorPool(2, 10000, 100000, 32 * 1024);
        socketService = ServerTestUtils.getSocketService(useNio,
                                                         VoldemortTestConstants.getOneNodeClusterXml(),
                                                         VoldemortTestConstants.getSimpleStoreDefinitionsXml(),
                                                         "test",
                                                         socketPort);
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.