Package voldemort.client

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


        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

        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

                                                        STORES_XML,
                                                        props);

        socketUrl = servers[0].getIdentityNode().getSocketUrl().toString();
        String bootstrapUrl = socketUrl;
        ClientConfig clientConfig = new ClientConfig().setBootstrapUrls(bootstrapUrl)
                                                      .setEnableCompressionLayer(false)
                                                      .setEnableSerializationLayer(false)
                                                      .enableDefaultClient(true)
                                                      .setEnableLazy(false);
View Full Code Here

        Node node = cluster.getNodeById(0);
        String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
        AdminClient adminClient = new AdminClient(bootstrapUrl,
                                                  new AdminClientConfig(),
                                                  new ClientConfig());

        byte[] value = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
        byte[] value2 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };

        // make versions
View Full Code Here

                                                                               freePort);
        socketService.start();

        Thread.sleep(1000);

        SocketStoreClientFactory storeClientFactory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls("tcp://localhost:"
                                                                                                                       + freePort)
                                                                                                     .setMaxBootstrapRetries(10));
        StoreClient<String, String> storeClient = storeClientFactory.getStoreClient("test");
        storeClient.put("someKey", "someValue");
        assertEquals(storeClient.getValue("someKey"), "someValue");
View Full Code Here

        private final ClientConfig config;

        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(),
View Full Code Here

        // Start another node for only this unit test
        HashMap<ByteArray, byte[]> entrySet =
                ServerTestUtils.createRandomKeyValuePairs(100);

        SocketStoreClientFactory factory = new SocketStoreClientFactory(new
                                                                        ClientConfig().setBootstrapUrls(Lists.newArrayList("tcp://"
                                                                                                                           + currentCluster.getNodeById(0)
                                                                                                                                           .getHost()
                                                                                                                           + ":"
                                                                                                                           + currentCluster.getNodeById(0)
View Full Code Here

            inputReader = new BufferedReader(new InputStreamReader(System.in));
        } catch(IOException e) {
            Utils.croak("Failure to open input stream: " + e.getMessage());
        }

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

        StoreClientFactory factory = null;
        DefaultStoreClient<Object, Object> client = null;
View Full Code Here

    private static Pair<Schema, Schema> getLatestKeyValueSchema(String url, String storeName) {

        AdminClient adminClient = null;
        try {
            adminClient = new AdminClient(url, new AdminClientConfig(), new ClientConfig());
            List<StoreDefinition> storeDefs = adminClient.metadataMgmtOps.getRemoteStoreDefList()
                                                                         .getValue();

            for(StoreDefinition storeDef: storeDefs) {
                if(storeDef.getName().equals(storeName)) {
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.