Examples of ClientConfig


Examples of voldemort.client.ClientConfig

            int parallelism = CmdUtils.valueOf(options, "restore", 5);
            Integer zoneId = CmdUtils.valueOf(options, "zone", -1);

            AdminClient adminClient = new AdminClient(url,
                                                      new AdminClientConfig(),
                                                      new ClientConfig());

            List<String> storeNames = null;
            if(options.has("store") && options.has("stores")) {
                throw new VoldemortException("Must not specify both --stores and --store options");
            } else if(options.has("stores")) {
View Full Code Here

Examples of voldemort.client.ClientConfig

     * @param keySize Size (in bytes) of the key
     * @param valueSize Size (in bytes) of the value
     * @param postfix Postfix to append (for uniqueness)
     */
    public void generateData(int requests, int keySize, int valueSize, String postfix) {
        StoreClientFactory storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(url)
                                                                                               .setMaxThreads(workers));
        StoreClient<String, String> client = storeClientFactory.getStoreClient(storeName);

        for(int i = 0; i < requests; i++) {
            StringBuilder keyBuilder = new StringBuilder(makeString(keySize)).append(i);
View Full Code Here

Examples of voldemort.client.ClientConfig

                keyCount++;
            }

            srcAdminClient = new AdminClient(srcCluster,
                                             new AdminClientConfig(),
                                             new ClientConfig());

            List<StoreDefinition> storeDefs = new StoreDefinitionsMapper().readStoreList(new File(STORES_XML));

            primaryResolvingStoreDef = StoreUtils.getStoreDef(storeDefs,
                                                              PRIMARY_RESOLVING_STORE_NAME);
            globallyResolvingStoreDef = StoreUtils.getStoreDef(storeDefs,
                                                               GLOBALLY_RESOLVING_STORE_NAME);

            nonResolvingStoreDef = StoreUtils.getStoreDef(storeDefs, MULTIPLE_VERSIONS_STORE_NAME);

            srcfactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(srcBootStrapUrl)
                                                                        .setSelectors(1)
                                                                        .setRoutingTimeout(1000,
                                                                                           java.util.concurrent.TimeUnit.MILLISECONDS)
                                                                        .setSocketTimeout(1000,
                                                                                          java.util.concurrent.TimeUnit.MILLISECONDS)
                                                                        .setConnectionTimeout(1000,
                                                                                              java.util.concurrent.TimeUnit.MILLISECONDS)
                                                                        .setMaxConnectionsPerNode(1));
            srcPrimaryResolvingStoreClient = srcfactory.getStoreClient(PRIMARY_RESOLVING_STORE_NAME);
            srcGloballyResolvingStoreClient = srcfactory.getStoreClient(GLOBALLY_RESOLVING_STORE_NAME);

            dstfactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(dstBootStrapUrl)
                                                                        .setSelectors(1)
                                                                        .setRoutingTimeout(1000,
                                                                                           java.util.concurrent.TimeUnit.MILLISECONDS)
                                                                        .setSocketTimeout(1000,
                                                                                          java.util.concurrent.TimeUnit.MILLISECONDS)
View Full Code Here

