Examples of ClientConfig


Examples of voldemort.client.ClientConfig

    @Parameterized.Parameters
    public static Collection<Object[]> configs() {
        Cluster z1z3z5cluster = ClusterTestUtils.getZ1Z3Z5ClusterWithNonContiguousNodeIds();
        List<StoreDefinition> z1z3z5StoreDefs = ClusterTestUtils.getZ1Z3Z5322StoreDefs("memory");
        ClientConfig clientConfig = new ClientConfig();
        clientConfig.setClientZoneId(3);
        clientConfig.setBootstrapUrls(z1z3z5cluster.getNodeById(3).getSocketUrl().toString());
        clientConfig.getZoneAffinity().setEnableGetOpZoneAffinity(true);
        Set<Integer> stoppedServersForRemoteZoneNodeFail = new HashSet<Integer>(Arrays.asList(4, 5, 9, 10, 11, 15, 16));
        Set<Integer> stoppedServersForInsufficientZone = new HashSet<Integer>(Arrays.asList(5, 9, 10, 11, 15, 16, 17));
        Cluster zzzCluster = ClusterTestUtils.getZZZCluster();
        List<StoreDefinition> zzzStoreDefs = ClusterTestUtils.getZZZ322StoreDefs("memory");
        ClientConfig zzzClientConfig = new ClientConfig();
        zzzClientConfig.setClientZoneId(0);
        zzzClientConfig.setBootstrapUrls(zzzCluster.getNodeById(0).getSocketUrl().toString());
        zzzClientConfig.getZoneAffinity().setEnableGetOpZoneAffinity(true);
        Set<Integer> zzzstoppedServersForRemoteZoneNodeFail = new HashSet<Integer>(Arrays.asList(1, 2, 3, 4, 5, 6, 7));
        Set<Integer> zzzstoppedServersForInsufficientZone = new HashSet<Integer>(Arrays.asList(2, 3, 4, 5, 6, 7, 8));
        return Arrays.asList(new Object[][] {
                { z1z3z5cluster, z1z3z5StoreDefs, clientConfig,
                        stoppedServersForRemoteZoneNodeFail, stoppedServersForInsufficientZone },
View Full Code Here

Examples of voldemort.client.ClientConfig

                                                                                new Properties());
            VoldemortServer vs = ServerTestUtils.startVoldemortServer(ssf, config, cluster);
            vservers.put(node.getId(), vs);
            socketStoreFactories.put(node.getId(), ssf);
        }
        adminClient = new AdminClient(cluster, new AdminClientConfig(), new ClientConfig());
    }
View Full Code Here

Examples of voldemort.client.ClientConfig

                                                                                new Properties());
            VoldemortServer vs = ServerTestUtils.startVoldemortServer(ssf, config, cluster);
            vservers.put(node.getId(), vs);
            socketStoreFactories.put(node.getId(), ssf);
        }
        adminClient = new AdminClient(cluster, new AdminClientConfig(), new ClientConfig());
    }
View Full Code Here

Examples of voldemort.client.ClientConfig

                                                                                new Properties());
            VoldemortServer vs = ServerTestUtils.startVoldemortServer(ssf, config, cluster);
            vservers.put(node.getId(), vs);
            socketStoreFactories.put(node.getId(), ssf);
        }
        adminClient = new AdminClient(cluster, new AdminClientConfig(), new ClientConfig());
        storeName = stores.iterator().next().getName();
        quotaType = QuotaUtils.validQuotaTypes().iterator().next();
    }
View Full Code Here

Examples of voldemort.client.ClientConfig

                                                                                new Properties());
            VoldemortServer vs = ServerTestUtils.startVoldemortServer(ssf, config, cluster);
            vservers.put(node.getId(), vs);
            socketStoreFactories.put(node.getId(), ssf);
        }
        adminClient = new AdminClient(cluster, new AdminClientConfig(), new ClientConfig());
    }
View Full Code Here

