Package voldemort.client

Examples of voldemort.client.ClientConfig


        for(int i = 0; i < numServers; ++i) {
            servers.add(voldemortServers[i]);
        }

        String bootstrapUrl = cluster.getNodeById(0).getSocketUrl().toString();
        storeClient = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl)).getStoreClient(STORE_NAME);

        Map<String, String> entries = Maps.newHashMap();
        entries.put("a", "1");
        entries.put("b", "2");
        for(Map.Entry<String, String> entry: entries.entrySet())
View Full Code Here


                thread.setName("stress-test");
                return thread;
            }
        });
        try {
            final SocketStoreClientFactory factory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(url)
                                                                                                    .setEnableLazy(false)
                                                                                                    .setConnectionTimeout(timeoutSecs,
                                                                                                                          TimeUnit.SECONDS)
                                                                                                    .setSocketTimeout(timeoutSecs,
                                                                                                                      TimeUnit.SECONDS)
View Full Code Here

    public void setUp() throws Exception {
        deploy(hostNames, ec2FailureDetectorTestConfig);
        startClusterAsync(hostNames, ec2FailureDetectorTestConfig, nodeIds);

        String url = "tcp://" + getRandomHostName() + ":6666";
        StoreClientFactory scf = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(url));

        failureDetector = scf.getFailureDetector();
        store = scf.getStoreClient("test");
    }
View Full Code Here

             */
            for(String hostname: newHostnames) {
                int nodeId = nodeIds.get(hostname);
                AdminClient adminClient = new AdminClient("tcp://" + hostname + ":6666",
                                                          new AdminClientConfig(),
                                                          new ClientConfig());

                Versioned<String> versioned = adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
                                                                                            MetadataStore.CLUSTER_KEY);
                Version version = versioned.getVersion();

                VectorClock vectorClock = (VectorClock) version;
                vectorClock.incrementVersion(nodeId, System.currentTimeMillis());

                try {
                    adminClient.metadataMgmtOps.updateRemoteMetadata(peerNodeId,
                                                                     MetadataStore.CLUSTER_KEY,
                                                                     versioned);
                    adminClient.metadataMgmtOps.updateRemoteMetadata(nodeId,
                                                                     MetadataStore.CLUSTER_KEY,
                                                                     versioned);
                } catch(VoldemortException e) {
                    logger.error(e);
                }
            }

            /**
             * Finally, verify that all of the nodes have been discovered
             */
            assertWithBackoff(1000, 60000, new Attempt() {

                private int count = 1;
                private AdminClient adminClient = new AdminClient("tcp://" + hostNames.get(0)
                                                                          + ":6666",
                                                                  new AdminClientConfig(),
                                                                  new ClientConfig());

                public void checkCondition() throws Exception, AssertionError {
                    logger.info("Attempt " + count++);

                    for(int testNodeId: oldNodeIdSet) {
View Full Code Here

        byte[] v1_bytes = { (byte) 'V', (byte) '1' };
        byte[] v2_bytes = { (byte) 'V', (byte) '2' };
        byte[] k1_bytes = { (byte) 'K', (byte) '1' };
        byte[] k2_bytes = { (byte) 'K', (byte) '2' };
        byte[] k3_bytes = { (byte) 'K', (byte) '3' };
        clientConfig = new ClientConfig();
        clientConfig.setBootstrapUrls(cluster.getNodes().iterator().next().getSocketUrl().toString());
        clientConfig.setClientZoneId(clientZoneId);
        setupZoneAffinitySettings();
        SocketStoreClientFactory socketStoreClientFactory = new SocketStoreClientFactory(clientConfig);
        for(Integer nodeId: cluster.getNodeIds()) {
View Full Code Here

            Properties adminProperties = new Properties();
            adminProperties.setProperty("max_connections", "2");
            adminClient = new AdminClient(servers[0].getMetadataStore().getCluster(),
                                          new AdminClientConfig(adminProperties),
                                          new ClientConfig());
        } catch(Exception e) {
            logger.error("Error in setup", e);
            throw e;
        }
    }
View Full Code Here

        conflict5 = getVersioned(0, 0, 0, 0, 0, 1, 1, 1, 1, 1);
        conflict6 = getVersioned(0, 0, 0, 0, 0, 0, 1, 1, 1, 1);

        Node node = cluster.getNodes().iterator().next();
        String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
        StoreClientFactory storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));

        defaultStoreClient = storeClientFactory.getStoreClient("test");
        socketStore = ServerTestUtils.getSocketStore(socketStoreFactory,
                                                     "test",
                                                     node.getSocketPort(),
View Full Code Here

    }

    public static AdminClient getAdminClient(Cluster cluster) {

        AdminClientConfig config = new AdminClientConfig();
        return new AdminClient(cluster, config, new ClientConfig());
    }
View Full Code Here

        return new AdminClient(cluster, config, new ClientConfig());
    }

    public static AdminClient getAdminClient(String bootstrapURL) {
        AdminClientConfig config = new AdminClientConfig();
        return new AdminClient(bootstrapURL, config, new ClientConfig());
    }
View Full Code Here

                               List<Integer> partitions,
                               ForkLiftTaskMode mode) {
        // set up AdminClient on source cluster
        this.srcAdminClient = new AdminClient(srcBootstrapUrl,
                                              new AdminClientConfig(),
                                              new ClientConfig());

        // set up streaming client to the destination cluster
        Props props = new Props();
        props.put("streaming.platform.bootstrapURL", dstBootstrapUrl);
        props.put("streaming.platform.throttle.qps", maxPutsPerSecond);
View Full Code Here

TOP

Related Classes of voldemort.client.ClientConfig

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.