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

[jira] [Commented] (LENS-753) Queue number for queries

    [ https://issues.apache.org/jira/browse/LENS-753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14742471#comment-14742471 ] 

Akshay Goyal commented on LENS-753:
-----------------------------------

In order to get index of a queued queries, we need to change the implementation of waitingQueries collection from a linked hash set to an ordered set (treeset). After this change constructors of DefaultQueryCollection looks like this:
{noformat}
public DefaultQueryCollection() {
    this.queries = Sets.newLinkedHashSet();
  }

  public DefaultQueryCollection(@NonNull final Set<QueryContext> queries) {
    this.queries = queries;
  }

  public DefaultQueryCollection(final TreeSet<QueryContext> treeSet) {
    this.queries = treeSet;
  }
{noformat}

We can not retrieve queue numbers from queuedQueries collection (FairPriorityBlockingQueue) because it doesn't hold waiting queries always. As soon as candidate queries are picked up, they are either added to launchedQueries collection (when query is allowed to launch) or to waitingQueries collection (when they fail constraints checks).

Updated the review request with these changes. 

> Queue number for queries
> ------------------------
>
>                 Key: LENS-753
>                 URL: https://issues.apache.org/jira/browse/LENS-753
>             Project: Apache Lens
>          Issue Type: Improvement
>            Reporter: Akshay Goyal
>            Assignee: Akshay Goyal
>             Fix For: 2.4
>
>         Attachments: LENS-753.02.patch
>
>
> This is to add queue number for queries after they were launched, in order to give users an idea of the sequence in which their queries were launched. Or in other words, to give them an idea of how many queries were launched before them which are still competing for resources with their query. 
> Giving queue numbers from waiting query collection may not be correct as they are not consistent. When a candidate query is picked up from waiting state, it is removed from the collection and checked for cost constraints. If it fails the constraints, the query is added back to the waiting query collection. This causes inconsistency in terms of indices of queries within the collection. Because of this inconsistency, user might see their queue number increasing.



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