Examples of voldemort.client.ClientConfig

            }
        }

        // setup client factory
        String bootstrapUrl = cluster.getNodeById(0).getSocketUrl().toString();
        factory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));

        // wait for start of servers
        startFinishLatch.countDown();

        try {
View Full Code Here

Examples of voldemort.client.ClientConfig

            } catch(IOException e) {
                logger.error("Server " + nodeId + "failed to start", e);
            }
        }

        factory = new SocketStoreClientFactory(new ClientConfig().setBootstrapUrls(bootstrapUrl));

        // wait for start of servers
        startFinishLatch.countDown();

        try {
View Full Code Here

Examples of voldemort.client.ClientConfig

        System.err.println("num-nodes : " + numNodes);
        System.err.println("num-slow-nodes : " + numSlowNodes);
        System.err.println("delay : " + delay);
        System.err.println("num-clients : " + numClients);

        ClientConfig clientConfig = new ClientConfig().setMaxConnectionsPerNode(maxConnectionsPerNode)
                                                      .setMaxThreads(maxThreads);

        String storeDefinitionFile = "test/common/voldemort/config/single-store.xml";
        StoreDefinition storeDefinition = new StoreDefinitionsMapper().readStoreList(new File(storeDefinitionFile))
                                                                      .get(0);

        SocketStoreFactory socketStoreFactory = new ClientRequestExecutorPool(clientConfig.getSelectors(),
                                                                              clientConfig.getMaxConnectionsPerNode(),
                                                                              clientConfig.getConnectionTimeout(TimeUnit.MILLISECONDS),
                                                                              clientConfig.getSocketTimeout(TimeUnit.MILLISECONDS),
                                                                              clientConfig.getSocketBufferSize(),
                                                                              clientConfig.getSocketKeepAlive());

        VoldemortServer[] servers = new VoldemortServer[numNodes];
        int[][] partitionMap = new int[numNodes][1];
        for(int i = 0; i < numNodes; i++) {
            partitionMap[i][0] = i;
        }
        Cluster cluster = ServerTestUtils.startVoldemortCluster(numNodes,
                                                                servers,
                                                                partitionMap,
                                                                socketStoreFactory,
                                                                true,
                                                                null,
                                                                storeDefinitionFile,
                                                                new Properties());

        Map<Integer, VoldemortServer> serverMap = new HashMap<Integer, VoldemortServer>();
        for(int i = 0; i < cluster.getNumberOfNodes(); i++) {
            serverMap.put(i, servers[i]);
            Store<ByteArray, byte[], byte[]> store = new InMemoryStorageEngine<ByteArray, byte[], byte[]>("test-sleepy");
            if(i < numSlowNodes)
                store = new SleepyStore<ByteArray, byte[], byte[]>(delay, store);
            StoreRepository storeRepository = servers[i].getStoreRepository();
            storeRepository.addLocalStore(store);
        }

        Map<Integer, Store<ByteArray, byte[], byte[]>> stores = new HashMap<Integer, Store<ByteArray, byte[], byte[]>>();
        for(Node node: cluster.getNodes()) {
            Store<ByteArray, byte[], byte[]> socketStore = ServerTestUtils.getSocketStore(socketStoreFactory,
                                                                                          "test-sleepy",
                                                                                          node.getSocketPort(),
                                                                                          clientConfig.getRequestFormatType());
            stores.put(node.getId(), socketStore);
        }

        FailureDetectorConfig failureDetectorConfig = new FailureDetectorConfig().setImplementationClassName(BannagePeriodFailureDetector.class.getName())
                                                                                 .setCluster(cluster)
                                                                                 .setStoreVerifier(MutableStoreVerifier.create(stores));
        FailureDetector failureDetector = FailureDetectorUtils.create(failureDetectorConfig, false);

        ExecutorService routedStoreThreadPool = Executors.newFixedThreadPool(clientConfig.getMaxThreads());
        RoutedStoreFactory routedStoreFactory = new RoutedStoreFactory(routedStoreThreadPool);
        RoutedStoreConfig routedStoreConfig = new RoutedStoreConfig(clientConfig);

        final RoutedStore routedStore = routedStoreFactory.create(cluster,
                                                                  storeDefinition,
View Full Code Here

Examples of voldemort.client.ClientConfig

        if(hostName == null) {
            throw new VoldemortException("Node id " + nodeId + " does not exist");
        } else {
            AdminClient adminClient = new AdminClient(hostName,
                                                      new AdminClientConfig(),
                                                      new ClientConfig());
            return adminClient.getAdminClientCluster();
        }
    }
View Full Code Here

Examples of voldemort.client.ClientConfig

        if(hostName == null) {
            throw new VoldemortException("Node id " + nodeId + " does not exist");
        } else {
            AdminClient adminClient = new AdminClient(hostName,
                                                      new AdminClientConfig(),
                                                      new ClientConfig());
            return adminClient.rebalanceOps.getRemoteServerState(nodeId).getValue();
        }
    }
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.