Examples of voldemort.client.ClientConfig

                                                                   ClusterForkLiftTool.ForkLiftTaskMode.no_resolution);
        forkLiftTool.run();

        AdminClient dstAdminClient = new AdminClient(dstBootStrapUrl,
                                                     new AdminClientConfig(),
                                                     new ClientConfig());

        for(Node node: dstAdminClient.getAdminClientCluster().getNodes()) {

            Iterator<Pair<ByteArray, Versioned<byte[]>>> entryItr = dstAdminClient.bulkFetchOps.fetchEntries(node.getId(),
                                                                                                             MULTIPLE_VERSIONS_STORE_NAME,
View Full Code Here

Examples of voldemort.client.ClientConfig

        String url = rest.get(0);
        String storeName = rest.get(1);
        Integer connsTotal = CmdUtils.valueOf(options, CONNECTIONS, 100);
        Integer reqs = CmdUtils.valueOf(options, REQS, 1000);

        ClientConfig config = new ClientConfig();
        if(options.has(CONNECTION_TIMEOUT))
            config.setConnectionTimeout((Integer) options.valueOf(CONNECTION_TIMEOUT),
                                        TimeUnit.MILLISECONDS);
        if(options.has(ROUTING_TIMEOUT))
            config.setTimeoutConfig(new TimeoutConfig(TimeUnit.MILLISECONDS.toMillis((Integer) options.valueOf(ROUTING_TIMEOUT)),
                                                      false));

        if(options.has(SOCKET_TIMEOUT))
            config.setSocketTimeout((Integer) options.valueOf(SOCKET_TIMEOUT),
                                    TimeUnit.MILLISECONDS);
        if(options.has(MAX_CONNECTIONS))
            config.setMaxConnectionsPerNode((Integer) options.valueOf(MAX_CONNECTIONS));
        if(options.has(MAX_THREADS))
            config.setMaxThreads((Integer) options.valueOf(MAX_THREADS));
        if(options.has(SELECTORS))
            config.setSelectors((Integer) options.valueOf(SELECTORS));
        if(options.has(SOCKET_BUFFER_SIZE))
            config.setSocketBufferSize((Integer) options.valueOf(SOCKET_BUFFER_SIZE));
        config.setBootstrapUrls(url);

        ClientConnectionStressTest test = new ClientConnectionStressTest(config,
                                                                         storeName,
                                                                         config.getMaxThreads(),
                                                                         connsTotal,
                                                                         reqs);
        test.execute();
    }
View Full Code Here

Examples of voldemort.client.ClientConfig

            Utils.croak("USAGE: java VoldemortClientShell store_name bootstrap_url [command_file]");

        String storeName = args[0];
        String bootstrapUrl = args[1];

        StoreClientFactory factory = new SocketStoreClientFactory(new ClientConfig().setEnableLazy(false)
                                                                                    .setBootstrapUrls(bootstrapUrl));
        DefaultStoreClient<Object, Object> client = null;
        try {
            client = (DefaultStoreClient<Object, Object>) factory.getStoreClient(storeName);
        } catch(Exception e) {
View Full Code Here

Examples of voldemort.client.ClientConfig

        String bootstrapUrl = clientConfig.getBootstrapUrls()[0];

        try {
            factory = new SocketStoreClientFactory(clientConfig);
            client = factory.getStoreClient(storeName);
            adminClient = new AdminClient(bootstrapUrl, new AdminClientConfig(), new ClientConfig());

            storeDef = StoreUtils.getStoreDef(factory.getStoreDefs(), storeName);

            commandOutput.println("Established connection to " + storeName + " via " + bootstrapUrl);
            commandOutput.print(PROMPT);
View Full Code Here

Examples of voldemort.client.ClientConfig

            }
        } catch(IOException e) {
            Utils.croak("Failure to open input stream: " + e.getMessage());
        }

        ClientConfig clientConfig = new ClientConfig().setBootstrapUrls(bootstrapUrl)
                                                      .setEnableLazy(false)
                                                      .setRequestFormatType(RequestFormatType.VOLDEMORT_V3);

        if(options.has("client-zone-id")) {
            clientConfig.setClientZoneId((Integer) options.valueOf("client-zone-id"));
        }

        VoldemortClientShell shell = new VoldemortClientShell(clientConfig,
                                                              storeName,
                                                              inputReader,
View Full Code Here

Examples of voldemort.client.ClientConfig

        System.out.println("==============String store example=================");

        // In production environment, the StoreClient instantiation should be done using factory pattern
        // through a Framework such as Spring
        String bootstrapUrl = "tcp://localhost:6666";
        StoreClientFactory factory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));

        StoreClient<String, String> client = factory.getStoreClient("test");

        // put initial value
        System.out.println("Putting an initial value");
View Full Code Here

Examples of voldemort.client.ClientConfig

        System.out.println("==============Avro store example=================");
        // In production environment, the StoreClient instantiation should be done using factory pattern
        // through a Framework such as Spring
        String bootstrapUrl = "tcp://localhost:6666";
        StoreClientFactory factory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));

        StoreClient<GenericRecord, GenericRecord> client = factory.getStoreClient("avro-example");


        // creating initial k-v pair
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.