Package voldemort.client

Examples of voldemort.client.SocketStoreClientFactory


        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


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

        SocketStoreClientFactory socketFactory = new SocketStoreClientFactory(clientConfig);
        bootStrapUrls = new String[1];
        bootStrapUrls[0] = socketUrl;
        clusterXml = ((AbstractStoreClientFactory) socketFactory).bootstrapMetadataWithRetries(MetadataStore.CLUSTER_KEY);
    }
View Full Code Here

            servers.add(voldemortServer);
        }

        Node node = cluster.getNodeById(0);
        String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
        storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl)
                                                                            .setMaxConnectionsPerNode(connectionsPerNode)
                                                                            .setConnectionTimeout(CONNECTION_TIMEOUT_MS,
                                                                                                  TimeUnit.MILLISECONDS)
                                                                            .setSocketTimeout(SOCKET_TIMEOUT_MS,
                                                                                              TimeUnit.MILLISECONDS)
View Full Code Here

    private synchronized void initializeFatClient(String storeName, Properties storeClientProps) {
        // updates the coordinator metadata with recent stores and cluster xml
        updateCoordinatorMetadataWithLatestState();

        logger.info("Creating a Fat client for store: " + storeName);
        SocketStoreClientFactory fatClientFactory = getFatClientFactory(this.coordinatorConfig.getBootstrapURLs(),
                                                                        storeClientProps);

        if(this.fatClientMap == null) {
            this.fatClientMap = new HashMap<String, DynamicTimeoutStoreClient<ByteArray, byte[]>>();
        }
View Full Code Here

                       .setEnableCompressionLayer(false)
                       .setEnableSerializationLayer(false)
                       .enableDefaultClient(true)
                       .setEnableLazy(false);

        return new SocketStoreClientFactory(fatClientConfig);
    }
View Full Code Here

    @Override
    protected void initialize() {
        // Initialize the Voldemort Metadata
        ClientConfig clientConfig = new ClientConfig();
        clientConfig.setBootstrapUrls(this.coordinatorConfig.getBootstrapURLs());
        storeClientFactory = new SocketStoreClientFactory(clientConfig);
        try {
            initializeAllFatClients();
            // Setup the Async Metadata checker
            SystemStoreRepository sysRepository = new SystemStoreRepository(clientConfig);
            String clusterXml = storeClientFactory.bootstrapMetadataWithRetries(MetadataStore.CLUSTER_KEY);
View Full Code Here

            servers.add(voldemortServer);
        }

        Node node = cluster.getNodeById(0);
        String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
        storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl)
                                                                            .setMaxConnectionsPerNode(CONNECTIONS_PER_NODE)
                                                                            .setConnectionTimeout(CONNECTION_TIMEOUT_MS,
                                                                                                  TimeUnit.MILLISECONDS));
    }
View Full Code Here

        ClientConfig clientConfig = new ClientConfig().setBootstrapUrls(sourceCluster.getNodeById(0)
                                                                                     .getSocketUrl()
                                                                                     .toString())
                                                      .setClientZoneId(DROP_ZONE_ID)
                                                      .setZoneAffinity(zoneAffinity);
        SocketStoreClientFactory factory = new SocketStoreClientFactory(clientConfig);
        StoreClient<String, String> client = factory.getStoreClient(sourceStoreDefs.get(sourceStoreDefs.size() - 1)
                                                                                   .getName());

        // do some operations against the stores from zone 0.
        for(int i = 0; i < 10; i++) {
            try {
View Full Code Here

                                                                STORES_XML,
                                                                new Properties());

        Node node = cluster.getNodeById(0);
        String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
        StoreClientFactory storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));
        storeClient = storeClientFactory.getStoreClient(STORE_NAME);
    }
View Full Code Here

        adminClient = new AdminClient(server.getMetadataStore().getCluster(),
                                      new AdminClientConfig(),
                                      new ClientConfig());
        String bootStrapUrl = "tcp://" + server.getIdentityNode().getHost() + ":"
                              + server.getIdentityNode().getSocketPort();
        factory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootStrapUrl));
        storeClient = factory.getStoreClient("test");
    }
View Full Code Here

TOP

Related Classes of voldemort.client.SocketStoreClientFactory

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.