Package voldemort.client.protocol.admin

Examples of voldemort.client.protocol.admin.AdminClient$StoreMaintenanceOperations


            // execute command
            if(!AdminToolUtils.askConfirm(confirm, "mirror stores")) {
                return;
            }

            AdminClient srcAdminClient = AdminToolUtils.getAdminClient(srcUrl);
            AdminClient destAdminClient = AdminToolUtils.getAdminClient(destUrl);

            if(allStores) {
                storeNames = AdminToolUtils.getAllUserStoreNamesOnNode(srcAdminClient, srcNodeId);
            } else {
                AdminToolUtils.validateUserStoreNamesOnNode(srcAdminClient, srcNodeId, storeNames);
View Full Code Here


            // execute command
            if(!AdminToolUtils.askConfirm(confirm, "update entries")) {
                return;
            }

            AdminClient adminClient = AdminToolUtils.getAdminClient(url);
            File inDir = new File(dir);

            if(!inDir.exists()) {
                throw new FileNotFoundException("Input directory " + dir + " doesn't exist");
            }
View Full Code Here

            // execute command
            if(!AdminToolUtils.askConfirm(confirm, "synchronize metadata version"))
                return;

            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            AdminToolUtils.assertServerNotInRebalancingState(adminClient);

            doMetaSyncVersion(adminClient, nodeId);
        }
View Full Code Here

            // load parameters
            url = (String) options.valueOf(AdminParserUtils.OPT_URL);

            // execute command
            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            doMetaCheckVersion(adminClient);
        }
View Full Code Here

            // execute command
            if(!AdminToolUtils.askConfirm(confirm, "backup bdb data natively")) {
                return;
            }
            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            AdminToolUtils.assertServerNotInRebalancingState(adminClient, nodeId);

            System.out.println("Please wait while performing native-backup...");
            adminClient.storeMntOps.nativeBackup(nodeId,
View Full Code Here

            // execute command
            if(!AdminToolUtils.askConfirm(confirm, "restore node from replica")) {
                return;
            }
            AdminClient adminClient = AdminToolUtils.getAdminClient(url);
            AdminToolUtils.assertServerNotInRebalancingState(adminClient, nodeId);

            System.out.println("Starting restore");
            adminClient.restoreOps.restoreDataFromReplications(nodeId, parallel, zoneId);
            System.out.println("Finished restore");
View Full Code Here

                nodeIds = (List<Integer>) options.valuesOf(AdminParserUtils.OPT_NODE);
                allNodes = false;
            }

            // execute command
            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            if(allNodes) {
                nodeIds = AdminToolUtils.getAllNodeIds(adminClient);
            }
View Full Code Here

            // execute command
            if(!AdminToolUtils.askConfirm(confirm, "stop async job")) {
                return;
            }

            AdminClient adminClient = AdminToolUtils.getAdminClient(url);

            doAsyncJobStop(adminClient, nodeId, jobIds);
        }
View Full Code Here

    public void run() throws Exception {

        // Go over every cluster and rollback one store at a time
        for(String clusterUrl: clusterUrls) {

            AdminClient adminClient = null;
            ExecutorService service = null;
            try {
                service = Executors.newCachedThreadPool();
                adminClient = new AdminClient(clusterUrl,
                                              new AdminClientConfig(),
                                              new ClientConfig());
                Cluster cluster = adminClient.getAdminClientCluster();
                AdminStoreSwapper swapper = new AdminStoreSwapper(cluster,
                                                                  service,
                                                                  adminClient,
                                                                  1000 * props.getInt("timeout.seconds",
                                                                                      24 * 60 * 60),
                                                                  true,
                                                                  true);

                // Get the current version for all stores on all nodes
                Map<Integer, Map<String, Long>> previousVersions = Maps.newHashMap();
                for(Node node: cluster.getNodes()) {
                    Map<String, Long> currentVersion = adminClient.readonlyOps.getROCurrentVersion(node.getId(),
                                                                                                   storeNames);

                    log.info("Retrieving current version information on node " + node.getId());
                    Map<String, Long> previousVersion = Maps.newHashMap();
                    for(Entry<String, Long> entry: currentVersion.entrySet()) {
                        previousVersion.put(entry.getKey(), entry.getValue() - 1);
                        if(entry.getValue() == 0) {
                            throw new VoldemortException("Store '" + entry.getKey() + "' on node "
                                                         + node.getId()
                                                         + " does not have version to rollback to");
                        }
                    }
                    previousVersions.put(node.getId(), previousVersion);
                }

                // Swap one store at a time
                for(String storeName: storeNames) {
                    for(Node node: cluster.getNodes()) {
                        log.info("Rolling back data on node " + node.getId() + " and for store "
                                 + storeName + " to version "
                                 + previousVersions.get(node.getId()).get(storeName));
                        swapper.invokeRollback(storeName,
                                               previousVersions.get(node.getId()).get(storeName));
                        log.info("Successfully rolled back data on node " + node.getId()
                                 + " and for store " + storeName);
                    }
                }
            } finally {
                if(service != null) {
                    service.shutdownNow();
                    service.awaitTermination(10, TimeUnit.SECONDS);
                    service = null;
                }
                if(adminClient != null) {
                    adminClient.close();
                    adminClient = null;
                }
            }
        }
    }
View Full Code Here

                                                                        storeXmlFile,
                                                                        props);
            server = ServerTestUtils.startVoldemortServer(socketStoreFactory,
                                                          config,
                                                          currentCluster);
            AdminClient adminClient = ServerTestUtils.getAdminClient(currentCluster);

            // this is just some random admin operation to trigger the loading
            // of the fetcher class when request handler is instantiated
            adminClient.readonlyOps.getROMaxVersionDir(0, new ArrayList<String>());
View Full Code Here

TOP

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

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.