SLIDER-713 flex is queued
Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/1501e49b Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/1501e49b Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/1501e49b Branch: refs/heads/develop Commit: 1501e49bb292229070d1e1fe0e79ebc7908d212e Parents: 5def63b Author: Steve Loughran <[email protected]> Authored: Tue Feb 24 11:25:21 2015 -0800 Committer: Steve Loughran <[email protected]> Committed: Tue Feb 24 11:25:21 2015 -0800 ---------------------------------------------------------------------- .../rest/application/ApplicationResource.java | 24 +++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1501e49b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/application/ApplicationResource.java ---------------------------------------------------------------------- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/application/ApplicationResource.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/application/ApplicationResource.java index df60782..383bc5a 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/application/ApplicationResource.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/rest/application/ApplicationResource.java @@ -158,10 +158,13 @@ public class ApplicationResource extends AbstractSliderResource { return lookupConfTree(MODEL_DESIRED_RESOURCES); } +/* @PUT @Path(MODEL_DESIRED_RESOURCES) - @Consumes({APPLICATION_JSON, TEXT_PLAIN}) +// @Consumes({APPLICATION_JSON, TEXT_PLAIN}) + @Consumes({TEXT_PLAIN}) @Produces({APPLICATION_JSON}) +*/ public ConfTree setModelDesiredResources( String json) { markPut(SLIDER_SUBPATH_APPLICATION, MODEL_DESIRED_RESOURCES); @@ -187,6 +190,25 @@ public class ApplicationResource extends AbstractSliderResource { throw buildException("PUT to "+ MODEL_DESIRED_RESOURCES , e); } } + @PUT + @Path(MODEL_DESIRED_RESOURCES) + @Consumes({APPLICATION_JSON}) + @Produces({APPLICATION_JSON}) + public ConfTree setModelDesiredResources( + ConfTree updated) { + try { + queue(new ActionFlexCluster("flex", + 1, TimeUnit.MILLISECONDS, + updated)); + // return the updated value, even though it potentially hasn't yet + // been executed + return updated; + } catch (Exception e) { + throw buildException("PUT to "+ MODEL_DESIRED_RESOURCES , e); + } + } + + @GET @Path(MODEL_RESOLVED)
