forked from h2oai/h2o-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added h2o:::.h2o.garbageCollect(h2oClient)
- Loading branch information
1 parent
ed59791
commit b179f61
Showing
3 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package water.api; | ||
|
||
import water.DTask; | ||
import water.H2O; | ||
import water.H2ONode; | ||
import water.RPC; | ||
import water.util.Log; | ||
|
||
public class GarbageCollect extends Request { | ||
private static class GCTask extends DTask<GCTask> { | ||
public GCTask() { | ||
} | ||
|
||
@Override public void compute2() { | ||
Log.info("Calling System.gc() now..."); | ||
System.gc(); | ||
Log.info("System.gc() finished"); | ||
tryComplete(); | ||
} | ||
|
||
@Override public byte priority() { | ||
return H2O.MIN_HI_PRIORITY; | ||
} | ||
} | ||
|
||
@Override public RequestBuilders.Response serve(){ | ||
for (H2ONode node : H2O.CLOUD._memary) { | ||
GCTask t = new GCTask(); | ||
new RPC<GCTask>(node, t).call().get(); | ||
} | ||
|
||
return RequestBuilders.Response.doneEmpty(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters