Package voldemort.store.metadata.MetadataStore

Examples of voldemort.store.metadata.MetadataStore.VoldemortState


                            } else {
                                System.out.println("New metadata has not been set");
                            }
                        }
                    } else if(metadataKey.compareTo(MetadataStore.SERVER_STATE_KEY) == 0) {
                        VoldemortState newState = VoldemortState.valueOf(metadataValue);
                        executeSetMetadata(nodeId,
                                           adminClient,
                                           MetadataStore.SERVER_STATE_KEY,
                                           newState.toString());
                    } else if(metadataKey.compareTo(MetadataStore.STORES_KEY) == 0) {
                        if(!Utils.isReadableFile(metadataValue))
                            throw new VoldemortException("Stores definition xml file path incorrect");
                        StoreDefinitionsMapper mapper = new StoreDefinitionsMapper();
                        List<StoreDefinition> newStoreDefs = mapper.readStoreList(new File(metadataValue));
View Full Code Here


                        if(key.compareTo(MetadataStore.CLUSTER_KEY) == 0
                           || key.compareTo(MetadataStore.REBALANCING_SOURCE_CLUSTER_XML) == 0) {
                            Cluster cluster = new ClusterMapper().readCluster(new StringReader(versioned.getValue()));
                            addMetadataValue(metadataNodeValueMap, cluster, nodeName);
                        } else if(key.compareTo(MetadataStore.SERVER_STATE_KEY) == 0) {
                            VoldemortState voldemortStateValue = VoldemortState.valueOf(versioned.getValue());
                            addMetadataValue(metadataNodeValueMap, voldemortStateValue, nodeName);
                        } else {
                            throw new VoldemortException("Incorrect metadata key");
                        }
View Full Code Here

                if(metadataKey.compareTo(MetadataStore.CLUSTER_KEY) == 0
                   || metadataKey.compareTo(MetadataStore.REBALANCING_SOURCE_CLUSTER_XML) == 0) {
                    Cluster cluster = new ClusterMapper().readCluster(new StringReader(versioned.getValue()));
                    addMetadataValue(metadataNodeValueMap, cluster, nodeName);
                } else if(metadataKey.compareTo(MetadataStore.SERVER_STATE_KEY) == 0) {
                    VoldemortState voldemortStateValue = VoldemortState.valueOf(versioned.getValue());
                    addMetadataValue(metadataNodeValueMap, voldemortStateValue, nodeName);
                } else {
                    throw new VoldemortException("Incorrect metadata key");
                }
View Full Code Here

    public static void assertServerInNormalState(AdminClient adminClient,
                                                 Collection<Integer> nodeIds) {
        for(Integer nodeId: nodeIds) {
            Versioned<String> versioned = adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
                                                                                        MetadataStore.SERVER_STATE_KEY);
            VoldemortState state = VoldemortState.valueOf(versioned.getValue());
            if(!state.equals(VoldemortState.NORMAL_SERVER)) {
                throw new VoldemortException("Cannot execute admin operation: "
                                             + nodeId
                                             + " ("
                                             + adminClient.getAdminClientCluster()
                                                          .getNodeById(nodeId)
View Full Code Here

    public static void assertServerNotInOfflineState(AdminClient adminClient,
                                                     Collection<Integer> nodeIds) {
        for(Integer nodeId: nodeIds) {
            Versioned<String> versioned = adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
                                                                                        MetadataStore.SERVER_STATE_KEY);
            VoldemortState state = VoldemortState.valueOf(versioned.getValue());
            if(state.equals(VoldemortState.OFFLINE_SERVER)) {
                throw new VoldemortException("Cannot execute admin operation: "
                                             + nodeId
                                             + " ("
                                             + adminClient.getAdminClientCluster()
                                                          .getNodeById(nodeId)
View Full Code Here

    public static void assertServerNotInRebalancingState(AdminClient adminClient,
                                                         Collection<Integer> nodeIds) {
        for(Integer nodeId: nodeIds) {
            Versioned<String> versioned = adminClient.metadataMgmtOps.getRemoteMetadata(nodeId,
                                                                                        MetadataStore.SERVER_STATE_KEY);
            VoldemortState state = VoldemortState.valueOf(versioned.getValue());
            if(state.equals(VoldemortState.REBALANCING_MASTER_SERVER)) {
                throw new VoldemortException("Cannot execute admin operation: "
                                             + nodeId
                                             + " ("
                                             + adminClient.getAdminClientCluster()
                                                          .getNodeById(nodeId)
View Full Code Here

TOP

Related Classes of voldemort.store.metadata.MetadataStore.VoldemortState

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.