org.infinispan.query.clustered
Class QueryBox

java.lang.Object
  extended by org.infinispan.query.clustered.QueryBox

public class QueryBox
extends Object

Each node in the cluster has a QueryBox instance. The QueryBox keep the active lazy iterators (actually it keeps the DocumentExtractor of the searches) on the cluster, so it can return values for the queries in a "lazy" way. When a DistributedLazyIterator is created, every nodes creates a DocumentExtractor and register it in your own QueryBox. So, the LazyIterator can fetch the values in a lazy way. EVICTION: Currently the QueryBox keeps the last BOX_LIMIT DocumentExtractor used... probably there is a better way.

Since:
5.1
Author:
Israel Lacerra

Constructor Summary
QueryBox()
           
 
Method Summary
 UUID getMyId()
          Id of this QueryBox
 Object getValue(UUID queryUuid, int docIndex)
          Get the "docIndex" value on the correct DocumentExtractor
 void kill(UUID id)
          Kill the query (DocumentExtractor)
 void put(UUID id, org.hibernate.search.query.engine.spi.DocumentExtractor extractor)
          Register a query (DocumentExtractor), so we can lazily load the results.
 void setCache(AdvancedCache<?,?> cache)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryBox

public QueryBox()
Method Detail

getValue

public Object getValue(UUID queryUuid,
                       int docIndex)
Get the "docIndex" value on the correct DocumentExtractor

Parameters:
queryUuid - The queryId, so we can get the correct DocumentExtractor
docIndex - value index in the DocumentExtractor
Returns:

kill

public void kill(UUID id)
Kill the query (DocumentExtractor)

Parameters:
id - The id of the query

put

public void put(UUID id,
                org.hibernate.search.query.engine.spi.DocumentExtractor extractor)
Register a query (DocumentExtractor), so we can lazily load the results.

Parameters:
id - The id of the query
extractor - The query

getMyId

public UUID getMyId()
Id of this QueryBox

Returns:

setCache

public void setCache(AdvancedCache<?,?> cache)

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.