com.thinkaurelius.titan.graphdb.query

## Class MetricsQueryExecutor<Q extends ElementQuery,R extends TitanElement,B extends BackendQuery>

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.query.MetricsQueryExecutor<Q,R,B>

- All Implemented Interfaces:
    QueryExecutor<Q,R,B>

      public class MetricsQueryExecutor<Q extends ElementQuery,R extends TitanElement,B extends BackendQuery>
      extends Object
      implements QueryExecutor<Q,R,B>

  Wraps a `QueryExecutor` to gather metrics on the query execution and forward them to METRICS.
  Author:
    Dan LaRocque (dan@thinkaurelius.com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MetricsQueryExecutor(String prefix, String name, QueryExecutor<Q,R,B> qe)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Iterator<R>` | `execute(Q query, B subquery, Object executionInfo)` Executes the given sub-query against a data store and returns an iterator over the results.
    `Iterator<R>` | `getNew(Q query)` Returns all newly created elements in a transactional context that match the given query.
    `boolean` | `hasDeletions(Q query)` Whether the transactional context contains any deletions that could potentially affect the result set of the given query.
    `boolean` | `isDeleted(Q query, R result)` Whether the given result entry has been deleted in the transactional context and should hence be removed from the result set.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MetricsQueryExecutor

          public MetricsQueryExecutor(String prefix,
                              String name,
                              QueryExecutor<Q,R,B> qe)

  - ### Method Detail

    - #### getNew

          public Iterator<R> getNew(Q query)

      Description copied from interface: `QueryExecutor`
      Returns all newly created elements in a transactional context that match the given query.
      Specified by:
        `getNew` in interface `QueryExecutor<Q extends ElementQuery,R extends TitanElement,B extends BackendQuery>`
      Returns:

    - #### hasDeletions

          public boolean hasDeletions(Q query)

      Description copied from interface: `QueryExecutor`
      Whether the transactional context contains any deletions that could potentially affect the result set of the given query. This is used to determine whether results need to be checked for deletion with `QueryExecutor.isDeleted(ElementQuery, com.thinkaurelius.titan.core.TitanElement)`.
      Specified by:
        `hasDeletions` in interface `QueryExecutor<Q extends ElementQuery,R extends TitanElement,B extends BackendQuery>`
      Returns:

    - #### isDeleted

          public boolean isDeleted(Q query,
                          R result)

      Description copied from interface: `QueryExecutor`
      Whether the given result entry has been deleted in the transactional context and should hence be removed from the result set.
      Specified by:
        `isDeleted` in interface `QueryExecutor<Q extends ElementQuery,R extends TitanElement,B extends BackendQuery>`
      Returns:

    - #### execute

          public Iterator<R> execute(Q query,
                            B subquery,
                            Object executionInfo)

      Description copied from interface: `QueryExecutor`
      Executes the given sub-query against a data store and returns an iterator over the results. These results are not yet adjusted to any modification made in the transactional context which are done by the `QueryProcessor` using the other methods of this interface.
      Specified by:
        `execute` in interface `QueryExecutor<Q extends ElementQuery,R extends TitanElement,B extends BackendQuery>`
      Returns:

Copyright © 2012–2014. All rights reserved.