Rajat Khandelwal created LENS-456:
-------------------------------------

             Summary: Provide QueryAcceptors to be declared in configuration
                 Key: LENS-456
                 URL: https://issues.apache.org/jira/browse/LENS-456
             Project: Apache Lens
          Issue Type: Bug
            Reporter: Rajat Khandelwal


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)

Reply via email to