com.thinkaurelius.titan.graphdb.query.vertex

## Class SimpleVertexQueryProcessor

- java.lang.Object
- - com.thinkaurelius.titan.graphdb.query.vertex.SimpleVertexQueryProcessor

- All Implemented Interfaces:
    Iterable<Entry>

      public class SimpleVertexQueryProcessor
      extends Object
      implements Iterable<Entry>

  This is an optimization of specifically for `VertexCentricQuery` that addresses the special but common case that the query is simple (i.e. comprised of only one sub-query and that query is fitted, i.e. does not require in memory filtering). Under these assumptions we can remove a lot of the steps in `QueryProcessor`: merging of result sets, in-memory filtering and the object instantiation required for in-memory filtering. With those complexities removed, the query processor can be much simpler which makes it a lot faster and less memory intense. IMPORTANT: This Iterable is not thread-safe.
  Author:
    Matthias Broecheler (me@matthiasb.com)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SimpleVertexQueryProcessor(VertexCentricQuery query, StandardTitanTx tx)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Iterator<Entry>` | `iterator()`
    `Iterable<TitanRelation>` | `relations()` Converts the entries from this query result into actual `TitanRelation`.
    `VertexList` | `vertexIds()` Returns the list of adjacent vertex ids for this query.

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

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

- - ### Constructor Detail

    - #### SimpleVertexQueryProcessor

          public SimpleVertexQueryProcessor(VertexCentricQuery query,
                                    StandardTitanTx tx)

  - ### Method Detail

    - #### iterator

          public Iterator<Entry> iterator()

      Specified by:
        `iterator` in interface `Iterable<Entry>`

    - #### relations

          public Iterable<TitanRelation> relations()

      Converts the entries from this query result into actual `TitanRelation`.
      Returns:

    - #### vertexIds

          public VertexList vertexIds()

      Returns the list of adjacent vertex ids for this query. By reading those ids from the entries directly (without creating objects) we get much better performance.
      Returns:

Copyright © 2012–2014. All rights reserved.