Package voldemort.client.protocol.admin

Examples of voldemort.client.protocol.admin.AdminClient


        storeDefs = new StoreDefinitionsMapper().readStoreList(new File(storesXmlfile));

        Properties adminProperties = new Properties();
        adminProperties.setProperty("max_connections", "20");
        adminClient = new AdminClient(cluster,
                                      new AdminClientConfig(adminProperties),
                                      new ClientConfig());

        Node node = cluster.getNodeById(0);
        String bootstrapUrl = "tcp://" + node.getHost() + ":" + node.getSocketPort();
View Full Code Here


    }

    @Test
    public void testUpdateClusterMetadata() {
        Cluster updatedCluster = ServerTestUtils.getLocalCluster(4);
        AdminClient client = getAdminClient();
        for(int i = 0; i < NUM_RUNS; i++) {
            VectorClock clock = ((VectorClock) client.metadataMgmtOps.getRemoteCluster(0)
                                                                     .getVersion()).incremented(0,
                                                                                                System.currentTimeMillis());
            client.metadataMgmtOps.updateRemoteCluster(0, updatedCluster, clock);
View Full Code Here

                originalStoreDefinitionsList.add(def);
            }
        }

        // Update the definitions on all the nodes
        AdminClient adminClient = getAdminClient();
        adminClient.metadataMgmtOps.updateRemoteStoreDefList(storesToBeUpdatedList);

        // Retrieve stores list and check that other definitions are unchanged
        String allStoresDefStr = bootstrapMetadata(MetadataStore.STORES_KEY);
        StoreDefinitionsMapper mapper = new StoreDefinitionsMapper();
View Full Code Here

        doClientOperation();
    }

    @Test
    public void testFetchAndUpdateStoresMetadata() {
        AdminClient client = getAdminClient();
        int nodeId = 0;
        String storeNameToBeUpdated = "users";

        doClientOperation();
View Full Code Here

        doClientOperation();
    }

    @Test
    public void testAddStore() throws Exception {
        AdminClient adminClient = getAdminClient();

        doClientOperation();

        // Try to add a store whose replication factor is greater than the
        // number of nodes
View Full Code Here

        }
    }

    @Test
    public void testDeleteStore() throws Exception {
        AdminClient adminClient = getAdminClient();

        doClientOperation();

        StoreDefinition definition = new StoreDefinitionBuilder().setName("deleteTest")
                                                                 .setType(InMemoryStorageConfiguration.TYPE_NAME)
View Full Code Here

    }

    @Test
    public void testStateTransitions() {
        // change to REBALANCING STATE
        AdminClient client = getAdminClient();
        updateRemoteServerState(client,
                                getVoldemortServer(0).getIdentityNode().getId(),
                                MetadataStore.VoldemortState.REBALANCING_MASTER_SERVER,
                                ((VectorClock) client.rebalanceOps.getRemoteServerState(0)
                                                                  .getVersion()).incremented(0,
View Full Code Here

        // Set some other metadata, so as to pick the right up later
        getServer(0).getMetadataStore().put(MetadataStore.CLUSTER_KEY, targetCluster);

        // Migrate the partition
        AdminClient client = getAdminClient();
        int id = client.storeMntOps.migratePartitions(0,
                                                      1,
                                                      "test-recovery-data",
                                                      combinedLists,
                                                      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)) {
                    Schema keySchema = Schema.parse(storeDef.getKeySerializer()
                                                            .getCurrentSchemaInfo());
                    Schema valueSchema = Schema.parse(storeDef.getValueSerializer()
                                                              .getCurrentSchemaInfo());
                    return new Pair<Schema, Schema>(keySchema, valueSchema);
                }
            }
        } catch(Exception e) {
            System.err.println("Error while getting lastest key schema " + e.getMessage());
        } finally {
            if(adminClient != null) {
                adminClient.close();
            }
        }

        return null;
    }
View Full Code Here

    }

    public void rebalance() {
        assert servers != null && servers.size() > 1;
        VoldemortConfig config = servers.get(0).getVoldemortConfig();
        AdminClient adminClient = AdminClient.createTempAdminClient(config, cluster, 4);
        List<Integer> partitionIds = ImmutableList.of(0, 1);

        int req = adminClient.storeMntOps.migratePartitions(0,
                                                            1,
                                                            STORE_NAME,
View Full Code Here

TOP

Related Classes of voldemort.client.protocol.admin.AdminClient

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.