Author: ssmiweve
Date: 2007-08-20 22:34:07 +0200 (Mon, 20 Aug 2007)
New Revision: 5639
Modified:
trunk/search-command-control-spi/src/main/java/no/sesat/search/mode/executor/ThrottledSearchCommandExecutor.java
Log:
warning log reporting throttling
Modified:
trunk/search-command-control-spi/src/main/java/no/sesat/search/mode/executor/ThrottledSearchCommandExecutor.java
===================================================================
---
trunk/search-command-control-spi/src/main/java/no/sesat/search/mode/executor/ThrottledSearchCommandExecutor.java
2007-08-20 19:06:35 UTC (rev 5638)
+++
trunk/search-command-control-spi/src/main/java/no/sesat/search/mode/executor/ThrottledSearchCommandExecutor.java
2007-08-20 20:34:07 UTC (rev 5639)
@@ -25,6 +25,7 @@
import no.sesat.search.mode.config.SearchConfiguration;
import no.sesat.search.result.ResultItem;
import no.sesat.search.result.ResultList;
+import org.apache.log4j.Logger;
/**
* An extension to the ParallelSearchCommandExecutor that supports individual
thread pools for each skin's different
@@ -35,7 +36,7 @@
* @version <tt>$Id$</tt>
*/
final class ThrottledSearchCommandExecutor extends
AbstractSearchCommandExecutor {
-
+
private static final Map<SearchConfiguration,ExecutorService> EXECUTORS
= new HashMap<SearchConfiguration,ExecutorService>();
@@ -58,11 +59,20 @@
final ThreadPoolExecutor executor =
getExecutorService(command);
if(command.isCancelled()){
+
+ LOG.warn("\n");
+ LOG.warn("FREEZING THREAD POOL EXECUTOR " +
command.getSearchConfiguration());
+ LOG.warn(" at " + executor.getActiveCount());
+ LOG.warn("\n");
// we freeze thread pool at current size (excluding the
just failed callable)
executor.setMaximumPoolSize(Math.max(1,
executor.getActiveCount()));
}else if(Integer.MAX_VALUE > executor.getMaximumPoolSize()){
+
+ LOG.warn("\n");
+ LOG.warn("Restoring ThreadPoolExecutor " +
command.getSearchConfiguration());
+ LOG.warn("\n");
// command was successful unfreeze thread pool
executor.setMaximumPoolSize(Integer.MAX_VALUE);
_______________________________________________
Kernel-commits mailing list
[email protected]
http://sesat.no/mailman/listinfo/kernel-commits