Revision: 15960
http://gate.svn.sourceforge.net/gate/?rev=15960&view=rev
Author: valyt
Date: 2012-07-19 15:03:17 +0000 (Thu, 19 Jul 2012)
Log Message:
-----------
Support for getting the index from the query ID.
Modified Paths:
--------------
mimir/trunk/mimir-web/grails-app/services/gate/mimir/web/SearchService.groovy
Modified:
mimir/trunk/mimir-web/grails-app/services/gate/mimir/web/SearchService.groovy
===================================================================
---
mimir/trunk/mimir-web/grails-app/services/gate/mimir/web/SearchService.groovy
2012-07-19 15:02:54 UTC (rev 15959)
+++
mimir/trunk/mimir-web/grails-app/services/gate/mimir/web/SearchService.groovy
2012-07-19 15:03:17 UTC (rev 15960)
@@ -45,14 +45,18 @@
* A map holding the currently active query runners.
*/
//Map<String, QueryRunner> queryRunners = [:].asSynchronized()
- Cache<String, QueryRunner> queryRunners
+ Cache<String, QueryRunnerHolder> queryRunners
CacheCleaner cacheCleaner
- public QueryRunner getQueryRunner(String id){
- return id ? queryRunners.getIfPresent(id) : null
+ public QueryRunner getQueryRunner(String queryId){
+ return queryId ? queryRunners.getIfPresent(queryId)?.queryRunner : null
}
+ public Index getQueryRunnerIndex(String queryId){
+ return queryId ? queryRunners.getIfPresent(queryId)?.index : null
+ }
+
public boolean closeQueryRunner(String id){
QueryRunner runner = getQueryRunner(id)
if(runner){
@@ -74,7 +78,8 @@
QueryRunner aRunner = theIndex.startQuery(queryString)
if(aRunner){
String runnerId = UUID.randomUUID()
- queryRunners.put(runnerId, aRunner)
+ queryRunners.put(runnerId,
+ new QueryRunnerHolder(queryRunner:aRunner, index:theIndex))
return runnerId
} else {
throw new RuntimeException("Could not start query")
@@ -115,6 +120,11 @@
}
}
+class QueryRunnerHolder {
+ QueryRunner queryRunner
+ Index index
+}
+
/**
* Implementation of a cache removal listener, so that we can close the query
* runners as they get evicted.
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs