Examples of AdminClient


Examples of voldemort.client.protocol.admin.AdminClient

                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

Examples of voldemort.client.protocol.admin.AdminClient

        doClientOperation();
    }

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

        doClientOperation();
View Full Code Here

Examples of voldemort.client.protocol.admin.AdminClient

        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

Examples of voldemort.client.protocol.admin.AdminClient

        }
    }

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

        doClientOperation();

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

Examples of voldemort.client.protocol.admin.AdminClient

    }

    @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

Examples of voldemort.client.protocol.admin.AdminClient

        // 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

Examples of voldemort.client.protocol.admin.AdminClient

        }
    }

    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

Examples of voldemort.client.protocol.admin.AdminClient

    }

    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

Examples of voldemort.client.protocol.admin.AdminClient

             * is added. Present gossip doesn't support more advanced sort of
             * reconcilation.
             */
            for(String hostname: newHostnames) {
                int nodeId = nodeIds.get(hostname);
                AdminClient adminClient = new AdminClient("tcp://" + hostname + ":6666",
                                                          new AdminClientConfig(),
                                                          new ClientConfig());

                Versioned<String> versioned = adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
                                                                                            MetadataStore.CLUSTER_KEY);
                Version version = versioned.getVersion();

                VectorClock vectorClock = (VectorClock) version;
                vectorClock.incrementVersion(nodeId, System.currentTimeMillis());

                try {
                    adminClient.metadataMgmtOps.updateRemoteMetadata(peerNodeId,
                                                                     MetadataStore.CLUSTER_KEY,
                                                                     versioned);
                    adminClient.metadataMgmtOps.updateRemoteMetadata(nodeId,
                                                                     MetadataStore.CLUSTER_KEY,
                                                                     versioned);
                } catch(VoldemortException e) {
                    logger.error(e);
                }
            }

            /**
             * Finally, verify that all of the nodes have been discovered
             */
            assertWithBackoff(1000, 60000, new Attempt() {

                private int count = 1;
                private AdminClient adminClient = new AdminClient("tcp://" + hostNames.get(0)
                                                                          + ":6666",
                                                                  new AdminClientConfig(),
                                                                  new ClientConfig());

                public void checkCondition() throws Exception, AssertionError {
View Full Code Here

Examples of voldemort.client.protocol.admin.AdminClient

                                                            serverProperties,
                                                            "test/common/voldemort/config/single-store.xml");

            Properties adminProperties = new Properties();
            adminProperties.setProperty("max_connections", "2");
            adminClient = new AdminClient(servers[0].getMetadataStore().getCluster(),
                                          new AdminClientConfig(adminProperties),
                                          new ClientConfig());
        } catch(Exception e) {
            logger.error("Error in setup", e);
            throw e;
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.