ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Beerbower" <tbeerbo...@hortonworks.com>
Subject Re: Review Request 22142: VIews: On View Instance create, should validate that req props are provided
Date Mon, 02 Jun 2014 17:00:14 GMT


> On June 2, 2014, 4:41 p.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewInstanceEntity.java,
lines 521-539
> > <https://reviews.apache.org/r/22142/diff/1/?file=601731#file601731line521>
> >
> >     Not sure if I'm misreading current code, but does a ViewInstanceEntity already
have a handle to the "owned" @ManyToOne ViewEntity?  
> >     
> >     Can you use that relationship or can you validate a ViewInstanceEntity against
a non-owned ViewEntity.  Ping me if that sounds insane :)

No, that makes sense.  I pass in the view entity because I want to validate before the instance
is associated with the actual view entity.  Otherwise if the validation fails, I have to disassociate
it.  

So, in the view registry it goes something like this ...


    viewInstance.validate(view);

    ...  // if valid ...

    bindViewInstance(view, viewInstance);


- Tom


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/22142/#review44504
-----------------------------------------------------------


On June 2, 2014, 4:30 p.m., Tom Beerbower wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/22142/
> -----------------------------------------------------------
> 
> (Updated June 2, 2014, 4:30 p.m.)
> 
> 
> Review request for Ambari, Nate Cole and Sid Wagle.
> 
> 
> Bugs: AMBARI-5987
>     https://issues.apache.org/jira/browse/AMBARI-5987
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> On view instance create (POST) or any PUT that modifies the view instance props, the
framework should validate that the requirements view properties have been provided. Otherwise,
return error and not allow creation of the instance.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/orm/entities/ViewInstanceEntity.java
6456492 
>   ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java 2a7f334

>   ambari-server/src/test/java/org/apache/ambari/server/orm/entities/ViewInstanceEntityTest.java
7b4fcff 
>   ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java fc493ab

> 
> Diff: https://reviews.apache.org/r/22142/diff/
> 
> 
> Testing
> -------
> 
> Manual tests.
> 
> New unit tests added. all existing tests pass ...
> 
> Results :
> 
> Tests run: 1644, Failures: 0, Errors: 0, Skipped: 13
> 
> ...
> 
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 22:25.300s
> [INFO] Finished at: Mon Jun 02 12:12:02 EDT 2014
> [INFO] Final Memory: 37M/123M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Tom Beerbower
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message