You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Tom Beerbower <tb...@hortonworks.com> on 2014/11/14 07:06:43 UTC

Review Request 28029: Views: Unable to delete view

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

Review request for Ambari, Alejandro Fernandez and Nate Cole.


Bugs: AMBARI-8329
    https://issues.apache.org/jira/browse/AMBARI-8329


Repository: ambari


Description
-------

Unable to delete view
Tried to delete: http://162.216.150.50:8080/views/ADMIN_VIEW/1.0.0/INSTANCE/#/views/PIG/versions/0.1.0/instances/pig/edit
and received: http://monosnap.com/image/rlkpId299fwVl6eo68ZTXHei4rVFVD
This does not appear to be a consistent error - I have been able to delete Views prior to this.

------

This is a bug in the view DataStore feature which is now being used by the PIG view.

Views have two methods of persistence ...

1) instance data - basically a user scoped map of strings.
2) DataStore - the ability to persist POJOs in the ambari db.

When you define the persistence entities for a view ...

    <persistence>
        <entity>
            <class>org.apache.ambari.view.pig.persistence.DataStoreStorage$SmokeTestEntity</class>
            <id-property>id</id-property>
        </entity>
        <entity>
            <class>org.apache.ambari.view.pig.resources.jobs.models.PigJob</class>
            <id-property>id</id-property>
        </entity>
        <entity>
            <class>org.apache.ambari.view.pig.resources.scripts.models.PigScript</class>
            <id-property>id</id-property>
        </entity>
        <entity>
            <class>org.apache.ambari.view.pig.resources.udf.models.UDF</class>
            <id-property>id</id-property>
        </entity>
    </persistence>

... this information gets written to the viewentity table in the Ambari DB. Apparently it can get written multiple times. When this happens the view instance can not be deleted because the duplicate entries refer to the view instance row.


Diffs
-----

  ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java a5d11bd 
  ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java 66e2392 

Diff: https://reviews.apache.org/r/28029/diff/


Testing
-------

Manual test DataStore.

Updated unit tests.

All unit tests pass.

Results :

Tests run: 2112, Failures: 0, Errors: 0, Skipped: 15


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18:12 min
[INFO] Finished at: 2014-11-14T00:41:31-05:00
[INFO] Final Memory: 41M/335M
[INFO] ------------------------------------------------------------------------


Thanks,

Tom Beerbower


Re: Review Request 28029: Views: Unable to delete view

Posted by Nate Cole <nc...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28029/#review61430
-----------------------------------------------------------

Ship it!


Ship It!

- Nate Cole


On Nov. 14, 2014, 1:06 a.m., Tom Beerbower wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28029/
> -----------------------------------------------------------
> 
> (Updated Nov. 14, 2014, 1:06 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez and Nate Cole.
> 
> 
> Bugs: AMBARI-8329
>     https://issues.apache.org/jira/browse/AMBARI-8329
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Unable to delete view
> Tried to delete: http://162.216.150.50:8080/views/ADMIN_VIEW/1.0.0/INSTANCE/#/views/PIG/versions/0.1.0/instances/pig/edit
> and received: http://monosnap.com/image/rlkpId299fwVl6eo68ZTXHei4rVFVD
> This does not appear to be a consistent error - I have been able to delete Views prior to this.
> 
> ------
> 
> This is a bug in the view DataStore feature which is now being used by the PIG view.
> 
> Views have two methods of persistence ...
> 
> 1) instance data - basically a user scoped map of strings.
> 2) DataStore - the ability to persist POJOs in the ambari db.
> 
> When you define the persistence entities for a view ...
> 
>     <persistence>
>         <entity>
>             <class>org.apache.ambari.view.pig.persistence.DataStoreStorage$SmokeTestEntity</class>
>             <id-property>id</id-property>
>         </entity>
>         <entity>
>             <class>org.apache.ambari.view.pig.resources.jobs.models.PigJob</class>
>             <id-property>id</id-property>
>         </entity>
>         <entity>
>             <class>org.apache.ambari.view.pig.resources.scripts.models.PigScript</class>
>             <id-property>id</id-property>
>         </entity>
>         <entity>
>             <class>org.apache.ambari.view.pig.resources.udf.models.UDF</class>
>             <id-property>id</id-property>
>         </entity>
>     </persistence>
> 
> ... this information gets written to the viewentity table in the Ambari DB. Apparently it can get written multiple times. When this happens the view instance can not be deleted because the duplicate entries refer to the view instance row.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java a5d11bd 
>   ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java 66e2392 
> 
> Diff: https://reviews.apache.org/r/28029/diff/
> 
> 
> Testing
> -------
> 
> Manual test DataStore.
> 
> Updated unit tests.
> 
> All unit tests pass.
> 
> Results :
> 
> Tests run: 2112, Failures: 0, Errors: 0, Skipped: 15
> 
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 18:12 min
> [INFO] Finished at: 2014-11-14T00:41:31-05:00
> [INFO] Final Memory: 41M/335M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Tom Beerbower
> 
>


