----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/18708/#review36248 -----------------------------------------------------------
ambari-server/src/main/java/org/apache/ambari/server/api/handlers/UpdateHandler.java <https://reviews.apache.org/r/18708/#comment67200> Should we formalize even when this is a hack? Could this be done at the level of HostComponentResourceProvider? ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ReplacePropertyPredicateVisitor.java <https://reviews.apache.org/r/18708/#comment67201> Could you talk to Tom about this? While this is powerful - editing predicates on the fly - I am not sure if we should allow it in a formal way. - Sumit Mohanty On March 4, 2014, 4:57 p.m., Dmitro Lisnichenko wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/18708/ > ----------------------------------------------------------- > > (Updated March 4, 2014, 4:57 p.m.) > > > Review request for Ambari, Dmytro Sen and Sumit Mohanty. > > > Bugs: AMBARI-4782 > https://issues.apache.org/jira/browse/AMBARI-4782 > > > Repository: ambari > > > Description > ------- > > The general idea is to replace "state" property at user predicate (for > HostComponent update requests) with desired_state to comply with current > usage and keep all hack in one place. This is done at UpdateHandler. > We can not do that later, because request type information (GET or PUT) is > not available at this time. Changing url parameters before compiling > predicate seems more hacky for me. That's why I implemented a visitor that > iterates over predicate and replaces properties. The code that is executed > afterwards transparently works with "desired_state" property instead of > "state" property. Get requests are processed at natural way, "state" is > mapped to live state for all requests except update requests. > > Need more work on replacing "state" property in request body. > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/api/handlers/BaseManagementHandler.java > c34f0d7 > > ambari-server/src/main/java/org/apache/ambari/server/api/handlers/UpdateHandler.java > 338d411 > > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java > 10d07b6 > > ambari-server/src/main/java/org/apache/ambari/server/controller/ServiceComponentHostRequest.java > d9c7928 > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/AbstractProviderModule.java > 23eafcb > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostComponentResourceProvider.java > 89d53ae > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ReplacePropertyPredicateVisitor.java > PRE-CREATION > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ServiceResourceProvider.java > 1e402eb > > ambari-server/src/main/java/org/apache/ambari/server/controller/predicate/PropertyPredicate.java > 5715d2a > > ambari-server/src/main/java/org/apache/ambari/server/controller/utilities/PredicateHelper.java > 381fcac > > ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerImplTest.java > c99bfa1 > > ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java > dcee4bf > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/AbstractResourceProviderTest.java > 11adbee > > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/JMXHostProviderTest.java > ec82e55 > > Diff: https://reviews.apache.org/r/18708/diff/ > > > Testing > ------- > > Here is a preview version of patch (without unit tests). Not wll-tested > end2end yet. > > > Thanks, > > Dmitro Lisnichenko > >
