Package org.elasticsearch.hadoop.yarn.client

Examples of org.elasticsearch.hadoop.yarn.client.ClientRpc


            throw new IllegalStateException(String.format("Cannot upload %s in HDFS at %s", src.getAbsolutePath(), dst), ex);
        }
    }

    private void start() {
        ClientRpc client = new ClientRpc(getConf());
        ApplicationId id = null;
        ApplicationReport report = null;

        try {
            YarnLauncher launcher = new YarnLauncher(client, cfg);
            id = launcher.run();
            report = client.getReport(id);
        } finally {
            client.close();
        }

        System.out.println(String.format("Launched a %d %s Elasticsearch-YARN cluster [%s@%s] at %tc",
                cfg.containersToAllocate(), (cfg.containersToAllocate() > 1 ? "nodes" : "node"), id, report.getTrackingUrl(), report.getStartTime()));
    }
View Full Code Here


        System.out.println(String.format("Launched a %d %s Elasticsearch-YARN cluster [%s@%s] at %tc",
                cfg.containersToAllocate(), (cfg.containersToAllocate() > 1 ? "nodes" : "node"), id, report.getTrackingUrl(), report.getStartTime()));
    }

    private void stop() {
        ClientRpc client = new ClientRpc(getConf());
        client.start();
        try {
            List<ApplicationReport> esApps = client.listEsClustersAlive();
            for (ApplicationReport report : esApps) {
                System.out.println(String.format("Stopping Elasticsearch-YARN Cluster with id %s", report.getApplicationId()));
            }
            List<ApplicationReport> apps = client.killEsApps();
            for (ApplicationReport report : apps) {
                System.out.println(String.format("Stopped Elasticsearch-YARN cluster with id %s", report.getApplicationId()));
            }
        } finally {
            client.close();
        }
    }
View Full Code Here

            client.close();
        }
    }

    private void status() {
        ClientRpc client = new ClientRpc(getConf());
        client.start();
        List<ApplicationReport> esApps = null;
        try {
            esApps = client.listEsClusters();
        } finally {
            client.close();
        }
        System.out.println(buildStatusReport(esApps));
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.hadoop.yarn.client.ClientRpc

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.