Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1D2DE18838 for ; Wed, 13 May 2015 15:38:41 +0000 (UTC) Received: (qmail 85309 invoked by uid 500); 13 May 2015 15:38:41 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 85281 invoked by uid 500); 13 May 2015 15:38:41 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 85264 invoked by uid 99); 13 May 2015 15:38:40 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 May 2015 15:38:40 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 6FCE31CABFD; Wed, 13 May 2015 15:38:40 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============3740666594876138960==" MIME-Version: 1.0 Subject: Re: Review Request 34157: Provide host predicate property validation for blueprint requests From: "John Speidel" To: "Robert Levas" , "Robert Nettleton" Cc: "John Speidel" , "Ambari" Date: Wed, 13 May 2015 15:38:40 -0000 Message-ID: <20150513153840.1460.62282@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "John Speidel" X-ReviewGroup: Ambari X-ReviewRequest-URL: https://reviews.apache.org/r/34157/ X-Sender: "John Speidel" References: <20150513145246.1460.71026@reviews.apache.org> In-Reply-To: <20150513145246.1460.71026@reviews.apache.org> Reply-To: "John Speidel" X-ReviewRequest-Repository: ambari --===============3740666594876138960== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On May 13, 2015, 2:52 p.m., Robert Levas wrote: > > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseClusterRequest.java, lines 84-86 > > > > > > It seems like injection could be used rather than this `init` method. But this does match a pattern we see throughout the code. Yeah, I often struggle with which 'injection' approach that I should use. Dependency Injection in Ambari is currently a real mess and is actually one of my "top 5" issues that I responded with regarding the recent "making things better poll". I left this like this for the moment because it is very likely that this "injection" wont be required in the near future as I am considering changing the TopologyRequest interface to return a blueprint name and not a blueprint. - John ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/34157/#review83610 ----------------------------------------------------------- On May 13, 2015, 3:41 a.m., John Speidel wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/34157/ > ----------------------------------------------------------- > > (Updated May 13, 2015, 3:41 a.m.) > > > Review request for Ambari, Robert Levas and Robert Nettleton. > > > Bugs: AMBARI-11093 > https://issues.apache.org/jira/browse/AMBARI-11093 > > > Repository: ambari > > > Description > ------- > > When specifying a host predicate via the "host_predicate" property in the cluster creation template, the predicate is compiled using the API predicate compiler which will report syntactic errors in the predicate but the property names aren't validated. So, if an invalid property name is specified in the predicate, the host group will never get matched to any host meaning that the host group will never be deployed. > This is critical that this is fixed for 2.1 as it will cause great frustration to anyone who attempts to provision or scale a cluster and specifies a host predicate with an invalid proper name. > When an invalid property name is specified a host predicate, this should result in a 400 response to the the user with a message which indicates the invalid properties. > > > Diffs > ----- > > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java 77f6d2c > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BaseClusterRequest.java PRE-CREATION > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/HostResourceProvider.java 47a4ce0 > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequest.java a1a0ac6 > ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ScaleClusterRequest.java 1530a3e > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ProvisionClusterRequestTest.java acfd426 > ambari-server/src/test/java/org/apache/ambari/server/controller/internal/ScaleClusterRequestTest.java PRE-CREATION > > Diff: https://reviews.apache.org/r/34157/diff/ > > > Testing > ------- > > Functional Testing: > Provisioned and scaled clusters with combination of explicit host names, host counts and host predicates and host registrations prior to and after cluster/scaling operations. > > Unit Tests: > New Tests and all existing tests pass. > > Results : > > Tests run: 2978, Failures: 0, Errors: 0, Skipped: 20 > ... > Total run:739 > Total errors:0 > Total failures:0 > > > Thanks, > > John Speidel > > --===============3740666594876138960==--