Re: Review Request 28029: Views: Unable to delete view

Posted by Alejandro Fernandez <af...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/28029/#review61468
-----------------------------------------------------------

Ship it!


Ship It!

- Alejandro Fernandez


On Nov. 14, 2014, 6:06 a.m., Tom Beerbower wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/28029/
> -----------------------------------------------------------
> 
> (Updated Nov. 14, 2014, 6:06 a.m.)
> 
> 
> Review request for Ambari, Alejandro Fernandez and Nate Cole.
> 
> 
> Bugs: AMBARI-8329
>     https://issues.apache.org/jira/browse/AMBARI-8329
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Unable to delete view
> Tried to delete: http://162.216.150.50:8080/views/ADMIN_VIEW/1.0.0/INSTANCE/#/views/PIG/versions/0.1.0/instances/pig/edit
> and received: http://monosnap.com/image/rlkpId299fwVl6eo68ZTXHei4rVFVD
> This does not appear to be a consistent error - I have been able to delete Views prior to this.
> 
> ------
> 
> This is a bug in the view DataStore feature which is now being used by the PIG view.
> 
> Views have two methods of persistence ...
> 
> 1) instance data - basically a user scoped map of strings.
> 2) DataStore - the ability to persist POJOs in the ambari db.
> 
> When you define the persistence entities for a view ...
> 
>     <persistence>
>         <entity>
>             <class>org.apache.ambari.view.pig.persistence.DataStoreStorage$SmokeTestEntity</class>
>             <id-property>id</id-property>
>         </entity>
>         <entity>
>             <class>org.apache.ambari.view.pig.resources.jobs.models.PigJob</class>
>             <id-property>id</id-property>
>         </entity>
>         <entity>
>             <class>org.apache.ambari.view.pig.resources.scripts.models.PigScript</class>
>             <id-property>id</id-property>
>         </entity>
>         <entity>
>             <class>org.apache.ambari.view.pig.resources.udf.models.UDF</class>
>             <id-property>id</id-property>
>         </entity>
>     </persistence>
> 
> ... this information gets written to the viewentity table in the Ambari DB. Apparently it can get written multiple times. When this happens the view instance can not be deleted because the duplicate entries refer to the view instance row.
> 
> 
> Diffs
> -----
> 
>   ambari-server/src/main/java/org/apache/ambari/server/view/ViewRegistry.java a5d11bd 
>   ambari-server/src/test/java/org/apache/ambari/server/view/ViewRegistryTest.java 66e2392 
> 
> Diff: https://reviews.apache.org/r/28029/diff/
> 
> 
> Testing
> -------
> 
> Manual test DataStore.
> 
> Updated unit tests.
> 
> All unit tests pass.
> 
> Results :
> 
> Tests run: 2112, Failures: 0, Errors: 0, Skipped: 15
> 
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 18:12 min
> [INFO] Finished at: 2014-11-14T00:41:31-05:00
> [INFO] Final Memory: 41M/335M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Tom Beerbower
> 
>