You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Amareshwari Sriramadasu (JIRA)" <ji...@apache.org> on 2015/04/09 03:11:13 UTC

[jira] [Resolved] (LENS-456) Provide QueryAcceptors to be declared in configuration

     [ https://issues.apache.org/jira/browse/LENS-456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amareshwari Sriramadasu resolved LENS-456.
------------------------------------------
       Resolution: Duplicate
    Fix Version/s: 2.1
         Assignee: Rajat Khandelwal

> Provide QueryAcceptors to be declared in configuration
> ------------------------------------------------------
>
>                 Key: LENS-456
>                 URL: https://issues.apache.org/jira/browse/LENS-456
>             Project: Apache Lens
>          Issue Type: Improvement
>          Components: server
>            Reporter: Rajat Khandelwal
>            Assignee: Rajat Khandelwal
>             Fix For: 2.1
>
>
> Creation: 
> {noformat}
>   private List<QueryAcceptor> queryAcceptors = new ArrayList<QueryAcceptor>();
> {noformat}
> Usage:
> {noformat}
>   private void accept(String query, Configuration conf, SubmitOp submitOp) throws LensException {
>     // run through all the query acceptors, and throw Exception if any of them
>     // return false
>     for (QueryAcceptor acceptor : queryAcceptors) {
>       String cause = "";
>       String rejectionCause = acceptor.accept(query, conf, submitOp);
>       if (rejectionCause != null) {
>         getEventService().notifyEvent(new QueryRejected(System.currentTimeMillis(), query, rejectionCause, null));
>         throw new LensException("Query not accepted because " + cause);
>       }
>     }
>     getEventService().notifyEvent(new QueryAccepted(System.currentTimeMillis(), null, query, null));
>   }
> {noformat}
> We can take from conf and populate the list. Right now it's not populated. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)