teiid SVN: r1363 - in trunk: engine/src/main/java/org/teiid/dqp/internal/datamgr/impl and 6 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-09-16 13:35:24 -0400 (Wed, 16 Sep 2009)
New Revision: 1363
Removed:
trunk/test-integration/common/src/test/java/com/metamatrix/connector/jdbc/oracle/
Modified:
trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/AsynchConnectorWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWrapper.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/SynchConnectorWorkItem.java
trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java
trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionProvider.java
trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java
trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestPooledConnector.java
trunk/txn-jbossts/src/main/java/com/arjuna/ats/internal/jta/transaction/arjunacore/jca/XATerminatorImple.java
trunk/txn-jbossts/src/main/java/com/arjuna/ats/internal/jta/transaction/arjunacore/subordinate/SubordinateAtomicAction.java
Log:
TEIID-833 initial changes to transaction handling to move transaction interactions primarily to the pooled connector
Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java 2009-09-16 17:09:12 UTC (rev 1362)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/TransactionService.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -28,6 +28,7 @@
import javax.transaction.InvalidTransactionException;
import javax.transaction.SystemException;
+import javax.transaction.TransactionManager;
import javax.transaction.xa.XAResource;
import javax.transaction.xa.Xid;
@@ -50,12 +51,13 @@
public static final String TXN_STATUS_PORT = "xa.txnstatus_port"; //$NON-NLS-1$
public static final String TXN_ENABLE_RECOVERY = "xa.enable_recovery"; //$NON-NLS-1$
-
public static final String PROCESSNAME = DQPEmbeddedProperties.PROCESSNAME;
public static final String DEFAULT_TXN_MGR_LOG_DIR = "txnlog"; //$NON-NLS-1$
public static final String DEFAULT_TXN_TIMEOUT = "120"; //$NON-NLS-1$ //2 mins
public static final String DEFAULT_TXN_STATUS_PORT = "0"; //$NON-NLS-1$
+
+ TransactionManager getTransactionManager();
// processor level methods
TransactionContext start(TransactionContext context) throws XATransactionException, SystemException;
@@ -66,29 +68,16 @@
TransactionContext getOrCreateTransactionContext(String threadId);
- // local transaction
+ // local transaction methods
TransactionContext begin(String threadId) throws XATransactionException, SystemException;
void commit(String threadId) throws XATransactionException, SystemException;
void rollback(String threadId) throws XATransactionException, SystemException;
- // connector worker
- TransactionContext delist(TransactionContext context,
- XAResource resource,
- int flags) throws XATransactionException;
-
- TransactionContext enlist(TransactionContext context,
- XAResource resource) throws XATransactionException;
-
void cancelTransactions(String threadId, boolean requestOnly) throws InvalidTransactionException, SystemException;
-
- // recovery
- void registerRecoverySource(String name, XAConnectionSource resource);
-
- void removeRecoverySource(String name);
-
+ // global transaction methods
int prepare(final String threadId,
MMXid xid) throws XATransactionException;
@@ -113,9 +102,19 @@
MMXid xid,
int flags) throws XATransactionException;
+ // management methods
Collection<Transaction> getTransactions();
void terminateTransaction(Xid transactionId) throws AdminException;
void terminateTransaction(String transactionId, String sessionId) throws AdminException;
+
+ // Teiid managed XA
+ TransactionContext enlist(TransactionContext context,
+ XAResource resource) throws XATransactionException;
+
+ void registerRecoverySource(String name, XAConnectionSource resource);
+
+ void removeRecoverySource(String name);
+
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/AsynchConnectorWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/AsynchConnectorWorkItem.java 2009-09-16 17:09:12 UTC (rev 1362)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/AsynchConnectorWorkItem.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -22,15 +22,9 @@
package org.teiid.dqp.internal.datamgr.impl;
-import org.teiid.connector.api.Connector;
-import org.teiid.connector.api.ConnectorException;
-
-import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.comm.api.ResultsReceiver;
-import com.metamatrix.core.util.Assertion;
import com.metamatrix.dqp.message.AtomicRequestMessage;
import com.metamatrix.dqp.message.AtomicResultsMessage;
-import com.metamatrix.query.metadata.QueryMetadataInterface;
public class AsynchConnectorWorkItem extends ConnectorWorkItem {
@@ -39,14 +33,6 @@
}
@Override
- protected void createConnection(Connector connector,
- QueryMetadataInterface queryMetadata) throws ConnectorException,
- MetaMatrixComponentException {
- super.createConnection(connector, queryMetadata);
- Assertion.assertTrue(!this.isTransactional, "Asynch work items are not suitable for transactions"); //$NON-NLS-1$
- }
-
- @Override
protected boolean dataNotAvailable(long delay) {
this.manager.scheduleTask(this, delay);
return false;
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-09-16 17:09:12 UTC (rev 1362)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -30,7 +30,6 @@
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
-import java.sql.SQLException;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@@ -38,8 +37,6 @@
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
-import javax.transaction.xa.XAResource;
-
import org.teiid.connector.api.Connection;
import org.teiid.connector.api.Connector;
import org.teiid.connector.api.ConnectorCapabilities;
@@ -51,14 +48,12 @@
import org.teiid.connector.api.ConnectorAnnotations.SynchronousWorkers;
import org.teiid.connector.metadata.runtime.ConnectorMetadata;
import org.teiid.connector.metadata.runtime.MetadataFactory;
-import org.teiid.connector.xa.api.XAConnection;
import org.teiid.connector.xa.api.XAConnector;
import org.teiid.dqp.internal.cache.DQPContextCache;
import org.teiid.dqp.internal.cache.ResultSetCache;
import org.teiid.dqp.internal.datamgr.CapabilitiesConverter;
import org.teiid.dqp.internal.pooling.connector.PooledConnector;
import org.teiid.dqp.internal.process.DQPWorkContext;
-import org.teiid.dqp.internal.transaction.TransactionProvider;
import com.metamatrix.admin.objects.MMConnectionPool;
import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -189,7 +184,7 @@
context.setContextCache(getContextCache());
- conn = connector.getConnection(context);
+ conn = connector.getConnection(context, null);
caps = conn.getCapabilities();
global = false;
}
@@ -436,61 +431,18 @@
} catch (MetaMatrixCoreException e) {
throw new ApplicationLifecycleException(e, DQPPlugin.Util.getString("failed_find_Connector_class", connectorClassName)); //$NON-NLS-1$
}
- if (this.isXa) {
- if(!(c instanceof XAConnector)){
- throw new ApplicationLifecycleException(DQPPlugin.Util.getString("non_xa_connector", connectorName)); //$NON-NLS-1$
- }
- if (this.getTransactionService() == null) {
- throw new ApplicationLifecycleException(DQPPlugin.Util.getString("no_txn_manager", connectorName)); //$NON-NLS-1$
- }
- }
if (this.synchWorkers) {
SynchronousWorkers synchWorkerAnnotation = c.getClass().getAnnotation(SynchronousWorkers.class);
if (synchWorkerAnnotation != null) {
this.synchWorkers = synchWorkerAnnotation.enabled();
}
+ if (!this.synchWorkers) {
+ LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Changing asynch connector", getName(), "to non-XA. Consider changing you're connector binding to be non-XA."); //$NON-NLS-1$ //$NON-NLS-2$
+ this.isXa = false;
+ }
}
- c = wrapPooledConnector(c, env);
- if (c instanceof ConnectorWrapper) {
- this.connector = (ConnectorWrapper)c;
- } else {
- this.connector = new ConnectorWrapper(c);
- }
+ this.connector = wrapConnector(c, env);
this.connector.start(env);
- if (this.isXa) {
- if (this.connector.supportsSingleIdentity()) {
- // add this connector as the recovery source
- TransactionService ts = this.getTransactionService();
- ts.registerRecoverySource(connectorName, new TransactionProvider.XAConnectionSource() {
- XAConnection conn = null;
-
- @Override
- public XAResource getXAResource() throws SQLException {
- if (conn == null) {
- try {
- conn = ((XAConnector)connector).getXAConnection(null, null);
- } catch (ConnectorException e) {
- throw new SQLException(e);
- }
- }
- try {
- return conn.getXAResource();
- } catch (ConnectorException e) {
- throw new SQLException(e);
- }
- }
-
- @Override
- public void close() {
- if (conn != null) {
- conn.close();
- }
- }
- });
- } else {
- LogManager.logWarning(LogConstants.CTX_CONNECTOR, DQPPlugin.Util.getString("ConnectorManager.cannot_add_to_recovery", this.getName())); //$NON-NLS-1$
- }
- }
} catch (ConnectorException e) {
throw new ApplicationLifecycleException(e, DQPPlugin.Util.getString("failed_start_Connector", new Object[] {this.getConnectorID(), e.getMessage()})); //$NON-NLS-1$
} finally {
@@ -498,7 +450,7 @@
}
}
- private Connector wrapPooledConnector(Connector c, ConnectorEnvironment connectorEnv) {
+ private ConnectorWrapper wrapConnector(Connector c, ConnectorEnvironment connectorEnv) throws ApplicationLifecycleException {
//the pooling annotation overrides the connector binding
ConnectionPooling connectionPooling = c.getClass().getAnnotation(ConnectionPooling.class);
boolean connectionPoolPropertyEnabled = PropertiesUtils.getBooleanProperty(connectorEnv.getProperties(), ConnectorPropertyNames.CONNECTION_POOL_ENABLED, true);
@@ -509,14 +461,22 @@
} else {
poolingEnabled = connectionPooling != null && connectionPooling.enabled();
}
+ if (this.isXa) {
+ if(poolingEnabled && !(c instanceof XAConnector)){
+ throw new ApplicationLifecycleException(DQPPlugin.Util.getString("non_xa_connector", connectorName)); //$NON-NLS-1$
+ }
+ if (this.getTransactionService() == null) {
+ throw new ApplicationLifecycleException(DQPPlugin.Util.getString("no_txn_manager", connectorName)); //$NON-NLS-1$
+ }
+ }
if (poolingEnabled) {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, "Automatic connection pooling was enabled for connector " + getName()); //$NON-NLS-1$
if (!this.synchWorkers) {
LogManager.logWarning(LogConstants.CTX_CONNECTOR, DQPPlugin.Util.getString("ConnectorManager.asynch_worker_warning", ConnectorPropertyNames.SYNCH_WORKERS)); //$NON-NLS-1$
}
- return new PooledConnector(c);
+ return new PooledConnector(this.connectorName, c, isXa?this.getTransactionService():null);
}
- return c;
+ return new ConnectorWrapper(c);
}
protected ResultSetCache createResultSetCache(Properties rsCacheProps) {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java 2009-09-16 17:09:12 UTC (rev 1362)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWorkItem.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -26,8 +26,10 @@
import java.util.Arrays;
import java.util.List;
+import javax.transaction.InvalidTransactionException;
+import javax.transaction.SystemException;
+
import org.teiid.connector.api.Connection;
-import org.teiid.connector.api.Connector;
import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.api.DataNotAvailableException;
import org.teiid.connector.api.Execution;
@@ -38,7 +40,6 @@
import org.teiid.connector.language.IProcedure;
import org.teiid.connector.language.IQueryCommand;
import org.teiid.connector.metadata.runtime.RuntimeMetadata;
-import org.teiid.connector.xa.api.XAConnector;
import org.teiid.dqp.internal.datamgr.language.LanguageBridgeFactory;
import org.teiid.dqp.internal.datamgr.metadata.RuntimeMetadataImpl;
import org.teiid.dqp.internal.process.AbstractWorkItem;
@@ -123,23 +124,28 @@
this.securityContext.setContextCache(manager.getContextCache());
}
- protected void createConnection(Connector connector, QueryMetadataInterface queryMetadata) throws ConnectorException, MetaMatrixComponentException {
+ protected void createConnection(ConnectorWrapper connector, QueryMetadataInterface queryMetadata) throws ConnectorException, MetaMatrixComponentException {
LogManager.logTrace(LogConstants.CTX_CONNECTOR, new Object[] {id, "creating connection for atomic-request"}); //$NON-NLS-1$
if (requestMsg.isTransactional()){
if (manager.isXa()) {
- connection = ((XAConnector)connector).getXAConnection(this.securityContext, requestMsg.getTransactionContext());
this.securityContext.setTransactional(true);
this.isTransactional = true;
- return;
- }
- if (!manager.isImmutable() && requestMsg.getCommand().updatingModelCount(queryMetadata) > 0) {
+ try {
+ manager.getTransactionService().getTransactionManager().resume(requestMsg.getTransactionContext().getTransaction());
+ } catch (InvalidTransactionException e) {
+ throw new ConnectorException(e);
+ } catch (SystemException e) {
+ throw new ConnectorException(e);
+ }
+ } else if (!manager.isImmutable() && requestMsg.getCommand().updatingModelCount(queryMetadata) > 0) {
throw new ConnectorException(DQPPlugin.Util.getString("ConnectorWorker.transactionNotSupported")); //$NON-NLS-1$
}
}
- connection = connector.getConnection(this.securityContext);
+
+ connection = connector.getConnection(this.securityContext, this.isTransactional?requestMsg.getTransactionContext():null);
}
-
+
protected void process() {
DQPWorkContext.setWorkContext(this.requestMsg.getWorkContext());
ClassLoader contextloader = Thread.currentThread().getContextClassLoader();
@@ -269,7 +275,14 @@
}
}
- protected void sendClose() {
+ private void sendClose() {
+ if (this.isTransactional) {
+ try {
+ manager.getTransactionService().getTransactionManager().suspend();
+ } catch (SystemException e) {
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR, e, e.getMessage());
+ }
+ }
AtomicResultsMessage response = new AtomicResultsMessage(this.requestMsg);
response.setRequestClosed(true);
this.resultsReceiver.receiveResults(response);
@@ -284,7 +297,7 @@
}
protected void createExecution() throws MetaMatrixComponentException,
- ConnectorException, MetaMatrixProcessingException {
+ ConnectorException {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {this.requestMsg.getAtomicRequestID(), "Processing NEW request:", this.requestMsg.getCommand()}); //$NON-NLS-1$
QueryMetadataInterface queryMetadata = new TempMetadataAdapter(manager.getMetadataService().lookupMetadata(this.requestMsg.getWorkContext().getVdbName(), this.requestMsg.getWorkContext().getVdbVersion()), new TempMetadataStore());
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-09-16 17:09:12 UTC (rev 1362)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorWrapper.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -44,10 +44,9 @@
/**
* ConnectorWrapper adds default behavior to the wrapped connector.
*/
-public class ConnectorWrapper implements XAConnector, MetadataProvider {
+public class ConnectorWrapper implements MetadataProvider {
private Connector actualConnector;
- private String name;
private volatile ConnectorStatus status = ConnectorStatus.UNABLE_TO_CHECK;
public ConnectorWrapper(Connector actualConnector){
@@ -55,7 +54,6 @@
}
public void start(ConnectorEnvironment environment) throws ConnectorException {
- name = environment.getConnectorName();
actualConnector.start(environment);
int interval = PropertiesUtils.getIntProperty(environment.getProperties(), ConnectionPool.SOURCE_CONNECTION_TEST_INTERVAL, ConnectionPool.DEFAULT_SOURCE_CONNECTION_TEST_INTERVAL);
if (interval > 0 && isConnectionTestable()) {
@@ -76,24 +74,22 @@
actualConnector.stop();
}
- @Override
- public final Connection getConnection(ExecutionContext context)
- throws ConnectorException {
- setIdentity(context);
- return getConnectionDirect(context);
+ public final Connection getConnection(ExecutionContext context, TransactionContext transactionContext)
+ throws ConnectorException {
+ if (context instanceof ExecutionContextImpl && context.getConnectorIdentity() == null) {
+ ((ExecutionContextImpl)context).setConnectorIdentity(createIdentity(context));
+ }
+ if (transactionContext == null) {
+ return getConnectionDirect(context);
+ }
+ return getXAConnectionDirect(context, transactionContext);
}
-
+
protected Connection getConnectionDirect(ExecutionContext context)
throws ConnectorException {
return actualConnector.getConnection(context);
}
- @Override
- public final XAConnection getXAConnection( ExecutionContext executionContext, TransactionContext transactionContext) throws ConnectorException {
- setIdentity(executionContext);
- return getXAConnectionDirect(executionContext, transactionContext);
- }
-
protected XAConnection getXAConnectionDirect(ExecutionContext executionContext,
TransactionContext transactionContext) throws ConnectorException {
if (actualConnector instanceof XAConnector) {
@@ -102,13 +98,6 @@
return null;
}
- private void setIdentity(ExecutionContext executionContext)
- throws ConnectorException {
- if (executionContext instanceof ExecutionContextImpl && executionContext.getConnectorIdentity() == null) {
- ((ExecutionContextImpl)executionContext).setConnectorIdentity(createIdentity(executionContext));
- }
- }
-
public ConnectorCapabilities getCapabilities() {
return actualConnector.getCapabilities();
}
@@ -125,7 +114,7 @@
if (supportsSingleIdentity()) {
Connection conn = null;
try {
- conn = this.getConnection(null);
+ conn = this.getConnectionDirect(null);
return conn.isAlive()?ConnectorStatus.OPEN:ConnectorStatus.DATA_SOURCE_UNAVAILABLE;
} catch (ConnectorException e) {
return ConnectorStatus.DATA_SOURCE_UNAVAILABLE;
@@ -142,7 +131,6 @@
return actualConnector;
}
- @Override
public ConnectorIdentity createIdentity(ExecutionContext context)
throws ConnectorException {
return actualConnector.createIdentity(context);
@@ -156,10 +144,6 @@
}
}
- public String getConnectorBindingName() {
- return this.name;
- }
-
@Override
public void getConnectorMetadata(MetadataFactory metadataFactory)
throws ConnectorException {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/SynchConnectorWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/SynchConnectorWorkItem.java 2009-09-16 17:09:12 UTC (rev 1362)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/SynchConnectorWorkItem.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -26,19 +26,10 @@
import java.util.Map;
import java.util.concurrent.Semaphore;
-import javax.transaction.xa.XAResource;
-
-import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.xa.api.XAConnection;
-
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.MetaMatrixProcessingException;
import com.metamatrix.common.comm.api.ResultsReceiver;
import com.metamatrix.common.log.LogManager;
-import com.metamatrix.common.xa.XATransactionException;
import com.metamatrix.dqp.message.AtomicRequestMessage;
import com.metamatrix.dqp.message.AtomicResultsMessage;
-import com.metamatrix.dqp.service.TransactionService;
import com.metamatrix.dqp.util.LogConstants;
public class SynchConnectorWorkItem extends ConnectorWorkItem {
@@ -94,45 +85,6 @@
this.notify();
}
- @Override
- protected void createExecution() throws MetaMatrixComponentException,
- ConnectorException, MetaMatrixProcessingException {
- super.createExecution();
- enlistResource();
- }
-
- @Override
- protected void sendClose() {
- delistResource();
- super.sendClose();
- }
-
- private void enlistResource() throws ConnectorException,
- XATransactionException {
- if (!this.isTransactional || this.connection == null) {
- return;
- }
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {
- "AtomicRequest", id, "enlist(" + requestMsg.getTransactionContext() + ")" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- XAResource xaRes = ((XAConnection) connection).getXAResource();
- getTransactionServer().enlist(requestMsg.getTransactionContext(), xaRes);
- }
-
- private void delistResource() {
- if (!this.isTransactional || this.connection == null) {
- return;
- }
- try {
- LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {
- "AtomicRequest", id, "delist(" + requestMsg.getTransactionContext() + ")" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- XAResource xaRes = ((XAConnection) connection).getXAResource();
- getTransactionServer().delist(requestMsg.getTransactionContext(),
- xaRes, XAResource.TMSUCCESS);
- } catch (Throwable e) {
- LogManager.logWarning(LogConstants.CTX_CONNECTOR, e.getMessage());
- }
- }
-
private void acquireTransactionLock() throws InterruptedException {
if (!this.isTransactional) {
return;
@@ -167,10 +119,6 @@
this.lock = null;
}
- private TransactionService getTransactionServer() {
- return manager.getTransactionService();
- }
-
@Override
protected boolean dataNotAvailable(long delay) {
LogManager.logDetail(LogConstants.CTX_CONNECTOR, new Object[] {
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-09-16 17:09:12 UTC (rev 1362)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -22,6 +22,7 @@
package org.teiid.dqp.internal.pooling.connector;
+import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -31,6 +32,7 @@
import javax.transaction.RollbackException;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
+import javax.transaction.xa.XAResource;
import org.teiid.connector.api.Connection;
import org.teiid.connector.api.Connector;
@@ -41,9 +43,15 @@
import org.teiid.connector.xa.api.XAConnection;
import org.teiid.connector.xa.api.XAConnector;
import org.teiid.dqp.internal.datamgr.impl.ConnectorWrapper;
+import org.teiid.dqp.internal.transaction.TransactionProvider;
import com.metamatrix.admin.objects.MMConnectionPool;
+import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.xa.XATransactionException;
+import com.metamatrix.dqp.DQPPlugin;
import com.metamatrix.dqp.service.ConnectorStatus;
+import com.metamatrix.dqp.service.TransactionService;
+import com.metamatrix.dqp.util.LogConstants;
/**
@@ -93,14 +101,17 @@
private Map<String, ConnectionWrapper> idToConnections = Collections.synchronizedMap(new HashMap<String, ConnectionWrapper>());
private ConnectorEnvironment environment;
+ private TransactionService transactionService;
+ private String name;
- public PooledConnector(Connector actualConnector) {
+ public PooledConnector(String name, Connector actualConnector, TransactionService transactionService) {
super(actualConnector);
pool = new ConnectionPool(this);
-
+ this.transactionService = transactionService;
if (actualConnector instanceof XAConnector) {
xaPool = new ConnectionPool(this);
}
+ this.name = name;
}
@Override
@@ -112,6 +123,39 @@
xaPool.initialize(environment);
}
super.start(environment);
+ if (this.transactionService != null) {
+ if (this.supportsSingleIdentity()) {
+ // add this connector as the recovery source
+ transactionService.registerRecoverySource(this.name, new TransactionProvider.XAConnectionSource() {
+ XAConnection conn = null;
+
+ @Override
+ public XAResource getXAResource() throws SQLException {
+ if (conn == null) {
+ try {
+ conn = getXAConnectionDirect(null, null);
+ } catch (ConnectorException e) {
+ throw new SQLException(e);
+ }
+ }
+ try {
+ return conn.getXAResource();
+ } catch (ConnectorException e) {
+ throw new SQLException(e);
+ }
+ }
+
+ @Override
+ public void close() {
+ if (conn != null) {
+ conn.close();
+ }
+ }
+ });
+ } else {
+ LogManager.logWarning(LogConstants.CTX_CONNECTOR, DQPPlugin.Util.getString("ConnectorManager.cannot_add_to_recovery", this.name)); //$NON-NLS-1$
+ }
+ }
}
@Override
@@ -153,6 +197,13 @@
if (environment.getLogger().isTraceEnabled()) {
environment.getLogger().logTrace("Obtained new connection for transaction " + transactionContext.getTxnID()); //$NON-NLS-1$
}
+ XAResource xaRes = conn.getXAResource();
+ try {
+ transactionService.enlist(transactionContext, xaRes);
+ } catch (XATransactionException e) {
+ conn.close();
+ throw new ConnectorException(e);
+ }
try { //add a synchronization to remove the map entry
transactionContext.getTransaction().registerSynchronization(new RemovalCallback(transactionContext, conn));
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionProvider.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionProvider.java 2009-09-16 17:09:12 UTC (rev 1362)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionProvider.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -26,6 +26,7 @@
import java.util.Properties;
import javax.resource.spi.XATerminator;
+import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
import javax.transaction.xa.XAException;
@@ -51,7 +52,7 @@
TransactionManager getTransactionManager();
- Transaction importTransaction(MMXid xid, int timeout) throws XAException;
+ Transaction importTransaction(MMXid xid, int timeout) throws XAException, SystemException;
String getTransactionID(Transaction tx);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java 2009-09-16 17:09:12 UTC (rev 1362)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -249,7 +249,9 @@
tx = this.provider.importTransaction(xid, timeout);
} catch (XAException err) {
throw new XATransactionException(err);
- }
+ } catch (SystemException err) {
+ throw new XATransactionException(err);
+ }
try {
tx.registerSynchronization(new Synchronization() {
@@ -444,7 +446,7 @@
}
}
- private TransactionManager getTransactionManager() {
+ public TransactionManager getTransactionManager() {
return provider.getTransactionManager();
}
@@ -520,53 +522,20 @@
return context;
}
- public TransactionContext delist(TransactionContext context,
- XAResource resource,
- int flags) throws XATransactionException {
- TransactionManager tm = getTransactionManager();
- TransactionContextImpl tc = (TransactionContextImpl)context;
-
- try {
- Transaction tx = tm.getTransaction();
- if (!tx.equals(context.getTransaction())) {
- throw new XATransactionException(context.getTransaction() + " != " + tx); //$NON-NLS-1$
- }
-
- // intermediate suspend/success is not necessary because we hold the connector connection
- // for the duration of the transaction. However, we want to suspend because
- // ConnectorWorker thread needs to be disassociated.
- } catch (SystemException err) {
- throw new XATransactionException(err);
- } catch (IllegalStateException err) {
- throw new XATransactionException(err);
- } finally {
- try {
- tm.suspend();
- } catch (SystemException err) {
- throw new XATransactionException(err);
- }
- }
- return tc;
- }
-
public TransactionContext enlist(TransactionContext context,
XAResource resource) throws XATransactionException {
TransactionManager tm = getTransactionManager();
TransactionContextImpl tc = (TransactionContextImpl)context;
try {
- if (tc.getTransactionTimeout() > 0) {
- if (tc.getTransactionTimeout() != resource.getTransactionTimeout()) {
- resource.setTransactionTimeout(tc.getTransactionTimeout());
- }
+ if (tc.getTransactionTimeout() > 0 && tc.getTransactionTimeout() != resource.getTransactionTimeout()) {
+ resource.setTransactionTimeout(tc.getTransactionTimeout());
}
Transaction tx = tm.getTransaction();
if (tx == null) {
tm.resume(context.getTransaction());
- } else {
- if (!tx.equals(context.getTransaction())) {
- throw new XATransactionException(context.getTransaction() + " != " + tx); //$NON-NLS-1$
- }
+ } else if (!tx.equals(context.getTransaction())) {
+ throw new XATransactionException(context.getTransaction() + " != " + tx); //$NON-NLS-1$
}
if (!context.getTransaction().enlistResource(resource)) {
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestPooledConnector.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestPooledConnector.java 2009-09-16 17:09:12 UTC (rev 1362)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestPooledConnector.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -31,28 +31,29 @@
import org.junit.Test;
import org.mockito.Mockito;
+import org.teiid.connector.api.Connection;
import org.teiid.connector.api.ConnectorLogger;
import org.teiid.connector.api.ExecutionContext;
import org.teiid.connector.xa.api.TransactionContext;
-import org.teiid.connector.xa.api.XAConnection;
import org.teiid.connector.xa.api.XAConnector;
import org.teiid.dqp.internal.datamgr.impl.ConnectorEnvironmentImpl;
import com.metamatrix.admin.objects.MMConnectionPool;
import com.metamatrix.common.application.ApplicationEnvironment;
+import com.metamatrix.dqp.service.TransactionService;
public class TestPooledConnector {
@Test public void testGetXAConnection() throws Exception {
XAConnector connector = Mockito.mock(XAConnector.class);
- PooledConnector pc = new PooledConnector(connector);
+ PooledConnector pc = new PooledConnector("foo", connector, Mockito.mock(TransactionService.class)); //$NON-NLS-1$
pc.start(new ConnectorEnvironmentImpl(new Properties(), Mockito.mock(ConnectorLogger.class), new ApplicationEnvironment()));
TransactionContext tc = Mockito.mock(TransactionContext.class);
Mockito.stub(tc.getTransaction()).toReturn(Mockito.mock(Transaction.class));
Mockito.stub(tc.getTxnID()).toReturn("1"); //$NON-NLS-1$
- XAConnection conn = pc.getXAConnection(Mockito.mock(ExecutionContext.class), tc);
+ Connection conn = pc.getConnection(Mockito.mock(ExecutionContext.class), tc);
conn.close();
- XAConnection conn1 = pc.getXAConnection(Mockito.mock(ExecutionContext.class), tc);
+ Connection conn1 = pc.getConnection(Mockito.mock(ExecutionContext.class), tc);
assertSame(conn, conn1);
List<MMConnectionPool> stats = pc.getConnectionPoolStats();
Modified: trunk/txn-jbossts/src/main/java/com/arjuna/ats/internal/jta/transaction/arjunacore/jca/XATerminatorImple.java
===================================================================
--- trunk/txn-jbossts/src/main/java/com/arjuna/ats/internal/jta/transaction/arjunacore/jca/XATerminatorImple.java 2009-09-16 17:09:12 UTC (rev 1362)
+++ trunk/txn-jbossts/src/main/java/com/arjuna/ats/internal/jta/transaction/arjunacore/jca/XATerminatorImple.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -58,7 +58,7 @@
*/
/*
- * See JBTM-456
+ * To be removed after 4.5 See JBTM-456
*/
public class XATerminatorImple implements javax.resource.spi.XATerminator
{
Modified: trunk/txn-jbossts/src/main/java/com/arjuna/ats/internal/jta/transaction/arjunacore/subordinate/SubordinateAtomicAction.java
===================================================================
--- trunk/txn-jbossts/src/main/java/com/arjuna/ats/internal/jta/transaction/arjunacore/subordinate/SubordinateAtomicAction.java 2009-09-16 17:09:12 UTC (rev 1362)
+++ trunk/txn-jbossts/src/main/java/com/arjuna/ats/internal/jta/transaction/arjunacore/subordinate/SubordinateAtomicAction.java 2009-09-16 17:35:24 UTC (rev 1363)
@@ -42,7 +42,7 @@
*/
/*
- * see JBTM-457
+ * To be removed after 4.5 see JBTM-457
*/
public class SubordinateAtomicAction extends
com.arjuna.ats.internal.jta.transaction.arjunacore.AtomicAction
16 years, 7 months
teiid SVN: r1362 - in branches/6.2.x: connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-09-16 13:09:12 -0400 (Wed, 16 Sep 2009)
New Revision: 1362
Modified:
branches/6.2.x/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCProcedureExecution.java
branches/6.2.x/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCProcedureExecution.java
branches/6.2.x/documentation/salesforce-connector-guide/
Log:
TEIID-831 fix for invalid index with out parameters and in parameters
Modified: branches/6.2.x/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCProcedureExecution.java
===================================================================
--- branches/6.2.x/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCProcedureExecution.java 2009-09-15 20:21:08 UTC (rev 1361)
+++ branches/6.2.x/connectors/connector-jdbc/src/main/java/org/teiid/connector/jdbc/JDBCProcedureExecution.java 2009-09-16 17:09:12 UTC (rev 1362)
@@ -115,10 +115,14 @@
}
}
for (IParameter parameter : proc.getParameters()) {
- if (parameter.getDirection() == Direction.RETURN || parameter.getDirection() == Direction.RESULT_SET) {
+ switch (parameter.getDirection()) {
+ case IN:
+ paramIndex++;
+ case RETURN:
+ case RESULT_SET:
continue;
- }
- if (parameter.getDirection() == Direction.INOUT || parameter.getDirection() == Direction.OUT) {
+ case INOUT:
+ case OUT:
addParameterValue(result, paramIndex++, parameter);
}
}
Modified: branches/6.2.x/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCProcedureExecution.java
===================================================================
--- branches/6.2.x/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCProcedureExecution.java 2009-09-15 20:21:08 UTC (rev 1361)
+++ branches/6.2.x/connectors/connector-jdbc/src/test/java/org/teiid/connector/jdbc/TestJDBCProcedureExecution.java 2009-09-16 17:09:12 UTC (rev 1362)
@@ -58,5 +58,21 @@
assertEquals(Arrays.asList(5), procedureExecution.getOutputParameterValues());
Mockito.verify(cs, Mockito.times(1)).registerOutParameter(1, Types.INTEGER);
}
+
+ @Test public void testProcedureExecution1() throws Exception {
+ ICommand command = MetadataFactory.helpTranslate(MetadataFactory.BQT_VDB, "exec pm2.spTest8(1)"); //$NON-NLS-1$
+ Connection connection = Mockito.mock(Connection.class);
+ CallableStatement cs = Mockito.mock(CallableStatement.class);
+ Mockito.stub(cs.getUpdateCount()).toReturn(-1);
+ Mockito.stub(cs.getInt(2)).toReturn(5);
+ Mockito.stub(connection.prepareCall("{ call spTest8(?,?)}")).toReturn(cs); //$NON-NLS-1$
+ Translator sqlTranslator = new Translator();
+ ExecutionContext context = EnvironmentUtility.createSecurityContext("user"); //$NON-NLS-1$
+ RuntimeMetadataImpl runtimeMetadata = new RuntimeMetadataImpl(FakeMetadataFactory.exampleBQTCached());
+ JDBCProcedureExecution procedureExecution = new JDBCProcedureExecution(command, connection, sqlTranslator, Mockito.mock(ConnectorLogger.class), new Properties(), runtimeMetadata, context, EnvironmentUtility.createEnvironment(new Properties()) );
+ procedureExecution.execute();
+ assertEquals(Arrays.asList(5), procedureExecution.getOutputParameterValues());
+ Mockito.verify(cs, Mockito.times(1)).registerOutParameter(2, Types.INTEGER);
+ }
}
Property changes on: branches/6.2.x/documentation/salesforce-connector-guide
___________________________________________________________________
Name: svn:ignore
+ .classpath
target
.settings
.project
16 years, 7 months
teiid SVN: r1361 - trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-09-15 16:21:08 -0400 (Tue, 15 Sep 2009)
New Revision: 1361
Added:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
Removed:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
Log:
Teiid 773 - organize integration test - changes to support multiple datasources
Deleted: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java 2009-09-15 20:08:41 UTC (rev 1360)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java 2009-09-15 20:21:08 UTC (rev 1361)
@@ -1,290 +0,0 @@
-/*
- * Copyright (c) 2000-2007 MetaMatrix, Inc.
- * All rights reserved.
- */
-package org.teiid.test.framework.datasource;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.teiid.test.framework.exception.QueryTestFailedException;
-import org.teiid.test.framework.exception.TransactionRuntimeException;
-
-import com.metamatrix.common.xml.XMLReaderWriter;
-import com.metamatrix.common.xml.XMLReaderWriterImpl;
-
-/**
- * The DataSourceMgr is responsible for loading and managing the datasource
- * mapping properties file {@see #DATASOURCE_MAPPING_FILE} and the mapped
- * datasource properties files. The {@link #getDatasourceProperties(String)}
- * returns the properties defined for that datasourceid, which is mapped in the
- * mnappings file. This mapping allows the test
- *
- * @author vanhalbert
- *
- */
-public class DataSourceMgr {
-
- static final String DIRECTORY = "datasources/";
- static final String DATASOURCE_MAPPING_FILE = "datasource_mapping.xml";
-
- private static DataSourceMgr _instance = null;
-
- private Map<String, Map<String, DataSource>>dstypeMap = new HashMap<String, Map<String, DataSource>>(); //key=datasourcetype
-
- private Map<String, DataSource> allDatasourcesMap = new HashMap<String, DataSource>(); // key=datasource name
-
- private Map<String, DataSource> modelToDatasourceMap = new HashMap<String, DataSource>(); // key=modelname
-
- private Set<String> usedDataSources = new HashSet<String>();
-
-
- private DataSourceMgr() {
- }
-
- public static synchronized DataSourceMgr getInstance() {
- if (_instance == null) {
- _instance = new DataSourceMgr();
- try {
- _instance.loadDataSourceMappings();
- } catch (QueryTestFailedException e) {
- // TODO Auto-generated catch block
- throw new TransactionRuntimeException(e);
- } catch (TransactionRuntimeException e) {
- // TODO Auto-generated catch block
- throw e;
- }
-
- }
- return _instance;
- }
-
- public int numberOfAvailDataSources() {
- return allDatasourcesMap.size();
- }
-
- public DataSource getDatasource(String datasourceid, String modelName)
- throws QueryTestFailedException {
- DataSource ds = null;
-
- // map the datasource to the model and datasourceid
- // this is so the next time this combination is requested,
- // the same datasource is returned to ensure when consecutive calls during the process
- // corresponds to the same datasource
- String key = modelName + "_"+datasourceid;
-
- if (modelToDatasourceMap.containsKey(key)) {
- return modelToDatasourceMap.get(key);
- }
- if (dstypeMap.containsKey(datasourceid)) {
-
- Map datasources = dstypeMap.get(datasourceid);
- Iterator<DataSource> it= datasources.values().iterator();
- while(it.hasNext()) {
- DataSource checkit = it.next();
- if (!usedDataSources.contains(checkit.getName())) {
- usedDataSources.add(checkit.getName());
- ds = checkit;
- break;
- }
- }
-
- } else {
- ds = allDatasourcesMap.get(datasourceid);
- }
- if (ds == null) {
- throw new QueryTestFailedException("DatasourceID " + datasourceid
- + " is not a defined datasource in the mappings file ");
-
- }
-
- modelToDatasourceMap.put(key, ds);
- return ds;
-
- }
-
- public Properties getDatasourceProperties(String datasourceid, String modelname)
- throws QueryTestFailedException {
- DataSource ds = getDatasource(datasourceid, modelname);
-
- return ds.getProperties();
-
- }
-
- private void loadDataSourceMappings()
- throws QueryTestFailedException {
-
- Document doc = null;
- XMLReaderWriter readerWriter = new XMLReaderWriterImpl();
-
- try {
- doc = readerWriter.readDocument(getInputStream());
- } catch (JDOMException e) {
- e.printStackTrace();
- throw new TransactionRuntimeException(e);
- } catch (IOException e) {
- e.printStackTrace();
- throw new TransactionRuntimeException(e);
- }
-
- Element root = doc.getRootElement();
- List<Element> rootElements = root.getChildren();
- if (rootElements == null || rootElements.size() == 0) {
- throw new TransactionRuntimeException("No children defined under root element " + DSCONFIG);
- }
-
- for (Iterator<Element> it = rootElements.iterator(); it.hasNext();) {
- Element type = it.next();
-// System.out.println("Loading ds transactional type " + type.getName());
- String typename = type.getAttributeValue(Property.Attributes.NAME);
-
- List<Element> typeElements = type.getChildren();
- if (typeElements != null) {
- Map<String, DataSource> datasources = new HashMap<String, DataSource>(typeElements.size());
-
- for (Iterator<Element> typeit = typeElements.iterator(); typeit.hasNext();) {
- Element e = typeit.next();
-// System.out.println("Loading ds type " + e.getName());
- addDataSource(e, typename, datasources);
- }
- dstypeMap.put(typename, datasources);
- allDatasourcesMap.putAll(datasources);
-
- }
-
-
- }
-
- if (dstypeMap == null || dstypeMap.isEmpty()) {
- throw new TransactionRuntimeException(
- "No Datasources were found in the mappings file");
- }
-
- System.out.println("Number of datasource types loaded " + dstypeMap.size());
- System.out.println("Number of total datasource mappings loaded " + allDatasourcesMap.size());
-
-
-
- }
-
- private static void addDataSource(Element element, String type, Map<String, DataSource> datasources) {
- String name = element.getAttributeValue(Property.Attributes.NAME);
- Properties props = getProperties(element);
-
- String dir = props.getProperty(DataSource.DIRECTORY);
- String dsfile = DIRECTORY + dir + "/connection.properties";
- Properties dsprops = loadProperties(dsfile);
- if (dsprops != null) {
- props.putAll(dsprops);
- DataSource ds = new DataSource(name,
- type,
- props);
- datasources.put(ds.getName(), ds);
- System.out.println("Loaded datasource " + ds.getName());
-
- }
-
- }
-
-
- private static Properties loadProperties(String filename) {
- Properties props = null;
-
- try {
- InputStream in = DataSourceMgr.class.getResourceAsStream("/"
- + filename);
- if (in != null) {
- props = new Properties();
- props.load(in);
- return props;
- }
- return null;
- } catch (IOException e) {
- throw new TransactionRuntimeException("Error loading properties from file '"
- + filename + "'" + e.getMessage());
- }
- }
-
- private static Properties getProperties(Element propertiesElement) {
- Properties props = new Properties();
-
- List<Element> properties = propertiesElement
- .getChildren(Property.ELEMENT);
- Iterator<Element> iterator = properties.iterator();
- while (iterator.hasNext()) {
- Element propertyElement = (Element) iterator.next();
- String propertyName = propertyElement
- .getAttributeValue(Property.Attributes.NAME);
- String propertyValue = propertyElement.getText();
-
- props.setProperty(propertyName, propertyValue);
-
- }
- return props;
- }
-
- private static InputStream getInputStream() {
-
- InputStream in = DataSourceMgr.class.getResourceAsStream("/"
- + DIRECTORY + DATASOURCE_MAPPING_FILE);
- if (in != null) {
-
- return in;
- } else {
- throw new RuntimeException(
- "Failed to load datasource mapping file '" + DIRECTORY
- + DATASOURCE_MAPPING_FILE + "'");
- }
-
- }
-
- static final String DSCONFIG = "datasourceconfig";
- static final String DATASOURCETYPE = "datasourcetype";
- static final String DATASOURCE = "datasource";
-
- static class Property {
-
- /**
- * This is the name of the Property Element.
- */
- public static final String ELEMENT = "property"; //$NON-NLS-1$
-
- /**
- * This class defines the Attributes of the Element class that contains
- * it.
- */
- public static class Attributes {
- public static final String NAME = "name"; //$NON-NLS-1$
- }
-
- }
-
- public static void main(String[] args) {
- DataSourceMgr mgr = DataSourceMgr.getInstance();
-
- try {
- DataSource ds1 = mgr.getDatasource("ds_mysql5", "model1");
-
- DataSource ds2 = mgr.getDatasource("ds_mysql5", "model1");
- if (ds1 != ds2) {
- throw new RuntimeException("Datasources are not the same");
- }
- System.out.println("Value for ds_mysql5: "
- + mgr.getDatasourceProperties("ds_mysql5", "model1"));
- } catch (QueryTestFailedException e) {
- e.printStackTrace();
- }
-
- }
-
-}
Added: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java (rev 0)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java 2009-09-15 20:21:08 UTC (rev 1361)
@@ -0,0 +1,290 @@
+/*
+ * Copyright (c) 2000-2007 MetaMatrix, Inc.
+ * All rights reserved.
+ */
+package org.teiid.test.framework.datasource;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.jdom.Document;
+import org.jdom.Element;
+import org.jdom.JDOMException;
+import org.teiid.test.framework.exception.QueryTestFailedException;
+import org.teiid.test.framework.exception.TransactionRuntimeException;
+
+import com.metamatrix.common.xml.XMLReaderWriter;
+import com.metamatrix.common.xml.XMLReaderWriterImpl;
+
+/**
+ * The DataSourceMgr is responsible for loading and managing the datasource
+ * mapping properties file {@see #DATASOURCE_MAPPING_FILE} and the mapped
+ * datasource properties files. The {@link #getDatasourceProperties(String)}
+ * returns the properties defined for that datasourceid, which is mapped in the
+ * mnappings file. This mapping allows the test
+ *
+ * @author vanhalbert
+ *
+ */
+public class DataSourceMgr {
+
+ static final String DIRECTORY = "datasources/";
+ static final String DATASOURCE_MAPPING_FILE = "datasource_mapping.xml";
+
+ private static DataSourceMgr _instance = null;
+
+ private Map<String, Map<String, DataSource>>dstypeMap = new HashMap<String, Map<String, DataSource>>(); //key=datasourcetype
+
+ private Map<String, DataSource> allDatasourcesMap = new HashMap<String, DataSource>(); // key=datasource name
+
+ private Map<String, DataSource> modelToDatasourceMap = new HashMap<String, DataSource>(); // key=modelname
+
+ private Set<String> usedDataSources = new HashSet<String>();
+
+
+ private DataSourceMgr() {
+ }
+
+ public static synchronized DataSourceMgr getInstance() {
+ if (_instance == null) {
+ _instance = new DataSourceMgr();
+ try {
+ _instance.loadDataSourceMappings();
+ } catch (QueryTestFailedException e) {
+ // TODO Auto-generated catch block
+ throw new TransactionRuntimeException(e);
+ } catch (TransactionRuntimeException e) {
+ // TODO Auto-generated catch block
+ throw e;
+ }
+
+ }
+ return _instance;
+ }
+
+ public int numberOfAvailDataSources() {
+ return allDatasourcesMap.size();
+ }
+
+ public DataSource getDatasource(String datasourceid, String modelName)
+ throws QueryTestFailedException {
+ DataSource ds = null;
+
+ // map the datasource to the model and datasourceid
+ // this is so the next time this combination is requested,
+ // the same datasource is returned to ensure when consecutive calls during the process
+ // corresponds to the same datasource
+ String key = modelName + "_"+datasourceid;
+
+ if (modelToDatasourceMap.containsKey(key)) {
+ return modelToDatasourceMap.get(key);
+ }
+ if (dstypeMap.containsKey(datasourceid)) {
+
+ Map datasources = dstypeMap.get(datasourceid);
+ Iterator<DataSource> it= datasources.values().iterator();
+ while(it.hasNext()) {
+ DataSource checkit = it.next();
+ if (!usedDataSources.contains(checkit.getName())) {
+ usedDataSources.add(checkit.getName());
+ ds = checkit;
+ break;
+ }
+ }
+
+ } else {
+ ds = allDatasourcesMap.get(datasourceid);
+ }
+ if (ds == null) {
+ throw new QueryTestFailedException("DatasourceID " + datasourceid
+ + " is not a defined datasource in the mappings file ");
+
+ }
+
+ modelToDatasourceMap.put(key, ds);
+ return ds;
+
+ }
+
+ public Properties getDatasourceProperties(String datasourceid, String modelname)
+ throws QueryTestFailedException {
+ DataSource ds = getDatasource(datasourceid, modelname);
+
+ return ds.getProperties();
+
+ }
+
+ private void loadDataSourceMappings()
+ throws QueryTestFailedException {
+
+ Document doc = null;
+ XMLReaderWriter readerWriter = new XMLReaderWriterImpl();
+
+ try {
+ doc = readerWriter.readDocument(getInputStream());
+ } catch (JDOMException e) {
+ e.printStackTrace();
+ throw new TransactionRuntimeException(e);
+ } catch (IOException e) {
+ e.printStackTrace();
+ throw new TransactionRuntimeException(e);
+ }
+
+ Element root = doc.getRootElement();
+ List<Element> rootElements = root.getChildren();
+ if (rootElements == null || rootElements.size() == 0) {
+ throw new TransactionRuntimeException("No children defined under root element " + DSCONFIG);
+ }
+
+ for (Iterator<Element> it = rootElements.iterator(); it.hasNext();) {
+ Element type = it.next();
+// System.out.println("Loading ds transactional type " + type.getName());
+ String typename = type.getAttributeValue(Property.Attributes.NAME);
+
+ List<Element> typeElements = type.getChildren();
+ if (typeElements != null) {
+ Map<String, DataSource> datasources = new HashMap<String, DataSource>(typeElements.size());
+
+ for (Iterator<Element> typeit = typeElements.iterator(); typeit.hasNext();) {
+ Element e = typeit.next();
+// System.out.println("Loading ds type " + e.getName());
+ addDataSource(e, typename, datasources);
+ }
+ dstypeMap.put(typename, datasources);
+ allDatasourcesMap.putAll(datasources);
+
+ }
+
+
+ }
+
+ if (dstypeMap == null || dstypeMap.isEmpty()) {
+ throw new TransactionRuntimeException(
+ "No Datasources were found in the mappings file");
+ }
+
+ System.out.println("Number of datasource types loaded " + dstypeMap.size());
+ System.out.println("Number of total datasource mappings loaded " + allDatasourcesMap.size());
+
+
+
+ }
+
+ private static void addDataSource(Element element, String type, Map<String, DataSource> datasources) {
+ String name = element.getAttributeValue(Property.Attributes.NAME);
+ Properties props = getProperties(element);
+
+ String dir = props.getProperty(DataSource.DIRECTORY);
+ String dsfile = DIRECTORY + dir + "/connection.properties";
+ Properties dsprops = loadProperties(dsfile);
+ if (dsprops != null) {
+ props.putAll(dsprops);
+ DataSource ds = new DataSource(name,
+ type,
+ props);
+ datasources.put(ds.getName(), ds);
+ System.out.println("Loaded datasource " + ds.getName());
+
+ }
+
+ }
+
+
+ private static Properties loadProperties(String filename) {
+ Properties props = null;
+
+ try {
+ InputStream in = DataSourceMgr.class.getResourceAsStream("/"
+ + filename);
+ if (in != null) {
+ props = new Properties();
+ props.load(in);
+ return props;
+ }
+ return null;
+ } catch (IOException e) {
+ throw new TransactionRuntimeException("Error loading properties from file '"
+ + filename + "'" + e.getMessage());
+ }
+ }
+
+ private static Properties getProperties(Element propertiesElement) {
+ Properties props = new Properties();
+
+ List<Element> properties = propertiesElement
+ .getChildren(Property.ELEMENT);
+ Iterator<Element> iterator = properties.iterator();
+ while (iterator.hasNext()) {
+ Element propertyElement = (Element) iterator.next();
+ String propertyName = propertyElement
+ .getAttributeValue(Property.Attributes.NAME);
+ String propertyValue = propertyElement.getText();
+
+ props.setProperty(propertyName, propertyValue);
+
+ }
+ return props;
+ }
+
+ private static InputStream getInputStream() {
+
+ InputStream in = DataSourceMgr.class.getResourceAsStream("/"
+ + DIRECTORY + DATASOURCE_MAPPING_FILE);
+ if (in != null) {
+
+ return in;
+ } else {
+ throw new RuntimeException(
+ "Failed to load datasource mapping file '" + DIRECTORY
+ + DATASOURCE_MAPPING_FILE + "'");
+ }
+
+ }
+
+ static final String DSCONFIG = "datasourceconfig";
+ static final String DATASOURCETYPE = "datasourcetype";
+ static final String DATASOURCE = "datasource";
+
+ static class Property {
+
+ /**
+ * This is the name of the Property Element.
+ */
+ public static final String ELEMENT = "property"; //$NON-NLS-1$
+
+ /**
+ * This class defines the Attributes of the Element class that contains
+ * it.
+ */
+ public static class Attributes {
+ public static final String NAME = "name"; //$NON-NLS-1$
+ }
+
+ }
+
+ public static void main(String[] args) {
+ DataSourceMgr mgr = DataSourceMgr.getInstance();
+
+ try {
+ DataSource ds1 = mgr.getDatasource("ds_mysql5", "model1");
+
+ DataSource ds2 = mgr.getDatasource("ds_mysql5", "model1");
+ if (ds1 != ds2) {
+ throw new RuntimeException("Datasources are not the same");
+ }
+ System.out.println("Value for ds_mysql5: "
+ + mgr.getDatasourceProperties("ds_mysql5", "model1"));
+ } catch (QueryTestFailedException e) {
+ e.printStackTrace();
+ }
+
+ }
+
+}
Property changes on: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DataSourceMgr.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 7 months
teiid SVN: r1360 - in trunk: metadata/src/main/java/org/teiid/connector/metadata and 1 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-09-15 16:08:41 -0400 (Tue, 15 Sep 2009)
New Revision: 1360
Modified:
trunk/connector-metadata/src/main/java/com/metamatrix/connector/metadata/internal/MetadataSearchCriteriaBuilder.java
trunk/metadata/src/main/java/org/teiid/connector/metadata/MetadataConnectorMetadata.java
trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
trunk/metadata/src/main/java/org/teiid/metadata/index/SimpleIndexUtil.java
Log:
removal of unused index logic post fork
Modified: trunk/connector-metadata/src/main/java/com/metamatrix/connector/metadata/internal/MetadataSearchCriteriaBuilder.java
===================================================================
--- trunk/connector-metadata/src/main/java/com/metamatrix/connector/metadata/internal/MetadataSearchCriteriaBuilder.java 2009-09-15 20:06:39 UTC (rev 1359)
+++ trunk/connector-metadata/src/main/java/com/metamatrix/connector/metadata/internal/MetadataSearchCriteriaBuilder.java 2009-09-15 20:08:41 UTC (rev 1360)
@@ -44,6 +44,7 @@
import com.metamatrix.core.util.ArgCheck;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.core.util.StringUtil;
+import com.metamatrix.query.sql.lang.MatchCriteria;
import com.metamatrix.query.sql.lang.MatchCriteria.PatternTranslator;
@@ -58,15 +59,7 @@
// Map of fieldNames to MetadataSearchCriteria objects used to search
private final Map criteriaMap = new HashMap();
private ObjectQuery query;
- /** The default wildcard character - '%' */
- public static final char WILDCARD_CHAR = '%';
- /** The default single match character - '_' */
- public static final char MATCH_CHAR = '_';
-
- /** The internal null escape character */
- public static final char NULL_ESCAPE_CHAR = 0;
-
private final static PatternTranslator LIKE_TO_INDEX = new PatternTranslator("*", "?", new char[0], '\\'); //$NON-NLS-1$ //$NON-NLS-2$
/**
@@ -200,7 +193,7 @@
String literalValue = (String) this.query.getExpressionValue(rtExpression);
StringBuffer rePattern = null;
- char escapeChar = NULL_ESCAPE_CHAR;
+ char escapeChar = MatchCriteria.NULL_ESCAPE_CHAR;
if ( escape != null ) {
escapeChar = escape.charValue();
}
Modified: trunk/metadata/src/main/java/org/teiid/connector/metadata/MetadataConnectorMetadata.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/connector/metadata/MetadataConnectorMetadata.java 2009-09-15 20:06:39 UTC (rev 1359)
+++ trunk/metadata/src/main/java/org/teiid/connector/metadata/MetadataConnectorMetadata.java 2009-09-15 20:08:41 UTC (rev 1360)
@@ -203,11 +203,7 @@
AbstractMetadataRecord record = (AbstractMetadataRecord)j.next();
if (!StringUtil.isEmpty(record.getName())) {
String recordName = record.getName();
- if (hasCaseFunctions) {
- nameCriteria = nameCriteria.toUpperCase();
- recordName = recordName.toUpperCase();
- }
- if (!CharOperation.match(nameCriteria.toCharArray(), recordName.toCharArray(), true)) {
+ if (!CharOperation.match(nameCriteria.toCharArray(), recordName.toCharArray(), !hasCaseFunctions)) {
j.remove();
}
}
Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2009-09-15 20:06:39 UTC (rev 1359)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/RecordFactory.java 2009-09-15 20:08:41 UTC (rev 1360)
@@ -152,7 +152,7 @@
public static Collection getMetadataRecord(final IEntryResult[] queryResult) {
final Collection records = new ArrayList(queryResult.length);
for (int i = 0; i < queryResult.length; i++) {
- final AbstractMetadataRecord record = getMetadataRecord(queryResult[i]);
+ final AbstractMetadataRecord record = getMetadataRecord(queryResult[i].getWord());
if (record != null) {
records.add(record);
}
@@ -198,17 +198,6 @@
}
/**
- * Return the {@link com.metamatrix.modeler.core.metadata.runtime.MetadataRecord}
- * instances for specified IEntryResult.
- * @param entryResult
- * @param container Container reference to be set on the record
- */
- public static AbstractMetadataRecord getMetadataRecord(final IEntryResult queryResult) {
- AbstractMetadataRecord record = getMetadataRecord(queryResult.getWord());
- return record;
- }
-
- /**
* Append the specified IEntryResult[] to the IEntryResult
* to create a single result representing an index entry that
* was split across multiple index records.
@@ -329,9 +318,6 @@
final List tokens = StringUtil.split(str,String.valueOf(IndexConstants.RECORD_STRING.RECORD_DELIMITER));
final ModelRecordImpl model = new ModelRecordImpl();
- // Extract the index version information from the record
- int indexVersion = getIndexVersion(record);
-
// The tokens are the standard header values
int tokenIndex = 0;
setRecordHeaderValues(model, (String)tokens.get(tokenIndex++), (String)tokens.get(tokenIndex++), (String)tokens.get(tokenIndex++),
@@ -767,9 +753,6 @@
final List tokens = StringUtil.split(str,String.valueOf(IndexConstants.RECORD_STRING.RECORD_DELIMITER));
final ProcedureParameterRecordImpl paramRd = new ProcedureParameterRecordImpl();
- // Extract the index version information from the record
- int indexVersion = getIndexVersion(record);
-
// The tokens are the standard header values
int tokenIndex = 0;
Modified: trunk/metadata/src/main/java/org/teiid/metadata/index/SimpleIndexUtil.java
===================================================================
--- trunk/metadata/src/main/java/org/teiid/metadata/index/SimpleIndexUtil.java 2009-09-15 20:06:39 UTC (rev 1359)
+++ trunk/metadata/src/main/java/org/teiid/metadata/index/SimpleIndexUtil.java 2009-09-15 20:08:41 UTC (rev 1360)
@@ -25,17 +25,12 @@
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
import org.teiid.connector.metadata.runtime.MetadataConstants;
import org.teiid.core.index.IEntryResult;
-import org.teiid.internal.core.index.BlocksIndexInput;
import org.teiid.internal.core.index.Index;
-import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.core.MetaMatrixCoreException;
import com.metamatrix.core.util.ArgCheck;
import com.metamatrix.core.util.FileUtils;
@@ -78,135 +73,18 @@
//############################################################################################################################
/**
- * Return all index file records that match the specified record pattern.
- * The pattern can be constructed from any combination of characters
- * including the multiple character wildcard '*' and single character
- * wildcard '?'. The field delimiter is used to tokenize both the pattern
- * and the index record so that individual fields can be matched. The method
- * assumes that the first occurrence of the delimiter in the record alligns
- * with the first occurrence in the pattern. Any wildcard characters in the
- * pattern cannot represent a delimiter character.
- * @param indexes the array of MtkIndex instances to query
- * @param pattern
- * @param fieldDelimiter
- * @return results
- * @throws QueryMetadataException
- */
- public static IEntryResult[] queryIndex(final Index[] indexes, final char[] pattern, final char fieldDelimiter) throws MetaMatrixCoreException {
- final boolean isCaseSensitive = false;
- final List<IEntryResult> queryResult = new ArrayList<IEntryResult>();
-
- try {
- for (int i = 0; i < indexes.length; i++) {
- // Search for index records matching the specified pattern
- IEntryResult[] partialResults = indexes[i].queryEntriesMatching(pattern,isCaseSensitive);
-
- // If any of these IEntryResults represent an index record that is continued
- // across multiple entries within the index file then we must query for those
- // records and build the complete IEntryResult
- if (partialResults != null) {
- partialResults = addContinuationRecords(indexes[i], partialResults);
- }
-
- if (partialResults != null) {
- queryResult.addAll(Arrays.asList(partialResults));
- }
- }
- } catch(IOException e) {
- throw new MetaMatrixCoreException(e);
- }
-
- // Remove any results that do not match after tokenizing the record
- for (int i = 0, n = queryResult.size(); i < n; i++) {
- IEntryResult record = queryResult.get(i);
- if ( record == null || !entryMatches(record.getWord(),pattern,fieldDelimiter) ) {
- queryResult.remove(record);
- }
- }
-
- return queryResult.toArray(new IEntryResult[queryResult.size()]);
- }
-
- /**
- * Return true if the record matches the pattern after being tokenized using
- * the specified delimiter. The method assumes that the first occurrence of
- * the delimiter in the record alligns with the first occurrence in the pattern.
- * Any wildcard characters in the pattern cannot represent a delimiter character.
- * @param record
- * @param pattern
- * @param fieldDelimiter
- * @return
- */
- private static boolean entryMatches(final char[] record, final char[] pattern, final char fieldDelimiter) {
- final boolean isCaseSensitive = false;
- if (record == null)
- return false; // null record cannot match
- if (pattern == null)
- return true; // null pattern is equivalent to '*'
-
- String delimiter = String.valueOf(fieldDelimiter);
- List recordTokens = StringUtil.split(new String(record),delimiter);
- List patternTokens = StringUtil.split(new String(pattern),delimiter);
- if (patternTokens.size() > recordTokens.size()) {
- return false;
- }
-
- for (int i = 0, n = patternTokens.size(); i < n; i++) {
- char[] patternToken = ((String)patternTokens.get(i)).toCharArray();
- char[] recordToken = ((String)recordTokens.get(i)).toCharArray();
- if (!CharOperation.match(patternToken,recordToken,isCaseSensitive)) {
- return false;
- }
- }
- return true;
- }
-
- /**
* Return all index file records that match the specified record prefix
* or pattern. The pattern can be constructed from any combination of characters
* including the multiple character wildcard '*' and single character
* wildcard '?'. The prefix may be constructed from any combination of
* characters excluding the wildcard characters. The prefix specifies a fixed
* number of characters that the index record must start with.
- * @param indexes the array of MtkIndex instances to query
- * @param pattern
- * @return results
- * @throws MetamatrixCoreException
- */
- public static IEntryResult[] queryIndex(final Index[] indexes, final char[] pattern, final boolean isPrefix, final boolean returnFirstMatch) throws MetaMatrixCoreException {
- return queryIndex(null, indexes, pattern, isPrefix, true, returnFirstMatch);
- }
-
- /**
- * Return all index file records that match the specified record prefix
- * or pattern. The pattern can be constructed from any combination of characters
- * including the multiple character wildcard '*' and single character
- * wildcard '?'. The prefix may be constructed from any combination of
- * characters excluding the wildcard characters. The prefix specifies a fixed
- * number of characters that the index record must start with.
* @param monitor an optional ProgressMonitor
* @param indexes the array of MtkIndex instances to query
* @param pattern
* @return results
* @throws MetamatrixCoreException
*/
- public static IEntryResult[] queryIndex(ProgressMonitor monitor, final Index[] indexes, final char[] pattern, final boolean isPrefix, final boolean returnFirstMatch) throws MetaMatrixCoreException {
- return queryIndex(monitor, indexes, pattern, isPrefix, true, returnFirstMatch);
- }
-
- /**
- * Return all index file records that match the specified record prefix
- * or pattern. The pattern can be constructed from any combination of characters
- * including the multiple character wildcard '*' and single character
- * wildcard '?'. The prefix may be constructed from any combination of
- * characters excluding the wildcard characters. The prefix specifies a fixed
- * number of characters that the index record must start with.
- * @param monitor an optional ProgressMonitor
- * @param indexes the array of MtkIndex instances to query
- * @param pattern
- * @return results
- * @throws MetamatrixCoreException
- */
public static IEntryResult[] queryIndex(ProgressMonitor monitor, final Index[] indexes, final char[] pattern, final boolean isPrefix, final boolean isCaseSensitive, final boolean returnFirstMatch) throws MetaMatrixCoreException {
final List<IEntryResult> queryResult = new ArrayList<IEntryResult>();
if ( monitor != null ) {
@@ -264,104 +142,6 @@
return queryResult.toArray(new IEntryResult[queryResult.size()]);
}
- /**
- * Return all index file records that match the specified record prefix
- * or pattern. The pattern can be constructed from any combination of characters
- * including the multiple character wildcard '*' and single character
- * wildcard '?'. The prefix may be constructed from any combination of
- * characters excluding the wildcard characters. The prefix specifies a fixed
- * number of characters that the index record must start with.
- * @param monitor an optional ProgressMonitor
- * @param indexes the array of MtkIndex instances to query
- * @param pattern
- * @return results
- * @throws MetamatrixCoreException
- */
- public static IEntryResult[] queryIndex(ProgressMonitor monitor, final Index[] indexes, final Collection patterns, final boolean isPrefix, final boolean isCaseSensitive, final boolean returnFirstMatch) throws MetaMatrixCoreException {
- final List<IEntryResult> queryResult = new ArrayList<IEntryResult>();
- if ( monitor != null ) {
- monitor.beginTask( null, indexes.length );
- }
-
- // index file input
- BlocksIndexInput input = null;
-
- try {
- for (int i = 0; i < indexes.length; i++) {
-
- if ( monitor != null ) {
- monitor.worked( 1 );
- }
- // initialize input for the index file
- input = new BlocksIndexInput(indexes[i].getIndexFile());
-
- IEntryResult[] partialResults = null;
- for(final Iterator patternIter = patterns.iterator(); patternIter.hasNext();) {
- char[] pattern = ((String) patternIter.next()).toCharArray();
- if(isPrefix) {
- // Query based on prefix. This uses a fast binary search
- // based on matching the first n characters in the index record.
- // The index files contain records that are sorted alphabetically
- // by fullname such that the search algorithm can quickly determine
- // which index block(s) contain the matching prefixes.
- partialResults = input.queryEntriesPrefixedBy(pattern, isCaseSensitive);
- } else {
- // Search for index records matching the specified pattern
- partialResults = input.queryEntriesMatching(pattern, isCaseSensitive);
- }
-
- // If any of these IEntryResults represent an index record that is continued
- // across multiple entries within the index file then we must query for those
- // records and build the complete IEntryResult
- if (partialResults != null) {
- partialResults = addContinuationRecords(indexes[i], partialResults);
- }
-
- // Process these results against the specified pattern and return
- // only the subset entries that match both criteria
- if (partialResults != null) {
- for (int j = 0; j < partialResults.length; j++) {
- IEntryResult record = partialResults[j];
- if(record != null) {
- char[] recordWord = partialResults[j].getWord();
- // filter out any continuation records, they should already appended
- // to index record thet is continued
- if(recordWord[0] != MetadataConstants.RECORD_TYPE.RECORD_CONTINUATION) {
- if (!isPrefix) {
- // filter results that do not match after tokenizing the record
- if(entryMatches(recordWord,pattern,IndexConstants.RECORD_STRING.RECORD_DELIMITER) ) {
- queryResult.add(partialResults[j]);
- }
- } else {
- queryResult.add(partialResults[j]);
- }
- }
- }
- }
- }
- if (returnFirstMatch && queryResult.size() > 0) {
- break;
- }
-
- // close file input
- input.close();
- }
- }
- } catch(IOException e) {
- throw new MetaMatrixCoreException(e);
- } finally {
- // close file input
- try {
- if(input != null) {
- input.close();
- }
- } catch(IOException io) {}
- }
-
- return queryResult.toArray(new IEntryResult[queryResult.size()]);
- }
-
-
private static IEntryResult[] addContinuationRecords(final Index index, final IEntryResult[] partialResults) throws IOException {
final int blockSize = RecordFactory.INDEX_RECORD_BLOCK_SIZE;
@@ -564,27 +344,4 @@
return StringUtil.Constants.EMPTY_STRING + recordType;
}
-
- /**
- * Return the prefix match string that could be used to exactly match a fully
- * qualified entity name in an index record. All index records
- * contain a header portion of the form:
- * recordType|name|
- * @param name The fully qualified name for which the prefix match
- * string is to be constructed.
- * @return The pattern match string of the form: recordType|name|
- */
- public static String getPrefixPattern(final char recordType, final String uuid) {
-
- // construct the pattern string
- String patternStr = "" //$NON-NLS-1$
- + recordType
- + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- if(uuid != null && !uuid.equals(StringUtil.Constants.EMPTY_STRING)) {
- patternStr = patternStr + uuid.trim() + IndexConstants.RECORD_STRING.RECORD_DELIMITER;
- }
-
- return patternStr;
- }
-
}
16 years, 7 months
teiid SVN: r1359 - trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-09-15 16:06:39 -0400 (Tue, 15 Sep 2009)
New Revision: 1359
Removed:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DatasourceMgr.java
Log:
removing invalid class
Deleted: trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DatasourceMgr.java
===================================================================
--- trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DatasourceMgr.java 2009-09-15 20:05:57 UTC (rev 1358)
+++ trunk/test-integration/db/src/main/java/org/teiid/test/framework/datasource/DatasourceMgr.java 2009-09-15 20:06:39 UTC (rev 1359)
@@ -1,290 +0,0 @@
-/*
- * Copyright (c) 2000-2007 MetaMatrix, Inc.
- * All rights reserved.
- */
-package org.teiid.test.framework.datasource;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.JDOMException;
-import org.teiid.test.framework.exception.QueryTestFailedException;
-import org.teiid.test.framework.exception.TransactionRuntimeException;
-
-import com.metamatrix.common.xml.XMLReaderWriter;
-import com.metamatrix.common.xml.XMLReaderWriterImpl;
-
-/**
- * The DataSourceMgr is responsible for loading and managing the datasource
- * mapping properties file {@see #DATASOURCE_MAPPING_FILE} and the mapped
- * datasource properties files. The {@link #getDatasourceProperties(String)}
- * returns the properties defined for that datasourceid, which is mapped in the
- * mnappings file. This mapping allows the test
- *
- * @author vanhalbert
- *
- */
-public class DataSourceMgr {
-
- static final String DIRECTORY = "datasources/";
- static final String DATASOURCE_MAPPING_FILE = "datasource_mapping.xml";
-
- private static DataSourceMgr _instance = null;
-
- private Map<String, Map<String, DataSource>>dstypeMap = new HashMap<String, Map<String, DataSource>>(); //key=datasourcetype
-
- private Map<String, DataSource> allDatasourcesMap = new HashMap<String, DataSource>(); // key=datasource name
-
- private Map<String, DataSource> modelToDatasourceMap = new HashMap<String, DataSource>(); // key=modelname
-
- private Set<String> usedDataSources = new HashSet<String>();
-
-
- private DataSourceMgr() {
- }
-
- public static synchronized DataSourceMgr getInstance() {
- if (_instance == null) {
- _instance = new DataSourceMgr();
- try {
- _instance.loadDataSourceMappings();
- } catch (QueryTestFailedException e) {
- // TODO Auto-generated catch block
- throw new TransactionRuntimeException(e);
- } catch (TransactionRuntimeException e) {
- // TODO Auto-generated catch block
- throw e;
- }
-
- }
- return _instance;
- }
-
- public int numberOfAvailDataSources() {
- return allDatasourcesMap.size();
- }
-
- public DataSource getDatasource(String datasourceid, String modelName)
- throws QueryTestFailedException {
- DataSource ds = null;
-
- // map the datasource to the model and datasourceid
- // this is so the next time this combination is requested,
- // the same datasource is returned to ensure when consecutive calls during the process
- // corresponds to the same datasource
- String key = modelName + "_"+datasourceid;
-
- if (modelToDatasourceMap.containsKey(key)) {
- return modelToDatasourceMap.get(key);
- }
- if (dstypeMap.containsKey(datasourceid)) {
-
- Map datasources = dstypeMap.get(datasourceid);
- Iterator<DataSource> it= datasources.values().iterator();
- while(it.hasNext()) {
- DataSource checkit = it.next();
- if (!usedDataSources.contains(checkit.getName())) {
- usedDataSources.add(checkit.getName());
- ds = checkit;
- break;
- }
- }
-
- } else {
- ds = allDatasourcesMap.get(datasourceid);
- }
- if (ds == null) {
- throw new QueryTestFailedException("DatasourceID " + datasourceid
- + " is not a defined datasource in the mappings file ");
-
- }
-
- modelToDatasourceMap.put(key, ds);
- return ds;
-
- }
-
- public Properties getDatasourceProperties(String datasourceid, String modelname)
- throws QueryTestFailedException {
- DataSource ds = getDatasource(datasourceid, modelname);
-
- return ds.getProperties();
-
- }
-
- private void loadDataSourceMappings()
- throws QueryTestFailedException {
-
- Document doc = null;
- XMLReaderWriter readerWriter = new XMLReaderWriterImpl();
-
- try {
- doc = readerWriter.readDocument(getInputStream());
- } catch (JDOMException e) {
- e.printStackTrace();
- throw new TransactionRuntimeException(e);
- } catch (IOException e) {
- e.printStackTrace();
- throw new TransactionRuntimeException(e);
- }
-
- Element root = doc.getRootElement();
- List<Element> rootElements = root.getChildren();
- if (rootElements == null || rootElements.size() == 0) {
- throw new TransactionRuntimeException("No children defined under root element " + DSCONFIG);
- }
-
- for (Iterator<Element> it = rootElements.iterator(); it.hasNext();) {
- Element type = it.next();
-// System.out.println("Loading ds transactional type " + type.getName());
- String typename = type.getAttributeValue(Property.Attributes.NAME);
-
- List<Element> typeElements = type.getChildren();
- if (typeElements != null) {
- Map<String, DataSource> datasources = new HashMap<String, DataSource>(typeElements.size());
-
- for (Iterator<Element> typeit = typeElements.iterator(); typeit.hasNext();) {
- Element e = typeit.next();
-// System.out.println("Loading ds type " + e.getName());
- addDataSource(e, typename, datasources);
- }
- dstypeMap.put(typename, datasources);
- allDatasourcesMap.putAll(datasources);
-
- }
-
-
- }
-
- if (dstypeMap == null || dstypeMap.isEmpty()) {
- throw new TransactionRuntimeException(
- "No Datasources were found in the mappings file");
- }
-
- System.out.println("Number of datasource types loaded " + dstypeMap.size());
- System.out.println("Number of total datasource mappings loaded " + allDatasourcesMap.size());
-
-
-
- }
-
- private static void addDataSource(Element element, String type, Map<String, DataSource> datasources) {
- String name = element.getAttributeValue(Property.Attributes.NAME);
- Properties props = getProperties(element);
-
- String dir = props.getProperty(DataSource.DIRECTORY);
- String dsfile = DIRECTORY + dir + "/connection.properties";
- Properties dsprops = loadProperties(dsfile);
- if (dsprops != null) {
- props.putAll(dsprops);
- DataSource ds = new DataSource(name,
- type,
- props);
- datasources.put(ds.getName(), ds);
- System.out.println("Loaded datasource " + ds.getName());
-
- }
-
- }
-
-
- private static Properties loadProperties(String filename) {
- Properties props = null;
-
- try {
- InputStream in = DataSourceMgr.class.getResourceAsStream("/"
- + filename);
- if (in != null) {
- props = new Properties();
- props.load(in);
- return props;
- }
- return null;
- } catch (IOException e) {
- throw new TransactionRuntimeException("Error loading properties from file '"
- + filename + "'" + e.getMessage());
- }
- }
-
- private static Properties getProperties(Element propertiesElement) {
- Properties props = new Properties();
-
- List<Element> properties = propertiesElement
- .getChildren(Property.ELEMENT);
- Iterator<Element> iterator = properties.iterator();
- while (iterator.hasNext()) {
- Element propertyElement = (Element) iterator.next();
- String propertyName = propertyElement
- .getAttributeValue(Property.Attributes.NAME);
- String propertyValue = propertyElement.getText();
-
- props.setProperty(propertyName, propertyValue);
-
- }
- return props;
- }
-
- private static InputStream getInputStream() {
-
- InputStream in = DataSourceMgr.class.getResourceAsStream("/"
- + DIRECTORY + DATASOURCE_MAPPING_FILE);
- if (in != null) {
-
- return in;
- } else {
- throw new RuntimeException(
- "Failed to load datasource mapping file '" + DIRECTORY
- + DATASOURCE_MAPPING_FILE + "'");
- }
-
- }
-
- static final String DSCONFIG = "datasourceconfig";
- static final String DATASOURCETYPE = "datasourcetype";
- static final String DATASOURCE = "datasource";
-
- static class Property {
-
- /**
- * This is the name of the Property Element.
- */
- public static final String ELEMENT = "property"; //$NON-NLS-1$
-
- /**
- * This class defines the Attributes of the Element class that contains
- * it.
- */
- public static class Attributes {
- public static final String NAME = "name"; //$NON-NLS-1$
- }
-
- }
-
- public static void main(String[] args) {
- DataSourceMgr mgr = DataSourceMgr.getInstance();
-
- try {
- DataSource ds1 = mgr.getDatasource("ds_mysql5", "model1");
-
- DataSource ds2 = mgr.getDatasource("ds_mysql5", "model1");
- if (ds1 != ds2) {
- throw new RuntimeException("Datasources are not the same");
- }
- System.out.println("Value for ds_mysql5: "
- + mgr.getDatasourceProperties("ds_mysql5", "model1"));
- } catch (QueryTestFailedException e) {
- e.printStackTrace();
- }
-
- }
-
-}
16 years, 7 months
teiid SVN: r1358 - trunk/test-integration/db.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-09-15 16:05:57 -0400 (Tue, 15 Sep 2009)
New Revision: 1358
Added:
trunk/test-integration/db/.classpath
trunk/test-integration/db/.project
Modified:
trunk/test-integration/db/
Log:
adding to svn ignore
Property changes on: trunk/test-integration/db
___________________________________________________________________
Name: svn:ignore
+ target
.settings
Added: trunk/test-integration/db/.classpath
===================================================================
--- trunk/test-integration/db/.classpath (rev 0)
+++ trunk/test-integration/db/.classpath 2009-09-15 20:05:57 UTC (rev 1358)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Property changes on: trunk/test-integration/db/.classpath
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/test-integration/db/.project
===================================================================
--- trunk/test-integration/db/.project (rev 0)
+++ trunk/test-integration/db/.project 2009-09-15 20:05:57 UTC (rev 1358)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>db</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/test-integration/db/.project
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 7 months
teiid SVN: r1357 - trunk/documentation/salesforce-connector-guide.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-09-15 15:44:46 -0400 (Tue, 15 Sep 2009)
New Revision: 1357
Modified:
trunk/documentation/salesforce-connector-guide/
Log:
adding to svn ignore
Property changes on: trunk/documentation/salesforce-connector-guide
___________________________________________________________________
Name: svn:ignore
+ target
.classpath
.settings
.project
16 years, 7 months
teiid SVN: r1356 - in trunk: adminshell and 42 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-09-15 11:10:09 -0400 (Tue, 15 Sep 2009)
New Revision: 1356
Modified:
trunk/adminshell/pom.xml
trunk/build/pom.xml
trunk/cache-jbosscache/pom.xml
trunk/client-jdbc/pom.xml
trunk/client/pom.xml
trunk/common-core/pom.xml
trunk/common-internal/pom.xml
trunk/connector-api/pom.xml
trunk/connector-metadata/pom.xml
trunk/connector-sdk/pom.xml
trunk/connectors/connector-jdbc/pom.xml
trunk/connectors/connector-ldap/pom.xml
trunk/connectors/connector-loopback/pom.xml
trunk/connectors/connector-salesforce/pom.xml
trunk/connectors/connector-text/pom.xml
trunk/connectors/connector-xml-common/pom.xml
trunk/connectors/connector-xml/pom.xml
trunk/connectors/pom.xml
trunk/connectors/salesforce-api/pom.xml
trunk/connectors/sandbox/connector-exec/pom.xml
trunk/connectors/sandbox/connector-object/pom.xml
trunk/connectors/sandbox/connector-yahoo/pom.xml
trunk/connectors/sandbox/pom.xml
trunk/console/pom.xml
trunk/console/src/resources/embedded/META-INF/rhq-plugin.xml
trunk/documentation/admin-guide/pom.xml
trunk/documentation/connector-developer-guide/pom.xml
trunk/documentation/docbook/custom.dtd
trunk/documentation/jdbc-connector-guide/pom.xml
trunk/documentation/pom.xml
trunk/documentation/quick-start-example/pom.xml
trunk/documentation/reference/pom.xml
trunk/documentation/salesforce-connector-guide/pom.xml
trunk/documentation/server-extensions-guide/pom.xml
trunk/engine/pom.xml
trunk/hibernate-dialect/pom.xml
trunk/metadata/pom.xml
trunk/pom.xml
trunk/runtime/pom.xml
trunk/server/pom.xml
trunk/test-integration/common/pom.xml
trunk/test-integration/db/pom.xml
trunk/test-integration/pom.xml
trunk/txn-jbossts/pom.xml
Log:
promoting trunk to 6.3
Modified: trunk/adminshell/pom.xml
===================================================================
--- trunk/adminshell/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/adminshell/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-adminshell</artifactId>
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/build/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>build</artifactId>
Modified: trunk/cache-jbosscache/pom.xml
===================================================================
--- trunk/cache-jbosscache/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/cache-jbosscache/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -4,7 +4,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-cache-jbosscache</artifactId>
Modified: trunk/client/pom.xml
===================================================================
--- trunk/client/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/client/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -5,7 +5,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client</artifactId>
Modified: trunk/client-jdbc/pom.xml
===================================================================
--- trunk/client-jdbc/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/client-jdbc/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -6,7 +6,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-client-jdbc</artifactId>
Modified: trunk/common-core/pom.xml
===================================================================
--- trunk/common-core/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/common-core/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -4,7 +4,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-core</artifactId>
Modified: trunk/common-internal/pom.xml
===================================================================
--- trunk/common-internal/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/common-internal/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -5,7 +5,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-common-internal</artifactId>
Modified: trunk/connector-api/pom.xml
===================================================================
--- trunk/connector-api/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connector-api/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -5,7 +5,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-connector-api</artifactId>
Modified: trunk/connector-metadata/pom.xml
===================================================================
--- trunk/connector-metadata/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connector-metadata/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -4,7 +4,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/connector-sdk/pom.xml
===================================================================
--- trunk/connector-sdk/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connector-sdk/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -4,7 +4,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-connector-sdk</artifactId>
Modified: trunk/connectors/connector-jdbc/pom.xml
===================================================================
--- trunk/connectors/connector-jdbc/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/connector-jdbc/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -5,7 +5,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-jdbc</artifactId>
Modified: trunk/connectors/connector-ldap/pom.xml
===================================================================
--- trunk/connectors/connector-ldap/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/connector-ldap/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-ldap</artifactId>
Modified: trunk/connectors/connector-loopback/pom.xml
===================================================================
--- trunk/connectors/connector-loopback/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/connector-loopback/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -5,7 +5,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-loopback</artifactId>
Modified: trunk/connectors/connector-salesforce/pom.xml
===================================================================
--- trunk/connectors/connector-salesforce/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/connector-salesforce/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -5,7 +5,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-salesforce</artifactId>
Modified: trunk/connectors/connector-text/pom.xml
===================================================================
--- trunk/connectors/connector-text/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/connector-text/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-text</artifactId>
Modified: trunk/connectors/connector-xml/pom.xml
===================================================================
--- trunk/connectors/connector-xml/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/connector-xml/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -5,7 +5,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-xml</artifactId>
Modified: trunk/connectors/connector-xml-common/pom.xml
===================================================================
--- trunk/connectors/connector-xml-common/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/connector-xml-common/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -5,7 +5,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-xml-common</artifactId>
Modified: trunk/connectors/pom.xml
===================================================================
--- trunk/connectors/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -4,7 +4,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/connectors/salesforce-api/pom.xml
===================================================================
--- trunk/connectors/salesforce-api/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/salesforce-api/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -2,7 +2,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-api</artifactId>
Modified: trunk/connectors/sandbox/connector-exec/pom.xml
===================================================================
--- trunk/connectors/sandbox/connector-exec/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/sandbox/connector-exec/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-exec</artifactId>
Modified: trunk/connectors/sandbox/connector-object/pom.xml
===================================================================
--- trunk/connectors/sandbox/connector-object/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/sandbox/connector-object/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -4,7 +4,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-object</artifactId>
Modified: trunk/connectors/sandbox/connector-yahoo/pom.xml
===================================================================
--- trunk/connectors/sandbox/connector-yahoo/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/sandbox/connector-yahoo/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>sandbox</artifactId>
<groupId>org.jboss.teiid.connectors</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-yahoo</artifactId>
Modified: trunk/connectors/sandbox/pom.xml
===================================================================
--- trunk/connectors/sandbox/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/connectors/sandbox/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>connectors</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.connectors</groupId>
Modified: trunk/console/pom.xml
===================================================================
--- trunk/console/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/console/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: trunk/console/src/resources/embedded/META-INF/rhq-plugin.xml
===================================================================
--- trunk/console/src/resources/embedded/META-INF/rhq-plugin.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/console/src/resources/embedded/META-INF/rhq-plugin.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -24,7 +24,7 @@
<plugin name="TeiidPlugin" displayName="Teiid Plugin"
package="org.teiid.rhq.plugin" version="2.0.0"
- description="Supports management and monitoring of JBoss Teiid DataServices version 6.2"
+ description="Supports management and monitoring of JBoss Teiid"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:xmlns:rhq-plugin"
Modified: trunk/documentation/admin-guide/pom.xml
===================================================================
--- trunk/documentation/admin-guide/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/documentation/admin-guide/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.teiid.documentation</groupId>
<artifactId>documentation</artifactId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>admin-guide</artifactId>
Modified: trunk/documentation/connector-developer-guide/pom.xml
===================================================================
--- trunk/documentation/connector-developer-guide/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/documentation/connector-developer-guide/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.teiid.documentation</groupId>
<artifactId>documentation</artifactId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>connector-developer-guide</artifactId>
Modified: trunk/documentation/docbook/custom.dtd
===================================================================
--- trunk/documentation/docbook/custom.dtd 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/documentation/docbook/custom.dtd 2009-09-15 15:10:09 UTC (rev 1356)
@@ -1,4 +1,4 @@
-<!ENTITY versionNumber "6.2.0">
+<!ENTITY versionNumber "6.3.0">
<!ENTITY copyrightYear "2009">
<!ENTITY copyrightHolder "Red Hat, Inc.">
<!ENTITY url "http://www.jboss.org/teiid/">
Modified: trunk/documentation/jdbc-connector-guide/pom.xml
===================================================================
--- trunk/documentation/jdbc-connector-guide/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/documentation/jdbc-connector-guide/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.teiid.documentation</groupId>
<artifactId>documentation</artifactId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jdbc-connector</artifactId>
Modified: trunk/documentation/pom.xml
===================================================================
--- trunk/documentation/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/documentation/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid.documentation</groupId>
Modified: trunk/documentation/quick-start-example/pom.xml
===================================================================
--- trunk/documentation/quick-start-example/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/documentation/quick-start-example/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.teiid.documentation</groupId>
<artifactId>documentation</artifactId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>quick-start-guide</artifactId>
Modified: trunk/documentation/reference/pom.xml
===================================================================
--- trunk/documentation/reference/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/documentation/reference/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.teiid.documentation</groupId>
<artifactId>documentation</artifactId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>reference</artifactId>
Modified: trunk/documentation/salesforce-connector-guide/pom.xml
===================================================================
--- trunk/documentation/salesforce-connector-guide/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/documentation/salesforce-connector-guide/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.teiid.documentation</groupId>
<artifactId>documentation</artifactId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>salesforce-connector-guide</artifactId>
Modified: trunk/documentation/server-extensions-guide/pom.xml
===================================================================
--- trunk/documentation/server-extensions-guide/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/documentation/server-extensions-guide/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.teiid.documentation</groupId>
<artifactId>documentation</artifactId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>server-extensions-guide</artifactId>
Modified: trunk/engine/pom.xml
===================================================================
--- trunk/engine/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/engine/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-engine</artifactId>
Modified: trunk/hibernate-dialect/pom.xml
===================================================================
--- trunk/hibernate-dialect/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/hibernate-dialect/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,12 +3,11 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-hibernate-dialect</artifactId>
<name>Hibernate Dialect</name>
- <version>6.2.0-SNAPSHOT</version>
<description>Teiid Hibernate Dialect</description>
<dependencies>
<dependency>
Modified: trunk/metadata/pom.xml
===================================================================
--- trunk/metadata/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/metadata/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-metadata</artifactId>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -6,7 +6,7 @@
<artifactId>teiid</artifactId>
<packaging>pom</packaging>
<name>Teiid</name>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
<description>Federated SQL and XML query engine.</description>
<properties>
<ant.version>1.7.0</ant.version>
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/runtime/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.teiid</groupId>
Modified: trunk/server/pom.xml
===================================================================
--- trunk/server/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/server/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -5,7 +5,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-server</artifactId>
Modified: trunk/test-integration/common/pom.xml
===================================================================
--- trunk/test-integration/common/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/test-integration/common/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -4,7 +4,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>common</artifactId>
Modified: trunk/test-integration/db/pom.xml
===================================================================
--- trunk/test-integration/db/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/test-integration/db/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -4,7 +4,7 @@
<parent>
<artifactId>teiid-test-integration</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>db</artifactId>
Modified: trunk/test-integration/pom.xml
===================================================================
--- trunk/test-integration/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/test-integration/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -4,7 +4,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-test-integration</artifactId>
Modified: trunk/txn-jbossts/pom.xml
===================================================================
--- trunk/txn-jbossts/pom.xml 2009-09-15 03:49:18 UTC (rev 1355)
+++ trunk/txn-jbossts/pom.xml 2009-09-15 15:10:09 UTC (rev 1356)
@@ -3,7 +3,7 @@
<parent>
<artifactId>teiid</artifactId>
<groupId>org.jboss.teiid</groupId>
- <version>6.2.0-SNAPSHOT</version>
+ <version>6.3.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>teiid-txn-jbossts</artifactId>
16 years, 7 months