You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@falcon.apache.org by PraveenAdlakha <gi...@git.apache.org> on 2016/01/28 17:28:55 UTC

[GitHub] falcon pull request: FALCON-1774 Server side check added

GitHub user PraveenAdlakha opened a pull request:

    https://github.com/apache/falcon/pull/16

    FALCON-1774 Server side check added

    Testing :
    
    $ bin/falcon entity -type feed -submitAndSchedule -file ../cluster.xml 
    ERROR: Forbidden;submitAndSchedule on server is not supported.Please run your operation on Prism.
    
    $ bin/falcon entity -type feed -update -name abc -file ../cluster.xml 
    ERROR: Forbidden;update on server is not supported.Please run your operation on Prism.
    
    $ bin/falcon entity -type feed -delete -name abc 
    ERROR: Forbidden;delete on server is not supported.Please run your operation on Prism.
    
    $ bin/falcon entity -type feed -submit -file ../cluster.xml 
    ERROR: Forbidden;submit on server is not supported.Please run your operation on Prism.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/PraveenAdlakha/falcon FALCON-1774

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/falcon/pull/16.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #16
    
----
commit 64431d22c344a9d3abc6638d02966034d6b2ccc9
Author: Praveen Adlakha <ad...@gmail.com>
Date:   2016-01-28T14:31:04Z

    server side check added

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] falcon pull request: FALCON-1774 Server side check added

Posted by PraveenAdlakha <gi...@git.apache.org>.
Github user PraveenAdlakha commented on a diff in the pull request:

    https://github.com/apache/falcon/pull/16#discussion_r51231110
  
    --- Diff: webapp/src/main/java/org/apache/falcon/resource/SchedulableEntityManager.java ---
    @@ -57,6 +59,91 @@ public APIResult getStatus(@Dimension("entityType") @PathParam("type") String ty
             }
         }
     
    +    /**
    +     * Delete the specified entity.
    +     * @param request Servlet Request
    +     * @param type Valid options are cluster, feed or process.
    +     * @param entity Name of the entity.
    +     * @param ignore colo is ignored
    +     * @return Results of the delete operation.
    +     */
    +    @DELETE
    +    @Path("delete/{type}/{entity}")
    +    @Produces({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
    +    @Monitored(event = "delete")
    +    @Override
    +    public APIResult delete(
    +            @Context HttpServletRequest request, @Dimension("entityType") @PathParam("type") final String type,
    +            @Dimension("entityName") @PathParam("entity") final String entity,
    +            @Dimension("colo") @QueryParam("colo") String ignore) {
    +        throw FalconWebException.newAPIException("delete on server is not" +
    --- End diff --
    
    Can you please help me understand why we want to check this?
    As per my understanding these calls are not supported on falcon server and whenever this method gets called we should through an error.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] falcon pull request: FALCON-1774 Server side check added

Posted by pallavi-rao <gi...@git.apache.org>.
Github user pallavi-rao commented on a diff in the pull request:

    https://github.com/apache/falcon/pull/16#discussion_r51231418
  
    --- Diff: webapp/src/main/java/org/apache/falcon/resource/SchedulableEntityManager.java ---
    @@ -57,6 +59,91 @@ public APIResult getStatus(@Dimension("entityType") @PathParam("type") String ty
             }
         }
     
    +    /**
    +     * Delete the specified entity.
    +     * @param request Servlet Request
    +     * @param type Valid options are cluster, feed or process.
    +     * @param entity Name of the entity.
    +     * @param ignore colo is ignored
    +     * @return Results of the delete operation.
    +     */
    +    @DELETE
    +    @Path("delete/{type}/{entity}")
    +    @Produces({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
    +    @Monitored(event = "delete")
    +    @Override
    +    public APIResult delete(
    +            @Context HttpServletRequest request, @Dimension("entityType") @PathParam("type") final String type,
    +            @Dimension("entityName") @PathParam("entity") final String entity,
    +            @Dimension("colo") @QueryParam("colo") String ignore) {
    +        throw FalconWebException.newAPIException("delete on server is not" +
    --- End diff --
    
    Falcon can run in 2 modes: 
    1. Distributed. In this case, Falcon prism is what user should use to perform CRUD operations on entities and direct CRUD operations against Falcon Server should not be allowed.
    2. Embedded. In this case, there is no Prism server at all, there is just one instance of Server and all CRUD operations should be allowed against server in this mode.
     


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] falcon pull request: FALCON-1774 Server side check added

Posted by PraveenAdlakha <gi...@git.apache.org>.
Github user PraveenAdlakha commented on a diff in the pull request:

    https://github.com/apache/falcon/pull/16#discussion_r51253308
  
    --- Diff: webapp/src/main/java/org/apache/falcon/resource/SchedulableEntityManager.java ---
    @@ -57,6 +59,91 @@ public APIResult getStatus(@Dimension("entityType") @PathParam("type") String ty
             }
         }
     
    +    /**
    +     * Delete the specified entity.
    +     * @param request Servlet Request
    +     * @param type Valid options are cluster, feed or process.
    +     * @param entity Name of the entity.
    +     * @param ignore colo is ignored
    +     * @return Results of the delete operation.
    +     */
    +    @DELETE
    +    @Path("delete/{type}/{entity}")
    +    @Produces({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
    +    @Monitored(event = "delete")
    +    @Override
    +    public APIResult delete(
    +            @Context HttpServletRequest request, @Dimension("entityType") @PathParam("type") final String type,
    +            @Dimension("entityName") @PathParam("entity") final String entity,
    +            @Dimension("colo") @QueryParam("colo") String ignore) {
    +        throw FalconWebException.newAPIException("delete on server is not" +
    --- End diff --
    
    Hi ,
    
    I have confirmed its working fine in embedded mode it checks intoSchedulableEntityManageProxy class not in SchedulableEntityManager :
    
    $  bin/falcon entity -type process -name DWH-CI-daily-supply5 -delete
    falcon/default/DWH-CI-daily-supply5(process) removed successfully (KILLED in WF_ENGINE)



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] falcon pull request: FALCON-1774 Server side check added

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/falcon/pull/16


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] falcon pull request: FALCON-1774 Server side check added

Posted by pallavi-rao <gi...@git.apache.org>.
Github user pallavi-rao commented on a diff in the pull request:

    https://github.com/apache/falcon/pull/16#discussion_r51226153
  
    --- Diff: webapp/src/main/java/org/apache/falcon/resource/SchedulableEntityManager.java ---
    @@ -57,6 +59,91 @@ public APIResult getStatus(@Dimension("entityType") @PathParam("type") String ty
             }
         }
     
    +    /**
    +     * Delete the specified entity.
    +     * @param request Servlet Request
    +     * @param type Valid options are cluster, feed or process.
    +     * @param entity Name of the entity.
    +     * @param ignore colo is ignored
    +     * @return Results of the delete operation.
    +     */
    +    @DELETE
    +    @Path("delete/{type}/{entity}")
    +    @Produces({MediaType.TEXT_XML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
    +    @Monitored(event = "delete")
    +    @Override
    +    public APIResult delete(
    +            @Context HttpServletRequest request, @Dimension("entityType") @PathParam("type") final String type,
    +            @Dimension("entityName") @PathParam("entity") final String entity,
    +            @Dimension("colo") @QueryParam("colo") String ignore) {
    +        throw FalconWebException.newAPIException("delete on server is not" +
    --- End diff --
    
    Shouldn't we check if it is embedded mode or not?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---