Author: rareddy
Date: 2009-04-20 16:41:11 -0400 (Mon, 20 Apr 2009)
New Revision: 807
Modified:
trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java
trunk/common-internal/src/main/java/com/metamatrix/core/event/AsynchEventBroker.java
trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java
trunk/connector-api/src/main/java/org/teiid/connector/internal/ConnectorPropertyNames.java
trunk/console/src/main/java/com/metamatrix/console/ui/layout/WorkspaceController.java
trunk/engine/src/main/java/com/metamatrix/dqp/service/CustomizableTrackingService.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java
trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditManager.java
trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java
Log:
TEIID-510: Removing the thread keep alive references from all the thread pool creations,
this defaults to 2 mins.
Modified:
trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java
===================================================================
---
trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/common-internal/src/main/java/com/metamatrix/common/queue/WorkerPoolFactory.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -356,7 +356,7 @@
* @param numThreads the maximum number of worker threads allowed
* @return
*/
- public static WorkerPool newWorkerPool(String name, int numThreads, long keepAlive) {
+ public static WorkerPool newWorkerPool(String name, int numThreads) {
return new StatsCapturingSharedThreadPoolExecutor(name, numThreads);
}
Modified:
trunk/common-internal/src/main/java/com/metamatrix/core/event/AsynchEventBroker.java
===================================================================
---
trunk/common-internal/src/main/java/com/metamatrix/core/event/AsynchEventBroker.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/common-internal/src/main/java/com/metamatrix/core/event/AsynchEventBroker.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -31,7 +31,7 @@
import com.metamatrix.core.MetaMatrixRuntimeException;
public class AsynchEventBroker extends AbstractEventBroker {
- private WorkerPool workerPool =
WorkerPoolFactory.newWorkerPool("AsyncEventBroker", 1, 120000); //$NON-NLS-1$
+ private WorkerPool workerPool =
WorkerPoolFactory.newWorkerPool("AsyncEventBroker", 1); //$NON-NLS-1$
private static final String DEFAULT_NAME =
CorePlugin.Util.getString("AsynchEventBroker.DefaultName"); //$NON-NLS-1$
private static final long SHUTDOWN_TIMEOUT_MILLIS = 10000; // 10 seconds
Modified:
trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java
===================================================================
---
trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/common-internal/src/test/java/com/metamatrix/common/queue/TestQueueWorkerPool.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -42,7 +42,7 @@
final int WORK_ITEMS = 10;
final int MAX_THREADS = 5;
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test",
MAX_THREADS, 120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test",
MAX_THREADS); //$NON-NLS-1$
for(int i=0; i<WORK_ITEMS; i++) {
pool.execute(new FakeWorkItem(SINGLE_WAIT));
@@ -60,7 +60,7 @@
final long SINGLE_WAIT = 50;
final long NUM_THREADS = 5;
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5,
120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5);
//$NON-NLS-1$
for(int i=0; i<NUM_THREADS; i++) {
pool.execute(new FakeWorkItem(SINGLE_WAIT));
@@ -80,13 +80,13 @@
}
@Test(expected=RejectedExecutionException.class) public void testShutdown() throws
Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5,
120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5);
//$NON-NLS-1$
pool.shutdown();
pool.execute(new FakeWorkItem(1));
}
@Test public void testScheduleCancel() throws Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5,
120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5);
//$NON-NLS-1$
ScheduledFuture<?> future = pool.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
@@ -97,7 +97,7 @@
}
@Test public void testSchedule() throws Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5,
120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5);
//$NON-NLS-1$
final ArrayList<String> result = new ArrayList<String>();
ScheduledFuture<?> future = pool.schedule(new Runnable() {
@Override
@@ -121,7 +121,7 @@
}
@Test(expected=ExecutionException.class) public void testScheduleException() throws
Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5,
120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5);
//$NON-NLS-1$
ScheduledFuture<?> future = pool.schedule(new Runnable() {
@Override
public void run() {
@@ -135,7 +135,7 @@
* Here each execution exceeds the period
*/
@Test public void testScheduleRepeated() throws Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5,
120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5);
//$NON-NLS-1$
final ArrayList<String> result = new ArrayList<String>();
ScheduledFuture<?> future = pool.scheduleAtFixedRate(new Runnable() {
@Override
@@ -154,7 +154,7 @@
}
@Test public void testFailingWork() throws Exception {
- final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5,
120000); //$NON-NLS-1$
+ final WorkerPool pool = WorkerPoolFactory.newWorkerPool("test", 5);
//$NON-NLS-1$
final AtomicInteger count = new AtomicInteger();
pool.execute(new Runnable() {
@Override
Modified:
trunk/connector-api/src/main/java/org/teiid/connector/internal/ConnectorPropertyNames.java
===================================================================
---
trunk/connector-api/src/main/java/org/teiid/connector/internal/ConnectorPropertyNames.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/connector-api/src/main/java/org/teiid/connector/internal/ConnectorPropertyNames.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -36,12 +36,6 @@
*/
public static final String MAX_THREADS = "ConnectorMaxThreads";
//$NON-NLS-1$
- /**
- * The environment property name whose value defines the maximum length of time
- * a processor thread may live idle. This property is required and is in milliseconds.
- */
- public static final String THREAD_TTL = "ConnectorThreadTTL";
//$NON-NLS-1$
-
/**
* This property can be used to specify the maximum number of rows to be returned
* from the datasource of this connector. The connector should stop adding records
Modified:
trunk/console/src/main/java/com/metamatrix/console/ui/layout/WorkspaceController.java
===================================================================
---
trunk/console/src/main/java/com/metamatrix/console/ui/layout/WorkspaceController.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/console/src/main/java/com/metamatrix/console/ui/layout/WorkspaceController.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -100,7 +100,7 @@
super();
workspace = ws;
- workerPool =
WorkerPoolFactory.newWorkerPool("WorkspaceControllerQueue", 1, 1000);
//$NON-NLS-1$
+ workerPool =
WorkerPoolFactory.newWorkerPool("WorkspaceControllerQueue", 1); //$NON-NLS-1$
}
public static void createInstance(Workspace workspace) {
Modified:
trunk/engine/src/main/java/com/metamatrix/dqp/service/CustomizableTrackingService.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/dqp/service/CustomizableTrackingService.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/engine/src/main/java/com/metamatrix/dqp/service/CustomizableTrackingService.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -69,21 +69,10 @@
* Whether to log source command. Defaults to false.
*/
public static final String SYSTEM_TXN_STORE_SRCCMD =
"metamatrix.transaction.log.storeSRCCMD"; //$NON-NLS-1$
-
- /**
- * The name of the System property that contains the time to live (in milliseconds)
for threads
- * in the LogManager. The time to live is simply the period of thread inactivity
- * that determines when a thread may be expired. This is an optional property
- * that defaults to '600000' milliseconds (or 10 minutes).
- */
- public static final String SYSTEM_LOG_THREAD_TTL =
"metamatrix.transaction.log.threadTTL"; //$NON-NLS-1$
- protected static final long DEFAULT_LOG_THREAD_TTL = 600000; // 10 minute
default
-
private CommandLoggerSPI commandLogger;
private boolean recordUserCommands;
private boolean recordSourceCommands;
- private long workerTTL;
private WorkerPool logQueue;
@@ -224,8 +213,6 @@
if(propvalue != null){
recordSourceCommands = Boolean.valueOf(propvalue).booleanValue();
}
-
- workerTTL = PropertiesUtils.getLongProperty(props, SYSTEM_LOG_THREAD_TTL,
DEFAULT_LOG_THREAD_TTL);
}
/**
@@ -233,8 +220,7 @@
*/
public void start(ApplicationEnvironment environment) throws
ApplicationLifecycleException {
logQueue = WorkerPoolFactory.newWorkerPool("CustomTracker",
//$NON-NLS-1$
- 1, // Use only a single thread
- workerTTL);
+ 1);
}
/**
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -97,7 +97,6 @@
public class ConnectorManager implements ApplicationService {
public static final int DEFAULT_MAX_PROCESSOR_THREADS = 15;
- public static final int DEFAULT_PROCESSOR_TREAD_TTL = 120000;
private static final String DEFAULT_MAX_RESULTSET_CACHE_SIZE = "20";
//$NON-NLS-1$
private static final String DEFAULT_MAX_RESULTSET_CACHE_AGE = "3600000";
//$NON-NLS-1$
@@ -307,9 +306,8 @@
}
int maxThreads = PropertiesUtils.getIntProperty(props,
ConnectorPropertyNames.MAX_THREADS, DEFAULT_MAX_PROCESSOR_THREADS);
- int threadTTL = PropertiesUtils.getIntProperty(props,
ConnectorPropertyNames.THREAD_TTL, DEFAULT_PROCESSOR_TREAD_TTL);
- connectorWorkerPool = WorkerPoolFactory.newWorkerPool(connectorName, maxThreads,
threadTTL);
+ connectorWorkerPool = WorkerPoolFactory.newWorkerPool(connectorName,
maxThreads);
// Create the Connector env
Properties clonedProps = PropertiesUtils.clone(props);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-04-20
19:01:03 UTC (rev 806)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -117,7 +117,6 @@
private static final int DEFAULT_MAX_CODE_TABLES = 20;
private static final int DEFAULT_PROCESSOR_TIMESLICE = 2000;
private static final String PROCESS_PLAN_QUEUE_NAME =
"QueryProcessorQueue"; //$NON-NLS-1$
- private static final String DEAFULT_PROCESS_WORKER_TIMEOUT = "120000";
//$NON-NLS-1$
private static final int DEFAULT_MAX_PROCESS_WORKERS = 15;
private static final String DEFAULT_MAX_RESULTSET_CACHE_SIZE = "50";
//$NON-NLS-1$
private static final String DEFAULT_MAX_RESULTSET_CACHE_AGE = "3600000";
//$NON-NLS-1$
@@ -623,8 +622,7 @@
metadataService = (MetadataService)
env.findService(DQPServiceNames.METADATA_SERVICE);
// Create the worker pools to tie the queues together
- processWorkerPool = WorkerPoolFactory.newWorkerPool(PROCESS_PLAN_QUEUE_NAME,
PropertiesUtils.getIntProperty(props, DQPConfigSource.PROCESS_POOL_MAX_THREADS,
DEFAULT_MAX_PROCESS_WORKERS),
-
Integer.parseInt(props.getProperty(DQPConfigSource.PROCESS_POOL_THREAD_TTL,
DEAFULT_PROCESS_WORKER_TIMEOUT)));
+ processWorkerPool = WorkerPoolFactory.newWorkerPool(PROCESS_PLAN_QUEUE_NAME,
PropertiesUtils.getIntProperty(props, DQPConfigSource.PROCESS_POOL_MAX_THREADS,
DEFAULT_MAX_PROCESS_WORKERS));
tempTableStoresHolder = new TempTableStoresHolder(bufferManager);
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -51,7 +51,7 @@
private ConnectionPool userIDPool;
private ConnectionPool singleIDPool;
private static ArrayList<Exception> EXCEPTIONS = new
ArrayList<Exception>();
- private static WorkerPool pool =
WorkerPoolFactory.newWorkerPool(TestConnectionPool.class.getSimpleName(), 1, 1000);
+ private static WorkerPool pool =
WorkerPoolFactory.newWorkerPool(TestConnectionPool.class.getSimpleName(), 1);
@AfterClass public static void tearDownOnce() {
pool.shutdownNow();
Modified:
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/SocketListener.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -80,7 +80,7 @@
}
this.server = server;
- this.workerPool = WorkerPoolFactory.newWorkerPool("SocketWorker",
maxWorkers, 120000); //$NON-NLS-1$
+ this.workerPool = WorkerPoolFactory.newWorkerPool("SocketWorker",
maxWorkers); //$NON-NLS-1$
this.nettyPool = Executors.newCachedThreadPool();
if (LogManager.isMessageToBeRecorded(SocketVMController.SOCKET_CONTEXT,
MessageLevel.DETAIL)) {
LogManager.logDetail(SocketVMController.SOCKET_CONTEXT, "server = "
+ this.server + "binding to port:" + port); //$NON-NLS-1$ //$NON-NLS-2$
Modified:
trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditManager.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditManager.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/server/src/main/java/com/metamatrix/platform/security/audit/AuditManager.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -117,14 +117,8 @@
*/
public static final String SYSTEM_AUDIT_CONSOLE_PROPERTY_NAME =
"metamatrix.audit.console"; //$NON-NLS-1$
- /**
- * The name of the configuration property that contains the time to live (in
milliseconds) for threads
- * in the AuditManager. The time to live is simply the period of thread inactivity
- * that determines when a thread may be expired. This is an optional property
- * that defaults to '600000' milliseconds (or 10 minutes).
- */
- public static final String SYSTEM_AUDIT_THREAD_TTL =
"metamatrix.audit.threadTTL"; //$NON-NLS-1$
+
protected static final String DEFAULT_AUDIT_MAX_THREADS = "1";
//$NON-NLS-1$
protected static final String DEFAULT_AUDIT_THREAD_TTL =
"600000"; //$NON-NLS-1$
@@ -228,12 +222,7 @@
private void initializeQueueWorkers() {
try {
- // Create the worker pool
- String threadTTLString = System.getProperty(SYSTEM_AUDIT_THREAD_TTL,
DEFAULT_AUDIT_THREAD_TTL);
- this.workerPool = WorkerPoolFactory.newWorkerPool(
- "AuditQueue", //$NON-NLS-1$
- 1,
- Integer.parseInt(threadTTLString));
+ this.workerPool =
WorkerPoolFactory.newWorkerPool("AuditQueue",1);//$NON-NLS-1$
} catch ( Exception e ) {
LogManager.logError(LogSecurityConstants.CTX_AUDIT,
PlatformPlugin.Util.getString(ErrorMessageKeys.SEC_AUDIT_0007, e));
}
Modified:
trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/server/src/main/java/com/metamatrix/platform/service/proxy/ProxyManager.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -56,7 +56,7 @@
* Thread that updates the service instances of the service selection policies
* when notification of a Registry change event has occurred.
*/
- private WorkerPool updatePool =
WorkerPoolFactory.newWorkerPool("RegistryUpdate", 1, 60000); //$NON-NLS-1$
+ private WorkerPool updatePool =
WorkerPoolFactory.newWorkerPool("RegistryUpdate", 1); //$NON-NLS-1$
ClusteredRegistryState registry;
Modified:
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java 2009-04-20
19:01:03 UTC (rev 806)
+++
trunk/server/src/main/java/com/metamatrix/platform/vm/controller/ProcessController.java 2009-04-20
20:41:11 UTC (rev 807)
@@ -121,8 +121,7 @@
public final static String SERVICE_ID = "Service"; //$NON-NLS-1$
public static final String STARTER_MAX_THREADS = "vm.starter.maxThreads";
//$NON-NLS-1$
- /**Time-to-live for threads used to start services (ms)*/
- public static final String STARTER_TIMETOLIVE = "vm.starter.timetolive";
//$NON-NLS-1$
+
/**Interval to check the state of services (ms)*/
public static final String SERVICE_MONITOR_INTERVAL =
"metamatrix.server.serviceMonitorInterval"; //$NON-NLS-1$
@@ -177,9 +176,8 @@
Properties configProps = CurrentConfiguration.getInstance().getProperties();
int maxThreads = PropertiesUtils.getIntProperty(configProps, STARTER_MAX_THREADS,
DEFAULT_STARTER_MAX_THREADS);
- int timeToLive = PropertiesUtils.getIntProperty(configProps, STARTER_TIMETOLIVE,
DEFAULT_STARTER_TIMETOLIVE);
- this.startServicePool =
WorkerPoolFactory.newWorkerPool("StartServiceQueue", maxThreads, timeToLive);
//$NON-NLS-1$
+ this.startServicePool =
WorkerPoolFactory.newWorkerPool("StartServiceQueue", maxThreads); //$NON-NLS-1$
initVMProperties();