Author: vhalbert(a)redhat.com
Date: 2009-05-18 14:32:05 -0400 (Mon, 18 May 2009)
New Revision: 973
Modified:
trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWrapper.java
trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - exposing the stats
in embedded
Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java 2009-05-18
18:31:12 UTC (rev 972)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java 2009-05-18
18:32:05 UTC (rev 973)
@@ -144,4 +144,14 @@
*/
void clearConnectorBindingCache(String connectorBindingName)
throws MetaMatrixComponentException;
+
+ /**
+ * Get connection pool statistics for connector binding
+ * @param connectorBindingName - Name of the connector binding
+ * @return a list of {@link com.metamatrix.common.stats.ConnectionPoolStats}
+ * @throws MetaMatrixComponentException
+ * @since 6.1
+ */
+ Collection getConnectionPoolStatistics(String connectorBindingName)
+ throws MetaMatrixComponentException;
}
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWrapper.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWrapper.java 2009-05-18
18:31:12 UTC (rev 972)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWrapper.java 2009-05-18
18:32:05 UTC (rev 973)
@@ -39,12 +39,15 @@
public class ConnectorWrapper implements XAConnector {
private Connector actualConnector;
+ private String name;
+
public ConnectorWrapper(Connector actualConnector){
this.actualConnector = actualConnector;
}
public void start(ConnectorEnvironment environment) throws ConnectorException {
+ name = environment.getConnectorName();
actualConnector.start(environment);
}
@@ -123,4 +126,8 @@
return false;
}
}
+
+ public String getConnectorBindingName() {
+ return this.name;
+ }
}
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java 2009-05-18
18:31:12 UTC (rev 972)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java 2009-05-18
18:32:05 UTC (rev 973)
@@ -100,10 +100,12 @@
super(actualConnector);
pool = new ConnectionPool(this);
poolStats = new ConnectionPoolStats(ConnectionPoolStats.NON_XA_POOL_TYPE);
+ poolStats.setConnectorBindingName(this.getConnectorBindingName());
if (actualConnector instanceof XAConnector) {
xaPool = new ConnectionPool(this);
xaPoolStats = new ConnectionPoolStats(ConnectionPoolStats.XA_POOL_TYPE);
+ xaPoolStats.setConnectorBindingName(this.getConnectorBindingName());
}
}
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-05-18
18:31:12 UTC (rev 972)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-05-18
18:32:05 UTC (rev 973)
@@ -396,6 +396,16 @@
}
return getQueueStatistics();
}
+
+ /**
+ * Returns a QueueStats object that represent the queue in
+ * this service.
+ * If there is no queue with the given name, an empty Collection is returned.
+ */
+ public Collection getConnectionPoolsStatistics(String connectorBindingName) {
+
+
+ }
/**
* Cancel and close all requests associated with the clientConnection/session. Also
runs a final cleanup any caches within
Modified: trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java
===================================================================
---
trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java 2009-05-18
18:31:12 UTC (rev 972)
+++
trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java 2009-05-18
18:32:05 UTC (rev 973)
@@ -29,14 +29,17 @@
import java.util.Iterator;
import java.util.List;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
import org.teiid.dqp.internal.datamgr.impl.ConnectorWorkItem;
import org.teiid.dqp.internal.process.DQPWorkContext;
+import com.metamatrix.api.exception.ComponentNotFoundException;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.application.exception.ApplicationLifecycleException;
import com.metamatrix.common.comm.api.ResultsReceiver;
import com.metamatrix.common.config.api.ConnectorBinding;
import com.metamatrix.common.types.DataTypeManager;
+import com.metamatrix.dqp.embedded.DQPEmbeddedPlugin;
import com.metamatrix.dqp.internal.datamgr.ConnectorID;
import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.AtomicRequestMessage;
@@ -215,6 +218,14 @@
public Collection getConnectorBindingStatistics(String connectorBindingName) throws
MetaMatrixComponentException {
return null;
}
+
+ /**
+ * @see
com.metamatrix.dqp.service.DataService#getConnectionPoolStatistics(java.lang.String)
+ * @since 6.1
+ */
+ public Collection getConnectionPoolStatistics(String connectorBindingName) throws
MetaMatrixComponentException {
+ return null;
+ }
/**
* @see
com.metamatrix.dqp.service.DataService#clearConnectorBindingCache(java.lang.String)
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2009-05-18
18:31:12 UTC (rev 972)
+++
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2009-05-18
18:32:05 UTC (rev 973)
@@ -29,6 +29,8 @@
import java.util.Map;
import java.util.Properties;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
+
import junit.framework.TestCase;
import com.metamatrix.api.exception.ComponentNotFoundException;
@@ -42,6 +44,7 @@
import com.metamatrix.common.buffer.TupleBatch;
import com.metamatrix.common.comm.api.ResultsReceiver;
import com.metamatrix.common.config.api.ConnectorBinding;
+import com.metamatrix.dqp.embedded.DQPEmbeddedPlugin;
import com.metamatrix.dqp.internal.datamgr.ConnectorID;
import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.AtomicRequestMessage;
@@ -370,6 +373,8 @@
public Boolean getConnectorBindingState(String connectorBindingName) throws
MetaMatrixComponentException {return null;}
public ConnectorBinding getConnectorBinding(String connectorBindingName) throws
MetaMatrixComponentException {return null;}
public Collection getConnectorBindingStatistics(String connectorBindingName)
throws MetaMatrixComponentException {return null;}
+ public Collection getConnectionPoolStatistics(String connectorBindingName) throws
MetaMatrixComponentException { return null; }
+
public void clearConnectorBindingCache(String connectorBindingName) throws
MetaMatrixComponentException {}
public void cancelRequest(AtomicRequestID request,
Show replies by date