Search in sources :

Example 1 with RemoveAllKeysTask

use of water.util.RemoveAllKeysTask in project h2o-2 by h2oai.

the class Cookbook method removeAllKeys.

@Before
public void removeAllKeys() {
    Log.info("Removing all keys...");
    RemoveAllKeysTask collector = new RemoveAllKeysTask();
    collector.invokeOnAllNodes();
    Log.info("Removed all keys.");
}
Also used : RemoveAllKeysTask(water.util.RemoveAllKeysTask)

Example 2 with RemoveAllKeysTask

use of water.util.RemoveAllKeysTask in project h2o-2 by h2oai.

the class RemoveAll method serve.

@Override
protected Response serve() {
    try {
        Log.info("Removing all keys for the cluster");
        // First cancel all jobs and wait for them to be done.
        Log.info("Cancelling all jobs...");
        for (Job job : Job.all()) {
            job.cancel();
            Job.waitUntilJobEnded(job.self());
        }
        Log.info("Finished cancelling all jobs");
        RemoveAllKeysTask collector = new RemoveAllKeysTask();
        collector.invokeOnAllNodes();
        Log.info("Finished removing keys");
    } catch (Throwable e) {
        return Response.error(e);
    }
    JsonObject response = new JsonObject();
    return Response.done(response);
}
Also used : RemoveAllKeysTask(water.util.RemoveAllKeysTask) JsonObject(dontweave.gson.JsonObject) Job(water.Job)

Aggregations

RemoveAllKeysTask (water.util.RemoveAllKeysTask)2 JsonObject (dontweave.gson.JsonObject)1 Job (water.Job)1