Package voldemort.client

Examples of voldemort.client.ClientConfig


        AdminClientConfig config = new AdminClientConfig().setMaxConnectionsPerNode(numConnPerNode)
                                                          .setAdminConnectionTimeoutSec(voldemortConfig.getAdminConnectionTimeout())
                                                          .setAdminSocketTimeoutSec(voldemortConfig.getAdminSocketTimeout())
                                                          .setAdminSocketBufferSize(voldemortConfig.getAdminSocketBufferSize());

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


            String[] bootstrapUrls = new String[1];
            bootstrapUrls[0] = bootstrapURL;

            try {
                if(systemStoreFactory == null) {
                    ClientConfig clientConfig = new ClientConfig();
                    clientConfig.setBootstrapUrls(bootstrapUrls);
                    clientConfig.setClientZoneId(zoneId);
                    systemStoreFactory = new SystemStoreClientFactory<String, String>(clientConfig);
                }
                String metadataVersionStoreName = SystemStoreConstants.SystemStoreName.voldsys$_metadata_version_persistence.name();
                String quotaStoreName = SystemStoreConstants.SystemStoreName.voldsys$_store_quotas.name();
                metadataVersionSysStoreClient = systemStoreFactory.createSystemStore(metadataVersionStoreName,
View Full Code Here

            }

        }

        private Cluster getClusterFromBootstrapURL(String bootstrapURL) {
            ClientConfig config = new ClientConfig();
            // try to bootstrap metadata from bootstrapUrl
            config.setBootstrapUrls(bootstrapURL);
            SocketStoreClientFactory factory = new SocketStoreClientFactory(config);
            // get Cluster from bootStrapUrl
            String clusterXml = factory.bootstrapMetadataWithRetries(MetadataStore.CLUSTER_KEY,
                                                                     factory.validateUrls(config.getBootstrapUrls()));
            // release all threads/sockets hold by the factory.
            factory.close();

            return clusterMapper.readCluster(new StringReader(clusterXml), false);
        }
View Full Code Here

        // Create admin client
        AdminClient client = new AdminClient(cluster,
                                             new AdminClientConfig().setMaxConnectionsPerNode(cluster.getNumberOfNodes())
                                                                    .setAdminConnectionTimeoutSec(httpTimeoutMs / 1000)
                                                                    .setMaxBackoffDelayMs(swapConf.getMaxBackoffDelayMs()),
                                             new ClientConfig());

        if(pushVersion == -1L) {

            // Need to retrieve max version
            ArrayList<String> stores = new ArrayList<String>();
View Full Code Here

            servers[i++] = server;
        }

        socketUrl = servers[0].getIdentityNode().getSocketUrl().toString();

        ClientConfig clientConfig = new ClientConfig().setMaxTotalConnections(4)
                                                      .setMaxConnectionsPerNode(4)
                                                      .setBootstrapUrls(socketUrl);

        SocketStoreClientFactory socketFactory = new SocketStoreClientFactory(clientConfig);
        bootStrapUrls = new String[1];
View Full Code Here

    }

    @Test
    public void testBasicStore() {
        try {
            ClientConfig clientConfig = new ClientConfig();
            clientConfig.setBootstrapUrls(bootStrapUrls).setClientZoneId(this.clientZoneId);
            SystemStoreClientFactory<String, String> systemStoreFactory = new SystemStoreClientFactory<String, String>(clientConfig);
            SystemStoreClient<String, String> sysVersionStore = systemStoreFactory.createSystemStore(SystemStoreConstants.SystemStoreName.voldsys$_metadata_version_persistence.name());

            long storesVersion = 1;
            sysVersionStore.putSysStore("stores.xml", Long.toString(storesVersion));
View Full Code Here

    }

    @Test
    public void testCustomClusterXmlStore() {
        try {
            ClientConfig clientConfig = new ClientConfig();
            clientConfig.setBootstrapUrls(bootStrapUrls).setClientZoneId(this.clientZoneId);
            SystemStoreClientFactory<String, String> systemStoreFactory = new SystemStoreClientFactory<String, String>(clientConfig);
            SystemStoreClient<String, String> sysVersionStore = systemStoreFactory.createSystemStore(SystemStoreConstants.SystemStoreName.voldsys$_metadata_version_persistence.name(),
                                                                                               this.clusterXml,
                                                                                               null);
View Full Code Here

    }

    @Test
    public void testIllegalSystemStore() {
        try {
            ClientConfig clientConfig = new ClientConfig();
            clientConfig.setBootstrapUrls(bootStrapUrls).setClientZoneId(this.clientZoneId);
            SystemStoreClientFactory<String, String> systemStoreFactory = new SystemStoreClientFactory<String, String>(clientConfig);
            SystemStoreClient sysVersionStore = systemStoreFactory.createSystemStore("test-store",
                                                                               this.clusterXml,
                                                                               null);
View Full Code Here

        socketUrl = servers[0].getIdentityNode().getSocketUrl().toString();

        bootStrapUrls = new String[1];
        bootStrapUrls[0] = socketUrl;
        ClientConfig clientConfig = new ClientConfig();
        clientConfig.setBootstrapUrls(bootStrapUrls).setClientZoneId(clientZoneId);
        SystemStoreClientFactory<String, String> systemStoreFactory = new SystemStoreClientFactory<String, String>(clientConfig);
        sysVersionStore = systemStoreFactory.createSystemStore(SystemStoreConstants.SystemStoreName.voldsys$_metadata_version_persistence.name());
        repository = new SystemStoreRepository(clientConfig);

        repository.addSystemStore(sysVersionStore,
View Full Code Here

                               final int nodeIdToMirrorFrom,
                               final String urlToMirrorFrom,
                               List<String> stores) {
            final AdminClient mirrorAdminClient = new AdminClient(urlToMirrorFrom,
                                                                  new AdminClientConfig(),
                                                                  new ClientConfig());
            final AdminClient currentAdminClient = AdminClient.this;

            // determine the partitions residing on the mirror node
            Node mirrorNode = mirrorAdminClient.getAdminClientCluster()
                                               .getNodeById(nodeIdToMirrorFrom);
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.