Author: shawkins
Date: 2009-10-24 14:07:35 -0400 (Sat, 24 Oct 2009)
New Revision: 1536
Added:
trunk/engine/src/main/java/org/teiid/metadata/
trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java
Removed:
trunk/engine/src/main/java/com/metamatrix/query/metadata/MetadataStore.java
Modified:
trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java
trunk/engine/src/main/java/com/metamatrix/dqp/service/MetadataService.java
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/capabilities/SharedCachedFinder.java
trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties
trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java
trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeMetadataService.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
Log:
TEIID-871 TEIID-792 TEIID-102 TEIID-254 TEIID-869 TEIID-875 further clean up of metadata
related logic. The index connector has been removed and the system virtual views promoted
to physical tables. some of the tables/procedures have been removed. and minor changes
have been made to MMDatabaseMetadata queries.
Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java 2009-10-24
18:05:58 UTC (rev 1535)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/DataService.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -27,7 +27,7 @@
import java.util.Properties;
import org.teiid.adminapi.ConnectionPool;
-import org.teiid.connector.metadata.runtime.ConnectorMetadata;
+import org.teiid.connector.metadata.runtime.MetadataStore;
import org.teiid.dqp.internal.process.DQPWorkContext;
import com.metamatrix.api.exception.ComponentNotFoundException;
@@ -90,7 +90,7 @@
* @return
* @throws MetaMatrixComponentException
*/
- ConnectorMetadata getConnectorMetadata(String vdbName, String vdbVersion, String
modelName, Properties importProperties) throws MetaMatrixComponentException;
+ MetadataStore getConnectorMetadata(String vdbName, String vdbVersion, String
modelName, Properties importProperties) throws MetaMatrixComponentException;
/**
* Start the Connector Binding by the name given, if it is already added and not
srarted.
Modified: trunk/engine/src/main/java/com/metamatrix/dqp/service/MetadataService.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/dqp/service/MetadataService.java 2009-10-24
18:05:58 UTC (rev 1535)
+++ trunk/engine/src/main/java/com/metamatrix/dqp/service/MetadataService.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -25,10 +25,10 @@
import java.util.Map;
import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
+import org.teiid.metadata.CompositeMetadataStore;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.application.ApplicationService;
-import com.metamatrix.connector.metadata.internal.IObjectSource;
import com.metamatrix.query.metadata.QueryMetadataInterface;
/**
@@ -37,7 +37,7 @@
QueryMetadataInterface lookupMetadata(String vdbName, String vdbVersion) throws
MetaMatrixComponentException;
- IObjectSource getMetadataObjectSource(String vdbName, String vdbVersion) throws
MetaMatrixComponentException;
+ CompositeMetadataStore getMetadataObjectSource(String vdbName, String vdbVersion)
throws MetaMatrixComponentException;
Map<String, DatatypeRecordImpl> getBuiltinDatatypes() throws
MetaMatrixComponentException;
Deleted: trunk/engine/src/main/java/com/metamatrix/query/metadata/MetadataStore.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/metadata/MetadataStore.java 2009-10-24
18:05:58 UTC (rev 1535)
+++ trunk/engine/src/main/java/com/metamatrix/query/metadata/MetadataStore.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership. Some portions may be licensed
- * to Red Hat, Inc. under one or more contributor license agreements.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- */
-
-package com.metamatrix.query.metadata;
-
-import java.util.Collection;
-
-import org.teiid.connector.metadata.runtime.AbstractMetadataRecord;
-import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
-import org.teiid.connector.metadata.runtime.ModelRecordImpl;
-import org.teiid.connector.metadata.runtime.ProcedureRecordImpl;
-import org.teiid.connector.metadata.runtime.PropertyRecordImpl;
-import org.teiid.connector.metadata.runtime.TableRecordImpl;
-
-import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.api.exception.query.QueryMetadataException;
-import com.metamatrix.core.MetaMatrixCoreException;
-
-public interface MetadataStore {
-
- ModelRecordImpl getModel(String fullName) throws QueryMetadataException,
MetaMatrixComponentException;
-
- TableRecordImpl findGroup(String fullName) throws QueryMetadataException,
MetaMatrixComponentException;
-
- /**
- * Returns the fully qualified names of groups matching the given partial name.
- *
- * @param partialGroupName expected to be in lowercase
- * @return
- * @throws MetaMatrixComponentException
- * @throws QueryMetadataException
- */
- Collection<String> getGroupsForPartialName(final String partialGroupName)
- throws MetaMatrixComponentException, QueryMetadataException;
-
- ProcedureRecordImpl getStoredProcedure(final String fullyQualifiedProcedureName)
- throws MetaMatrixComponentException, QueryMetadataException;
-
- Collection<PropertyRecordImpl> getExtensionProperties(AbstractMetadataRecord
record) throws MetaMatrixComponentException;
-
- /**
- * Get the set of model names known to this store.
- */
- Collection<String> getModelNames();
-
- /**
- * Search method used by the index connector
- * @param indexName
- * @param patterns
- * @param isPrefix
- * @param isCaseSensitive
- * @return
- * @throws MetaMatrixCoreException
- */
- Collection<? extends AbstractMetadataRecord> findMetadataRecords(final String
indexName,
- String pattern, boolean isPrefix,
- boolean isCaseSensitive) throws MetaMatrixCoreException;
-
- boolean postProcessFindMetadataRecords();
-
- /**
- * @deprecated used only for xml
- * @param table
- * @return
- * @throws MetaMatrixComponentException
- */
- Collection getXMLTempGroups(TableRecordImpl table) throws MetaMatrixComponentException;
-
- /**
- * @deprecated used only for xml
- * @param table
- * @return
- * @throws MetaMatrixComponentException
- */
- Collection<? extends AbstractMetadataRecord> findMetadataRecords(final char
recordType,
- final String entityName, final boolean isPartialName)
- throws MetaMatrixComponentException;
-
- /**
- * @deprecated used only by xml and uuid resolving
- * @param fullName
- * @return
- * @throws QueryMetadataException
- * @throws MetaMatrixComponentException
- */
- ColumnRecordImpl findElement(String fullName) throws QueryMetadataException,
MetaMatrixComponentException;
-
-}
Modified:
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java 2009-10-24
18:05:58 UTC (rev 1535)
+++
trunk/engine/src/main/java/com/metamatrix/query/optimizer/relational/PlanToProcessConverter.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -29,6 +29,7 @@
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.query.QueryMetadataException;
import com.metamatrix.api.exception.query.QueryPlannerException;
+import com.metamatrix.core.CoreConstants;
import com.metamatrix.core.id.IDGenerator;
import com.metamatrix.core.id.IntegerID;
import com.metamatrix.core.id.IntegerIDFactory;
@@ -288,7 +289,7 @@
//-- special handling for temp tables. currently they cannot
perform projection
try {
if (command instanceof Query) {
- processNode = correctProjectionForTempTable(node,
aNode);
+ processNode = correctProjectionInternalTables(node,
aNode, (Query)command);
}
} catch (QueryMetadataException err) {
throw new MetaMatrixComponentException(err);
@@ -406,20 +407,23 @@
return processNode;
}
- private RelationalNode correctProjectionForTempTable(PlanNode node,
- AccessNode aNode) throws
QueryMetadataException,
+ private RelationalNode correctProjectionInternalTables(PlanNode node,
+ AccessNode aNode, Query
query) throws QueryMetadataException,
MetaMatrixComponentException {
if (node.getGroups().size() != 1) {
return aNode;
}
GroupSymbol group = node.getGroups().iterator().next();
- if (!group.isTempTable()) {
+ if (!group.isTempTable() &&
!CoreConstants.SYSTEM_MODEL.equals(metadata.getFullName(metadata.getModelID(group.getMetadataID()))))
{
return aNode;
}
List projectSymbols = (List) node.getProperty(NodeConstants.Info.OUTPUT_COLS);
- List acutalColumns = ResolverUtil.resolveElementsInGroup(group, metadata);
+ List<ElementSymbol> acutalColumns =
ResolverUtil.resolveElementsInGroup(group, metadata);
+ if (projectSymbols.equals(acutalColumns)) {
+ return aNode;
+ }
node.setProperty(NodeConstants.Info.OUTPUT_COLS, acutalColumns);
- if (node.getParent().getType() == NodeConstants.Types.PROJECT) {
+ if (node.getParent() != null && node.getParent().getType() ==
NodeConstants.Types.PROJECT) {
//if the parent is already a project, just correcting the output cols is
enough
return aNode;
}
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-10-24
18:05:58 UTC (rev 1535)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -46,7 +46,7 @@
import org.teiid.connector.api.ExecutionContext;
import org.teiid.connector.api.ConnectorAnnotations.ConnectionPooling;
import org.teiid.connector.api.ConnectorAnnotations.SynchronousWorkers;
-import org.teiid.connector.metadata.runtime.ConnectorMetadata;
+import org.teiid.connector.metadata.runtime.MetadataStore;
import org.teiid.connector.metadata.runtime.MetadataFactory;
import org.teiid.connector.xa.api.XAConnector;
import org.teiid.dqp.internal.cache.DQPContextCache;
@@ -141,7 +141,7 @@
return classloader;
}
- public ConnectorMetadata getMetadata(String modelName, Properties importProperties)
throws ConnectorException {
+ public MetadataStore getMetadata(String modelName, Properties importProperties)
throws ConnectorException {
MetadataFactory factory;
try {
factory = new MetadataFactory(modelName, this.metadataService.getBuiltinDatatypes(),
importProperties);
@@ -156,7 +156,7 @@
} finally {
currentThread.setContextClassLoader(threadContextLoader);
}
- return factory;
+ return factory.getMetadataStore();
}
public SourceCapabilities getCapabilities(RequestID requestID, Serializable
executionPayload, DQPWorkContext message) throws ConnectorException {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-10-24
18:05:58 UTC (rev 1535)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -698,6 +698,7 @@
(DataService)
this.environment.findService(DQPServiceNames.DATA_SERVICE),
(VDBService)
this.environment.findService(DQPServiceNames.VDB_SERVICE),
(BufferService)
this.environment.findService(DQPServiceNames.BUFFER_SERVICE),
+ metadataService,
this.maxCodeTables,
this.maxCodeRecords,
this.maxCodeTableRecords);
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2009-10-24
18:05:58 UTC (rev 1535)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DataTierManagerImpl.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -22,11 +22,30 @@
package org.teiid.dqp.internal.process;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
+import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import javax.sql.rowset.serial.SerialBlob;
+import javax.sql.rowset.serial.SerialClob;
+
+import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
+import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
+import org.teiid.connector.metadata.runtime.ForeignKeyRecordImpl;
+import org.teiid.connector.metadata.runtime.KeyRecord;
+import org.teiid.connector.metadata.runtime.MetadataStore;
+import org.teiid.connector.metadata.runtime.ModelRecordImpl;
+import org.teiid.connector.metadata.runtime.ProcedureParameterRecordImpl;
+import org.teiid.connector.metadata.runtime.ProcedureRecordImpl;
+import org.teiid.connector.metadata.runtime.TableRecordImpl;
import org.teiid.dqp.internal.process.CodeTableCache.CacheKey;
+import org.teiid.metadata.CompositeMetadataStore;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.MetaMatrixProcessingException;
@@ -35,6 +54,8 @@
import com.metamatrix.common.buffer.TupleSource;
import com.metamatrix.common.comm.api.ResultsReceiver;
import com.metamatrix.common.log.LogManager;
+import com.metamatrix.common.vdb.api.ModelInfo;
+import com.metamatrix.core.CoreConstants;
import com.metamatrix.core.util.Assertion;
import com.metamatrix.dqp.DQPPlugin;
import com.metamatrix.dqp.embedded.DQPEmbeddedProperties;
@@ -46,45 +67,325 @@
import com.metamatrix.dqp.message.RequestMessage;
import com.metamatrix.dqp.service.BufferService;
import com.metamatrix.dqp.service.DataService;
+import com.metamatrix.dqp.service.MetadataService;
import com.metamatrix.dqp.service.VDBService;
import com.metamatrix.dqp.util.LogConstants;
+import com.metamatrix.metadata.runtime.api.MetadataSourceUtil;
import com.metamatrix.query.processor.ProcessorDataManager;
import com.metamatrix.query.processor.QueryProcessor;
import com.metamatrix.query.sql.ReservedWords;
import com.metamatrix.query.sql.lang.Command;
+import com.metamatrix.query.sql.lang.Query;
+import com.metamatrix.query.sql.lang.StoredProcedure;
+import com.metamatrix.query.sql.lang.UnaryFromClause;
+import com.metamatrix.query.sql.symbol.GroupSymbol;
+import com.metamatrix.query.sql.symbol.SingleElementSymbol;
import com.metamatrix.query.util.CommandContext;
public class DataTierManagerImpl implements ProcessorDataManager {
+
+ private enum SystemTables {
+ VIRTUALDATABASES,
+ MODELS,
+ GROUPS,
+ DATATYPES,
+ ELEMENTS,
+ KEYS,
+ PROCEDURES,
+ KEYELEMENTS,
+ PROCEDUREPARAMS,
+ MODELPROPERTIES,
+ GROUPPROPERTIES,
+ DATATYPEPROPERTIES,
+ ELEMENTPROPERTIES,
+ KEYPROPERTIES,
+ PROCEDUREPROPERTIES,
+ PROCEDUREPARAMPROPERTIES,
+ REFERENCEKEYCOLUMNS
+ }
+
+ private enum SystemProcs {
+ GETCHARACTERVDBRESOURCE,
+ GETBINARYVDBRESOURCE,
+ GETVDBRESOURCEPATHS
+ }
+
+ private class CollectionTupleSource implements TupleSource {
+
+ private Iterator<List<Object>> tuples;
+ private List<SingleElementSymbol> schema;
+
+ public CollectionTupleSource(Iterator<List<Object>> tuples,
+ List<SingleElementSymbol> schema) {
+ this.tuples = tuples;
+ this.schema = schema;
+ }
+ @Override
+ public List<?> nextTuple() throws MetaMatrixComponentException,
+ MetaMatrixProcessingException {
+ if (tuples.hasNext()) {
+ return tuples.next();
+ }
+ return null;
+ }
+
+ @Override
+ public List<SingleElementSymbol> getSchema() {
+ return schema;
+ }
+
+ @Override
+ public void closeSource() throws MetaMatrixComponentException {
+
+ }
+ }
+
// Resources
private DQPCore requestMgr;
private DataService dataService;
private VDBService vdbService;
private BufferService bufferService;
+ private MetadataService metadataService;
// Processor state
private CodeTableCache codeTableCache;
public DataTierManagerImpl(DQPCore requestMgr,
- DataService dataService, VDBService vdbService, BufferService bufferService,
+ DataService dataService, VDBService vdbService, BufferService bufferService,
MetadataService metadataService,
int maxCodeTables, int maxCodeRecords, int maxCodeTableRecords) {
this.requestMgr = requestMgr;
this.dataService = dataService;
this.vdbService = vdbService;
this.bufferService = bufferService;
+ this.metadataService = metadataService;
this.codeTableCache = new CodeTableCache(maxCodeTables, maxCodeRecords,
maxCodeTableRecords);
}
+ @SuppressWarnings("unchecked")
public TupleSource registerRequest(Object processorId, Command command,
String modelName, String connectorBindingId, int nodeID) throws
MetaMatrixComponentException, MetaMatrixProcessingException {
RequestWorkItem workItem = requestMgr.getRequestWorkItem((RequestID)processorId);
+
+ if(CoreConstants.SYSTEM_MODEL.equals(modelName)) {
+ String vdbName = workItem.getDqpWorkContext().getVdbName();
+ String vdbVersion = workItem.getDqpWorkContext().getVdbVersion();
+ CompositeMetadataStore metadata =
this.metadataService.getMetadataObjectSource(vdbName, vdbVersion);
+ Collection rows = new ArrayList();
+ if (command instanceof Query) {
+ Query query = (Query)command;
+ UnaryFromClause ufc = (UnaryFromClause)query.getFrom().getClauses().get(0);
+ GroupSymbol group = ufc.getGroup();
+ final SystemTables sysTable =
SystemTables.valueOf(group.getNonCorrelationName().substring(CoreConstants.SYSTEM_MODEL.length()
+ 1).toUpperCase());
+ switch (sysTable) {
+ case VIRTUALDATABASES:
+ rows.add(Arrays.asList(vdbName, vdbVersion));
+ break;
+ case MODELS:
+ case MODELPROPERTIES:
+ for (MetadataStore store : metadata.getMetadataStores()) {
+ for (ModelRecordImpl model : store.getModels().values()) {
+ if(checkVisibility(vdbName, vdbVersion, model.getName())) {
+ if (sysTable == SystemTables.MODELS) {
+ rows.add(Arrays.asList(model.getName(), model.isPhysical(), model.getUUID(),
model.getAnnotation(), model.getPrimaryMetamodelUri()));
+ } else {
+ for (Map.Entry<String, String> entry : model.getProperties().entrySet())
{
+ rows.add(Arrays.asList(model.getName(), entry.getKey(), entry.getValue(),
model.getUUID()));
+ }
+ }
+ }
+ }
+ }
+ break;
+ case DATATYPES:
+ case DATATYPEPROPERTIES:
+ rows = new LinkedHashSet(); //System types are duplicated in each indexed vdb...
+ for (MetadataStore store : metadata.getMetadataStores()) {
+ for (DatatypeRecordImpl datatype : store.getDatatypes()) {
+ if (sysTable == SystemTables.DATATYPES) {
+ rows.add(Arrays.asList(datatype.getName(), datatype.isBuiltin(),
datatype.isBuiltin(), datatype.getName(), datatype.getJavaClassName(),
datatype.getScale(),
+ datatype.getLength(), datatype.getNullType().toString(), datatype.isSigned(),
datatype.isAutoIncrement(), datatype.isCaseSensitive(), datatype.getPrecisionLength(),
+ datatype.getRadix(), datatype.getSearchType().toString(), datatype.getUUID(),
datatype.getRuntimeTypeName(), datatype.getBasetypeName(), datatype.getAnnotation()));
+ } else {
+ for (Map.Entry<String, String> entry : datatype.getProperties().entrySet())
{
+ rows.add(Arrays.asList(datatype.getName(), entry.getKey(), entry.getValue(),
datatype.getUUID()));
+ }
+ }
+ }
+ }
+ break;
+ case PROCEDURES:
+ case PROCEDUREPROPERTIES:
+ case PROCEDUREPARAMS:
+ case PROCEDUREPARAMPROPERTIES:
+ for (MetadataStore store : metadata.getMetadataStores()) {
+ for (ProcedureRecordImpl proc : store.getProcedures().values()) {
+ if(!checkVisibility(vdbName, vdbVersion, proc.getModelName())) {
+ continue;
+ }
+ switch (sysTable) {
+ case PROCEDURES:
+ ModelRecordImpl model =
store.getModels().get(proc.getModelName().toLowerCase());
+ rows.add(Arrays.asList(proc.getModelName(), proc.getName(),
proc.getNameInSource(), proc.getResultSetID() != null, model.getUUID(), proc.getUUID(),
proc.getAnnotation(), proc.getFullName()));
+ break;
+ case PROCEDUREPROPERTIES:
+ for (Map.Entry<String, String> entry : proc.getProperties().entrySet()) {
+ rows.add(Arrays.asList(proc.getModelName(), proc.getName(), entry.getKey(),
entry.getValue(), proc.getUUID()));
+ }
+ break;
+ default:
+ for (ProcedureParameterRecordImpl param : proc.getParameters()) {
+ if (sysTable == SystemTables.PROCEDUREPARAMS) {
+ rows.add(Arrays.asList(proc.getModelName(), proc.getFullName(),
param.getName(), param.getDatatype().getRuntimeTypeName(), param.getPosition(),
param.getType().toString(), param.isOptional(),
+ param.getPrecision(), param.getLength(), param.getScale(), param.getRadix(),
param.getNullType().toString(), param.getUUID()));
+ } else {
+ for (Map.Entry<String, String> entry : param.getProperties().entrySet())
{
+ rows.add(Arrays.asList(proc.getModelName(), proc.getFullName(),
param.getName(), entry.getKey(), entry.getValue(), param.getUUID()));
+ }
+ }
+ }
+ if (proc.getResultSetID() != null) {
+ for (ColumnRecordImpl param : proc.getResultSet().getColumns()) {
+ if (sysTable == SystemTables.PROCEDUREPARAMS) {
+ rows.add(Arrays.asList(proc.getModelName(), proc.getFullName(),
param.getName(), param.getDatatype().getRuntimeTypeName(), param.getPosition(),
ProcedureParameterRecordImpl.Type.ResultSet.toString(), false,
+ param.getPrecision(), param.getLength(), param.getScale(), param.getRadix(),
param.getNullType().toString(), param.getUUID()));
+ } else {
+ for (Map.Entry<String, String> entry : param.getProperties().entrySet())
{
+ rows.add(Arrays.asList(proc.getModelName(), proc.getFullName(),
param.getName(), entry.getKey(), entry.getValue(), param.getUUID()));
+ }
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ break;
+ default:
+ for (MetadataStore store : metadata.getMetadataStores()) {
+ for (TableRecordImpl table : store.getTables().values()) {
+ if(!checkVisibility(vdbName, vdbVersion, table.getModelName())) {
+ continue;
+ }
+ switch (sysTable) {
+ case GROUPS:
+ rows.add(Arrays.asList(table.getModelName(), table.getFullName(),
table.getName(), table.getTableType().toString(), table.getNameInSource(),
+ table.isPhysical(), table.getName().toUpperCase(), table.supportsUpdate(),
table.getUUID(), table.getCardinality(), table.getAnnotation(), table.isSystem(),
table.isMaterialized()));
+ break;
+ case GROUPPROPERTIES:
+ for (Map.Entry<String, String> entry : table.getProperties().entrySet()) {
+ rows.add(Arrays.asList(table.getModelName(), table.getFullName(),
entry.getKey(), entry.getValue(), table.getName(), table.getName().toUpperCase(),
table.getUUID()));
+ }
+ break;
+ case ELEMENTS:
+ for (ColumnRecordImpl column : table.getColumns()) {
+ if (column.getDatatype() == null) {
+ continue; //some mapping classes don't set the datatype
+ }
+ rows.add(Arrays.asList(table.getModelName(), table.getName(),
table.getFullName(), column.getName(), column.getPosition(), column.getNameInSource(),
+ column.getDatatype().getRuntimeTypeName(), column.getScale(),
column.getLength(), column.isFixedLength(), column.isSelectable(), column.isUpdatable(),
+ column.isCaseSensitive(), column.isSigned(), column.isCurrency(),
column.isAutoIncrementable(), column.getNullType().toString(), column.getMinValue(),
+ column.getMaxValue(), column.getSearchType().toString(), column.getFormat(),
column.getDefaultValue(), column.getDatatype().getJavaClassName(), column.getPrecision(),
+ column.getCharOctetLength(), column.getRadix(), table.getName().toUpperCase(),
column.getName().toUpperCase(), column.getUUID(), column.getAnnotation()));
+ }
+ break;
+ case ELEMENTPROPERTIES:
+ for (ColumnRecordImpl column : table.getColumns()) {
+ for (Map.Entry<String, String> entry : column.getProperties().entrySet())
{
+ rows.add(Arrays.asList(table.getModelName(), table.getFullName(),
column.getName(), entry.getKey(), entry.getValue(), table.getName(),
column.getName().toUpperCase(),
+ table.getName().toUpperCase(), column.getUUID()));
+ }
+ }
+ break;
+ case KEYS:
+ for (KeyRecord key : table.getAllKeys()) {
+ rows.add(Arrays.asList(table.getModelName(), table.getFullName(), key.getName(),
key.getAnnotation(), key.getNameInSource(), key.getType().toString(),
+ false, table.getName(), table.getName().toUpperCase(), (key instanceof
ForeignKeyRecordImpl)?((ForeignKeyRecordImpl)key).getUniqueKeyID():null, key.getUUID()));
+ }
+ break;
+ case KEYPROPERTIES:
+ for (KeyRecord key : table.getAllKeys()) {
+ for (Map.Entry<String, String> entry : key.getProperties().entrySet()) {
+ rows.add(Arrays.asList(table.getModelName(), table.getFullName(),
key.getName(), entry.getKey(), entry.getValue(), table.getName(),
table.getName().toUpperCase(),
+ key.getUUID()));
+ }
+ }
+ break;
+ case KEYELEMENTS:
+ for (KeyRecord key : table.getAllKeys()) {
+ int postition = 1;
+ for (ColumnRecordImpl column : key.getColumns()) {
+ rows.add(Arrays.asList(table.getModelName(), table.getFullName(),
column.getName(), key.getName(), key.getType().toString(), table.getName(),
table.getName().toUpperCase(),
+ (key instanceof
ForeignKeyRecordImpl)?((ForeignKeyRecordImpl)key).getUniqueKeyID():null, key.getUUID(),
postition++));
+ }
+ }
+ break;
+ case REFERENCEKEYCOLUMNS:
+ for (ForeignKeyRecordImpl key : table.getForeignKeys()) {
+ int postition = 0;
+ for (ColumnRecordImpl column : key.getColumns()) {
+ TableRecordImpl pkTable = key.getPrimaryKey().getTable();
+ rows.add(Arrays.asList(null, vdbName, pkTable.getFullName(),
key.getPrimaryKey().getColumns().get(postition).getName(), null, vdbName,
table.getFullName(), column.getName(),
+ ++postition, 3, 3, key.getName(), key.getPrimaryKey().getName(), 5));
+ }
+ }
+ break;
+ }
+ }
+ }
+ break;
+ }
+ } else {
+ StoredProcedure proc = (StoredProcedure)command;
+ GroupSymbol group = proc.getGroup();
+ final SystemProcs sysTable =
SystemProcs.valueOf(group.getCanonicalName().substring(CoreConstants.SYSTEM_MODEL.length()
+ 1));
+ switch (sysTable) {
+ case GETVDBRESOURCEPATHS:
+ Set<String> filePaths = metadata.getMetadataSource().getEntries();
+ for (String filePath : filePaths) {
+ if (vdbService.getFileVisibility(vdbName, vdbVersion, filePath) !=
ModelInfo.PUBLIC) {
+ continue;
+ }
+ rows.add(Arrays.asList(filePath, filePath.endsWith(".INDEX")));
//$NON-NLS-1$
+ }
+ break;
+ case GETBINARYVDBRESOURCE:
+ String filePath = (String)proc.getParameter(0).getValue();
+ if (metadata.getMetadataSource().getEntries().contains(filePath) &&
vdbService.getFileVisibility(vdbName, vdbVersion, filePath) == ModelInfo.PUBLIC) {
+ try {
+ rows.add(Arrays.asList(new
SerialBlob(MetadataSourceUtil.getFileContentAsString(filePath,
metadata.getMetadataSource()).getBytes())));
+ } catch (SQLException e) {
+ throw new MetaMatrixComponentException(e);
+ }
+ }
+ break;
+ case GETCHARACTERVDBRESOURCE:
+ filePath = (String)proc.getParameter(0).getValue();
+ if (metadata.getMetadataSource().getEntries().contains(filePath) &&
vdbService.getFileVisibility(vdbName, vdbVersion, filePath) == ModelInfo.PUBLIC) {
+ try {
+ rows.add(Arrays.asList(new
SerialClob(MetadataSourceUtil.getFileContentAsString(filePath,
metadata.getMetadataSource()).toCharArray())));
+ } catch (SQLException e) {
+ throw new MetaMatrixComponentException(e);
+ }
+ }
+ break;
+ }
+ }
+ return new CollectionTupleSource(rows.iterator(), command.getProjectedSymbols());
+ }
+
AtomicRequestMessage aqr = createRequest(processorId, command, modelName,
connectorBindingId, nodeID);
DataTierTupleSource tupleSource = new
DataTierTupleSource(aqr.getCommand().getProjectedSymbols(), aqr, this,
aqr.getConnectorID(), workItem);
tupleSource.open();
return tupleSource;
}
+
+ private boolean checkVisibility(String vdbName, String vdbVersion,
+ String modelName) throws MetaMatrixComponentException {
+ return vdbService.getModelVisibility(vdbName, vdbVersion, modelName) ==
ModelInfo.PUBLIC;
+ }
private AtomicRequestMessage createRequest(Object processorId,
Command command, String modelName, String connectorBindingId, int nodeID)
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/capabilities/SharedCachedFinder.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/process/capabilities/SharedCachedFinder.java 2009-10-24
18:05:58 UTC (rev 1535)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/process/capabilities/SharedCachedFinder.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -26,7 +26,9 @@
import java.util.Map;
import com.metamatrix.api.exception.MetaMatrixComponentException;
+import com.metamatrix.core.CoreConstants;
import com.metamatrix.dqp.DQPPlugin;
+import com.metamatrix.query.optimizer.capabilities.BasicSourceCapabilities;
import com.metamatrix.query.optimizer.capabilities.CapabilitiesFinder;
import com.metamatrix.query.optimizer.capabilities.SourceCapabilities;
@@ -34,6 +36,8 @@
*/
public class SharedCachedFinder implements CapabilitiesFinder {
+ private static BasicSourceCapabilities SYSTEM_CAPS = new BasicSourceCapabilities();
+
private CapabilitiesFinder internalFinder;
// Cache of SourceCapabilities by modelName
@@ -48,6 +52,7 @@
public SharedCachedFinder(CapabilitiesFinder internalFinder, Map<String,
SourceCapabilities> sharedCache) {
this.internalFinder = internalFinder;
this.capabilityCache = sharedCache;
+ userCache.put(CoreConstants.SYSTEM_MODEL, SYSTEM_CAPS);
}
/**
Copied: trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java (from
rev 1529, trunk/metadata/src/main/java/org/teiid/metadata/CompositeMetadataStore.java)
===================================================================
--- trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
(rev 0)
+++ trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -0,0 +1,175 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.metadata;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
+import org.teiid.connector.metadata.runtime.MetadataStore;
+import org.teiid.connector.metadata.runtime.ModelRecordImpl;
+import org.teiid.connector.metadata.runtime.ProcedureRecordImpl;
+import org.teiid.connector.metadata.runtime.TableRecordImpl;
+import org.teiid.connector.metadata.runtime.TableRecordImpl.Type;
+
+import com.metamatrix.api.exception.MetaMatrixComponentException;
+import com.metamatrix.api.exception.query.QueryMetadataException;
+import com.metamatrix.core.id.UUID;
+import com.metamatrix.core.util.StringUtil;
+import com.metamatrix.metadata.runtime.api.MetadataSource;
+
+/**
+ * Aggregates the metadata from multiple stores.
+ * IMPORTANT: All strings queries should be in lower case.
+ */
+public class CompositeMetadataStore {
+
+ private MetadataSource metadataSource;
+ private Map<String, MetadataStore> storeMap = new LinkedHashMap<String,
MetadataStore>();
+ private List<MetadataStore> metadataStores;
+
+ public CompositeMetadataStore(List<MetadataStore> metadataStores, MetadataSource
metadataSource) {
+ this.metadataSource = metadataSource;
+ this.metadataStores = metadataStores;
+ for (MetadataStore metadataStore : metadataStores) {
+ for (String model : metadataStore.getModels().keySet()) {
+ storeMap.put(model.toLowerCase(), metadataStore);
+ }
+ }
+ }
+
+ public ModelRecordImpl getModel(String fullName)
+ throws QueryMetadataException, MetaMatrixComponentException {
+ ModelRecordImpl result = getMetadataStore(fullName).getModels().get(fullName);
+ if (result == null) {
+ throw new
QueryMetadataException(fullName+TransformationMetadata.NOT_EXISTS_MESSAGE);
+ }
+ return result;
+ }
+
+ public TableRecordImpl findGroup(String fullName)
+ throws QueryMetadataException {
+ List<String> tokens = StringUtil.getTokens(fullName,
TransformationMetadata.DELIMITER_STRING);
+ if (tokens.size() < 2) {
+ throw new
QueryMetadataException(fullName+TransformationMetadata.NOT_EXISTS_MESSAGE);
+ }
+ TableRecordImpl result = getMetadataStore(tokens.get(0)).getTables().get(fullName);
+ if (result == null) {
+ throw new
QueryMetadataException(fullName+TransformationMetadata.NOT_EXISTS_MESSAGE);
+ }
+ return result;
+ }
+
+ public Collection<String> getGroupsForPartialName(String partialGroupName) {
+ List<String> result = new LinkedList<String>();
+ for (MetadataStore store : metadataStores) {
+ for (Map.Entry<String, TableRecordImpl> entry : store.getTables().entrySet()) {
+ if (entry.getKey().endsWith(partialGroupName)) {
+ result.add(entry.getValue().getFullName());
+ }
+ }
+ }
+ return result;
+ }
+
+ public ProcedureRecordImpl getStoredProcedure(
+ String fullyQualifiedProcedureName)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ List<String> tokens = StringUtil.getTokens(fullyQualifiedProcedureName,
TransformationMetadata.DELIMITER_STRING);
+ if (tokens.size() < 2) {
+ throw new
QueryMetadataException(fullyQualifiedProcedureName+TransformationMetadata.NOT_EXISTS_MESSAGE);
+ }
+ ProcedureRecordImpl result =
getMetadataStore(tokens.get(0)).getProcedures().get(fullyQualifiedProcedureName);
+ if (result == null) {
+ throw new
QueryMetadataException(fullyQualifiedProcedureName+TransformationMetadata.NOT_EXISTS_MESSAGE);
+ }
+ return result;
+ }
+
+ private MetadataStore getMetadataStore(String modelName) throws QueryMetadataException
{
+ MetadataStore store = this.storeMap.get(modelName);
+ if (store == null) {
+ throw new
QueryMetadataException(modelName+TransformationMetadata.NOT_EXISTS_MESSAGE);
+ }
+ return store;
+ }
+
+ public MetadataSource getMetadataSource() {
+ return metadataSource;
+ }
+
+ public List<MetadataStore> getMetadataStores() {
+ return metadataStores;
+ }
+
+ /*
+ * The next methods are hold overs from XML/UUID resolving and will perform poorly
+ */
+
+ public ColumnRecordImpl findElement(String elementName) throws QueryMetadataException {
+ ColumnRecordImpl result = null;
+ if (StringUtil.startsWithIgnoreCase(elementName,UUID.PROTOCOL)) {
+ for (MetadataStore store : this.metadataStores) {
+ for (TableRecordImpl table : store.getTables().values()) {
+ for (ColumnRecordImpl column : table.getColumns()) {
+ if (column.getUUID().equalsIgnoreCase(elementName)) {
+ return column;
+ }
+ }
+ }
+ }
+ } else {
+ List<String> tokens = StringUtil.getTokens(elementName,
TransformationMetadata.DELIMITER_STRING);
+ if (tokens.size() < 3) {
+ throw new
QueryMetadataException(elementName+TransformationMetadata.NOT_EXISTS_MESSAGE);
+ }
+ TableRecordImpl table = findGroup(StringUtil.join(tokens.subList(0, tokens.size() -
1), TransformationMetadata.DELIMITER_STRING));
+ for (ColumnRecordImpl column : table.getColumns()) {
+ if (column.getFullName().equalsIgnoreCase(elementName)) {
+ return column;
+ }
+ }
+ }
+ if (result == null) {
+ throw new
QueryMetadataException(elementName+TransformationMetadata.NOT_EXISTS_MESSAGE);
+ }
+ return result;
+ }
+
+ public Collection<TableRecordImpl> getXMLTempGroups(TableRecordImpl tableRecord)
throws QueryMetadataException {
+ ArrayList<TableRecordImpl> results = new ArrayList<TableRecordImpl>();
+ MetadataStore store = getMetadataStore(tableRecord.getModelName().toLowerCase());
+ String namePrefix = tableRecord.getFullName() +
TransformationMetadata.DELIMITER_STRING;
+ for (TableRecordImpl table : store.getTables().values()) {
+ if (table.getTableType() == Type.XmlStagingTable &&
table.getName().startsWith(namePrefix)) {
+ results.add(table);
+ }
+ }
+ return results;
+ }
+
+}
Property changes on:
trunk/engine/src/main/java/org/teiid/metadata/CompositeMetadataStore.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java (from
rev 1529, trunk/metadata/src/main/java/org/teiid/metadata/TransformationMetadata.java)
===================================================================
--- trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java
(rev 0)
+++ trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -0,0 +1,999 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package org.teiid.metadata;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.teiid.connector.metadata.runtime.AbstractMetadataRecord;
+import org.teiid.connector.metadata.runtime.ColumnRecordImpl;
+import org.teiid.connector.metadata.runtime.ColumnSetRecordImpl;
+import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
+import org.teiid.connector.metadata.runtime.ForeignKeyRecordImpl;
+import org.teiid.connector.metadata.runtime.KeyRecord;
+import org.teiid.connector.metadata.runtime.ModelRecordImpl;
+import org.teiid.connector.metadata.runtime.ProcedureParameterRecordImpl;
+import org.teiid.connector.metadata.runtime.ProcedureRecordImpl;
+import org.teiid.connector.metadata.runtime.TableRecordImpl;
+import org.teiid.connector.metadata.runtime.BaseColumn.NullType;
+import org.teiid.connector.metadata.runtime.ColumnRecordImpl.SearchType;
+import org.teiid.connector.metadata.runtime.ProcedureParameterRecordImpl.Type;
+
+import com.metamatrix.api.exception.MetaMatrixComponentException;
+import com.metamatrix.api.exception.query.QueryMetadataException;
+import com.metamatrix.common.properties.UnmodifiableProperties;
+import com.metamatrix.common.types.DataTypeManager;
+import com.metamatrix.core.util.ArgCheck;
+import com.metamatrix.core.util.LRUCache;
+import com.metamatrix.core.util.StringUtil;
+import com.metamatrix.dqp.DQPPlugin;
+import com.metamatrix.metadata.runtime.api.MetadataSourceUtil;
+import com.metamatrix.query.mapping.relational.QueryNode;
+import com.metamatrix.query.mapping.xml.MappingDocument;
+import com.metamatrix.query.mapping.xml.MappingLoader;
+import com.metamatrix.query.mapping.xml.MappingNode;
+import com.metamatrix.query.metadata.BasicQueryMetadata;
+import com.metamatrix.query.metadata.StoredProcedureInfo;
+import com.metamatrix.query.metadata.SupportConstants;
+import com.metamatrix.query.sql.lang.SPParameter;
+
+/**
+ * Modelers implementation of QueryMetadataInterface that reads columns, groups, models
etc.
+ * index files for various metadata properties.
+ */
+public class TransformationMetadata extends BasicQueryMetadata {
+
+ /** Delimiter character used when specifying fully qualified entity names */
+ public static final char DELIMITER_CHAR = StringUtil.Constants.DOT_CHAR;
+ public static final String DELIMITER_STRING = String.valueOf(DELIMITER_CHAR);
+
+ // error message cached to avoid i18n lookup each time
+ public static String NOT_EXISTS_MESSAGE =
StringUtil.Constants.SPACE+DQPPlugin.Util.getString("TransformationMetadata.does_not_exist._1");
//$NON-NLS-1$
+
+ private static UnmodifiableProperties EMPTY_PROPS = new UnmodifiableProperties(new
Properties());
+
+ private final CompositeMetadataStore store;
+
+ /*
+ * TODO: move caching to jboss cache structure
+ */
+ private final Map<String, Object> metadataCache =
Collections.synchronizedMap(new LRUCache<String, Object>(500));
+ private final Map<String, String> partialNameToFullNameCache =
Collections.synchronizedMap(new LRUCache<String, String>(1000));
+ private final Map<String, StoredProcedureInfo> procedureCache =
Collections.synchronizedMap(new LRUCache<String, StoredProcedureInfo>(200));
+ /**
+ * TransformationMetadata constructor
+ * @param context Object containing the info needed to lookup metadta.
+ */
+ public TransformationMetadata(final CompositeMetadataStore store) {
+ ArgCheck.isNotNull(store);
+ this.store = store;
+ }
+
+ //==================================================================================
+ // I N T E R F A C E M E T H O D S
+ //==================================================================================
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getElementID(java.lang.String)
+ */
+ public Object getElementID(final String elementName) throws
MetaMatrixComponentException, QueryMetadataException {
+ return getMetadataStore().findElement(elementName.toLowerCase());
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getGroupID(java.lang.String)
+ */
+ public Object getGroupID(final String groupName) throws MetaMatrixComponentException,
QueryMetadataException {
+ return getMetadataStore().findGroup(groupName.toLowerCase());
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getGroupsForPartialName(java.lang.String)
+ */
+ public Collection getGroupsForPartialName(final String partialGroupName)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isNotEmpty(partialGroupName);
+
+ String groupName = this.partialNameToFullNameCache.get(partialGroupName);
+
+ if (groupName != null) {
+ return Arrays.asList(groupName);
+ }
+
+ String partialName = DELIMITER_CHAR + partialGroupName.toLowerCase();
+
+ Collection result = getMetadataStore().getGroupsForPartialName(partialName);
+
+ if (result.size() == 1) {
+ this.partialNameToFullNameCache.put(partialGroupName,
(String)result.iterator().next());
+ }
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getModelID(java.lang.Object)
+ */
+ public Object getModelID(final Object groupOrElementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ if (!(groupOrElementID instanceof TableRecordImpl) && !(groupOrElementID
instanceof ColumnRecordImpl)) {
+ throw createInvalidRecordTypeException(groupOrElementID);
+ }
+
+ String modelName = ((AbstractMetadataRecord)groupOrElementID).getModelName();
+ return getModel(modelName);
+ }
+
+ private Object getModel(String modelName) throws QueryMetadataException,
+ MetaMatrixComponentException {
+ return getMetadataStore().getModel(modelName.toLowerCase());
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getFullName(java.lang.Object)
+ */
+ public String getFullName(final Object metadataID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(AbstractMetadataRecord.class, metadataID);
+ AbstractMetadataRecord metadataRecord = (AbstractMetadataRecord) metadataID;
+ return metadataRecord.getFullName();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getFullElementName(java.lang.String,
java.lang.String)
+ */
+ public String getFullElementName(final String fullGroupName, final String
shortElementName)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isNotEmpty(fullGroupName);
+ ArgCheck.isNotEmpty(shortElementName);
+
+ return fullGroupName + DELIMITER_CHAR + shortElementName;
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getShortElementName(java.lang.String)
+ */
+ public String getShortElementName(final String fullElementName) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isNotEmpty(fullElementName);
+ int index = fullElementName.lastIndexOf(DELIMITER_CHAR);
+ if(index >= 0) {
+ return fullElementName.substring(index+1);
+ }
+ return fullElementName;
+ }
+
+ /**
+ * Return the text portion of the fullElementName representing a group.
+ * That means that this should only return text that is part of the
+ * fullElementName and not look up new IDs or do much of anything fancy.
+ * This method is used by the resolver to decide which portion of a fully-
+ * qualified element name is the group name. It will compare whatever comes
+ * back with the actual group names and aliases in the query, which is
+ * why it is important not to introduce new metadata here. Also, returning
+ * null indicates that no portion of the fullElementName is a
+ * group name - that is ok as it will be resolved as an ambiguous element.
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getGroupName(java.lang.String)
+ */
+ public String getGroupName(final String fullElementName) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isNotEmpty(fullElementName);
+
+ int index = fullElementName.lastIndexOf(DELIMITER_CHAR);
+ if(index >= 0) {
+ return fullElementName.substring(0, index);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInGroupID(java.lang.Object)
+ */
+ public List getElementIDsInGroupID(final Object groupID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ return ((TableRecordImpl)groupID).getColumns();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getGroupIDForElementID(java.lang.Object)
+ */
+ public Object getGroupIDForElementID(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ ColumnRecordImpl columnRecord = (ColumnRecordImpl) elementID;
+ return this.getGroupID(columnRecord.getParentFullName());
+ } else if(elementID instanceof ProcedureParameterRecordImpl){
+ ProcedureParameterRecordImpl columnRecord = (ProcedureParameterRecordImpl)
elementID;
+ return this.getGroupID(columnRecord.getParentFullName());
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getStoredProcedureInfoForProcedure(java.lang.String)
+ */
+ public StoredProcedureInfo getStoredProcedureInfoForProcedure(final String
fullyQualifiedProcedureName)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isNotEmpty(fullyQualifiedProcedureName);
+ String lowerGroupName = fullyQualifiedProcedureName.toLowerCase();
+ StoredProcedureInfo procInfo = this.procedureCache.get(lowerGroupName);
+
+ if (procInfo != null) {
+ return procInfo;
+ }
+
+ ProcedureRecordImpl procRecord =
getMetadataStore().getStoredProcedure(lowerGroupName);
+
+ String procedureFullName = procRecord.getFullName();
+
+ // create the storedProcedure info object that would hold procedure's
metadata
+ procInfo = new StoredProcedureInfo();
+ procInfo.setProcedureCallableName(procRecord.getName());
+ procInfo.setProcedureID(procRecord);
+
+ // modelID for the procedure
+ procInfo.setModelID(getModel(procRecord.getModelName()));
+
+ // get the parameter metadata info
+ for (ProcedureParameterRecordImpl paramRecord : procRecord.getParameters()) {
+ String runtimeType = paramRecord.getRuntimeType();
+ int direction =
this.convertParamRecordTypeToStoredProcedureType(paramRecord.getType());
+ // create a parameter and add it to the procedure object
+ SPParameter spParam = new SPParameter(paramRecord.getPosition(), direction,
paramRecord.getFullName());
+ spParam.setMetadataID(paramRecord);
+ spParam.setClassType(DataTypeManager.getDataTypeClass(runtimeType));
+ procInfo.addParameter(spParam);
+ }
+
+ // if the procedure returns a resultSet, obtain resultSet metadata
+ if(procRecord.getResultSet() != null) {
+ ColumnSetRecordImpl resultRecord = procRecord.getResultSet();
+ // resultSet is the last parameter in the procedure
+ int lastParamIndex = procInfo.getParameters().size() + 1;
+ SPParameter param = new SPParameter(lastParamIndex, SPParameter.RESULT_SET,
resultRecord.getFullName());
+ param.setClassType(java.sql.ResultSet.class);
+ param.setMetadataID(resultRecord);
+
+ for (ColumnRecordImpl columnRecord : resultRecord.getColumns()) {
+ String colType = columnRecord.getRuntimeType();
+ param.addResultSetColumn(columnRecord.getFullName(),
DataTypeManager.getDataTypeClass(colType), columnRecord);
+ }
+
+ procInfo.addParameter(param);
+ }
+
+ // if this is a virtual procedure get the procedure plan
+ if(procRecord.isVirtual()) {
+ QueryNode queryNode = new QueryNode(procedureFullName,
procRecord.getQueryPlan());
+ procInfo.setQueryPlan(queryNode);
+ }
+
+ //subtract 1, to match up with the server
+ procInfo.setUpdateCount(procRecord.getUpdateCount() -1);
+
+ this.procedureCache.put(lowerGroupName, procInfo);
+
+ return procInfo;
+ }
+
+ /**
+ * Method to convert the parameter type returned from a ProcedureParameterRecord
+ * to the parameter type expected by StoredProcedureInfo
+ * @param parameterType
+ * @return
+ */
+ private int convertParamRecordTypeToStoredProcedureType(final
ProcedureParameterRecordImpl.Type parameterType) {
+ switch (parameterType) {
+ case In : return SPParameter.IN;
+ case Out : return SPParameter.OUT;
+ case InOut : return SPParameter.INOUT;
+ case ReturnValue : return SPParameter.RETURN_VALUE;
+ case ResultSet : return SPParameter.RESULT_SET;
+ default :
+ return -1;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getElementType(java.lang.Object)
+ */
+ public String getElementType(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getRuntimeType();
+ } else if(elementID instanceof ProcedureParameterRecordImpl){
+ return ((ProcedureParameterRecordImpl) elementID).getRuntimeType();
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getDefaultValue(java.lang.String)
+ */
+ public Object getDefaultValue(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getDefaultValue();
+ } else if(elementID instanceof ProcedureParameterRecordImpl){
+ return ((ProcedureParameterRecordImpl) elementID).getDefaultValue();
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ public Object getMinimumValue(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getMinValue();
+ } else if(elementID instanceof ProcedureParameterRecordImpl){
+ return null;
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ public Object getMaximumValue(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getMaxValue();
+ } else if(elementID instanceof ProcedureParameterRecordImpl){
+ return null;
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#isVirtualGroup(java.lang.Object)
+ */
+ public boolean isVirtualGroup(final Object groupID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ return ((TableRecordImpl) groupID).isVirtual();
+ }
+
+ /**
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#isProcedureInputElement(java.lang.Object)
+ * @since 4.2
+ */
+ public boolean isProcedure(final Object groupID) throws MetaMatrixComponentException,
QueryMetadataException {
+ if(groupID instanceof ProcedureRecordImpl) {
+ return true;
+ }
+ if(groupID instanceof TableRecordImpl){
+ return false;
+ }
+ throw createInvalidRecordTypeException(groupID);
+ }
+
+ public boolean isVirtualModel(final Object modelID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(ModelRecordImpl.class, modelID);
+ ModelRecordImpl modelRecord = (ModelRecordImpl) modelID;
+ return modelRecord.getModelType() == ModelRecordImpl.Type.Virtual;
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getVirtualPlan(java.lang.Object)
+ */
+ public QueryNode getVirtualPlan(final Object groupID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+
+ TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+ if (!tableRecord.isVirtual()) {
+ throw new
QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.QueryPlan_could_not_be_found_for_physical_group__6")+tableRecord.getFullName());
//$NON-NLS-1$
+ }
+ String transQuery = tableRecord.getSelectTransformation();
+ QueryNode queryNode = new QueryNode(tableRecord.getFullName(), transQuery);
+
+ // get any bindings and add them onto the query node
+ List bindings = tableRecord.getBindings();
+ if(bindings != null) {
+ for(Iterator bindIter = bindings.iterator();bindIter.hasNext();) {
+ queryNode.addBinding((String)bindIter.next());
+ }
+ }
+
+ return queryNode;
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getInsertPlan(java.lang.Object)
+ */
+ public String getInsertPlan(final Object groupID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ TableRecordImpl tableRecordImpl = (TableRecordImpl)groupID;
+ if (!tableRecordImpl.isVirtual()) {
+ throw new
QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.InsertPlan_could_not_be_found_for_physical_group__8")+tableRecordImpl.getFullName());
//$NON-NLS-1$
+ }
+ return ((TableRecordImpl)groupID).getInsertPlan();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getUpdatePlan(java.lang.Object)
+ */
+ public String getUpdatePlan(final Object groupID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ TableRecordImpl tableRecordImpl = (TableRecordImpl)groupID;
+ if (!tableRecordImpl.isVirtual()) {
+ throw new
QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.InsertPlan_could_not_be_found_for_physical_group__10")+tableRecordImpl.getFullName());
//$NON-NLS-1$
+ }
+ return ((TableRecordImpl)groupID).getUpdatePlan();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getDeletePlan(java.lang.Object)
+ */
+ public String getDeletePlan(final Object groupID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ TableRecordImpl tableRecordImpl = (TableRecordImpl)groupID;
+ if (!tableRecordImpl.isVirtual()) {
+ throw new
QueryMetadataException(DQPPlugin.Util.getString("TransformationMetadata.DeletePlan_could_not_be_found_for_physical_group__12")+tableRecordImpl.getFullName());
//$NON-NLS-1$
+ }
+ return ((TableRecordImpl)groupID).getDeletePlan();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#modelSupports(java.lang.Object, int)
+ */
+ public boolean modelSupports(final Object modelID, final int modelConstant)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(ModelRecordImpl.class, modelID);
+
+ switch(modelConstant) {
+ default:
+ throw new
UnsupportedOperationException(DQPPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12")
+ modelConstant); //$NON-NLS-1$
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#groupSupports(java.lang.Object, int)
+ */
+ public boolean groupSupports(final Object groupID, final int groupConstant)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+
+ switch(groupConstant) {
+ case SupportConstants.Group.UPDATE:
+ return tableRecord.supportsUpdate();
+ default:
+ throw new
UnsupportedOperationException(DQPPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12")
+ groupConstant); //$NON-NLS-1$
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#elementSupports(java.lang.Object,
int)
+ */
+ public boolean elementSupports(final Object elementID, final int elementConstant)
+ throws MetaMatrixComponentException, QueryMetadataException {
+
+ if(elementID instanceof ColumnRecordImpl) {
+ ColumnRecordImpl columnRecord = (ColumnRecordImpl) elementID;
+ switch(elementConstant) {
+ case SupportConstants.Element.NULL:
+ return columnRecord.getNullType() == NullType.Nullable;
+ case SupportConstants.Element.NULL_UNKNOWN:
+ return columnRecord.getNullType() == NullType.Unknown;
+ case SupportConstants.Element.SEARCHABLE_COMPARE:
+ return (columnRecord.getSearchType() == SearchType.Searchable ||
columnRecord.getSearchType() == SearchType.All_Except_Like);
+ case SupportConstants.Element.SEARCHABLE_LIKE:
+ return (columnRecord.getSearchType() == SearchType.Searchable ||
columnRecord.getSearchType() == SearchType.Like_Only);
+ case SupportConstants.Element.SELECT:
+ return columnRecord.isSelectable();
+ case SupportConstants.Element.UPDATE:
+ return columnRecord.isUpdatable();
+ case SupportConstants.Element.DEFAULT_VALUE:
+ Object defaultValue = columnRecord.getDefaultValue();
+ if(defaultValue == null) {
+ return false;
+ }
+ return true;
+ case SupportConstants.Element.AUTO_INCREMENT:
+ return columnRecord.isAutoIncrementable();
+ case SupportConstants.Element.CASE_SENSITIVE:
+ return columnRecord.isCaseSensitive();
+ case SupportConstants.Element.SIGNED:
+ return columnRecord.isSigned();
+ default:
+ throw new
UnsupportedOperationException(DQPPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12")
+ elementConstant); //$NON-NLS-1$
+ }
+ } else if(elementID instanceof ProcedureParameterRecordImpl) {
+ ProcedureParameterRecordImpl columnRecord = (ProcedureParameterRecordImpl)
elementID;
+ switch(elementConstant) {
+ case SupportConstants.Element.NULL:
+ return columnRecord.getNullType() == NullType.Nullable;
+ case SupportConstants.Element.NULL_UNKNOWN:
+ return columnRecord.getNullType() == NullType.Unknown;
+ case SupportConstants.Element.SEARCHABLE_COMPARE:
+ case SupportConstants.Element.SEARCHABLE_LIKE:
+ return false;
+ case SupportConstants.Element.SELECT:
+ return columnRecord.getType() != Type.In;
+ case SupportConstants.Element.UPDATE:
+ return false;
+ case SupportConstants.Element.DEFAULT_VALUE:
+ Object defaultValue = columnRecord.getDefaultValue();
+ if(defaultValue == null) {
+ return false;
+ }
+ return true;
+ case SupportConstants.Element.AUTO_INCREMENT:
+ return false;
+ case SupportConstants.Element.CASE_SENSITIVE:
+ return false;
+ case SupportConstants.Element.SIGNED:
+ return true;
+ default:
+ throw new
UnsupportedOperationException(DQPPlugin.Util.getString("TransformationMetadata.Unknown_support_constant___12")
+ elementConstant); //$NON-NLS-1$
+ }
+
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ private IllegalArgumentException createInvalidRecordTypeException(Object elementID)
{
+ return new
IllegalArgumentException(DQPPlugin.Util.getString("TransformationMetadata.Invalid_type",
elementID.getClass().getName())); //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getMaxSetSize(java.lang.Object)
+ */
+ public int getMaxSetSize(final Object modelID) throws MetaMatrixComponentException,
QueryMetadataException {
+ ArgCheck.isInstanceOf(ModelRecordImpl.class, modelID);
+ return 0;
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getIndexesInGroup(java.lang.Object)
+ */
+ public Collection getIndexesInGroup(final Object groupID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ return ((TableRecordImpl)groupID).getIndexes();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getUniqueKeysInGroup(java.lang.Object)
+ */
+ public Collection getUniqueKeysInGroup(final Object groupID)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ TableRecordImpl tableRecordImpl = (TableRecordImpl)groupID;
+ ArrayList<ColumnSetRecordImpl> result = new
ArrayList<ColumnSetRecordImpl>(tableRecordImpl.getUniqueKeys());
+ if (tableRecordImpl.getPrimaryKey() != null) {
+ result.add(tableRecordImpl.getPrimaryKey());
+ }
+ for (KeyRecord key : tableRecordImpl.getIndexes()) {
+ if (key.getType() == KeyRecord.Type.Index) {
+ result.add(key);
+ }
+ }
+ return result;
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getForeignKeysInGroup(java.lang.Object)
+ */
+ public Collection getForeignKeysInGroup(final Object groupID)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ return ((TableRecordImpl)groupID).getForeignKeys();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getPrimaryKeyIDForForeignKeyID(java.lang.Object)
+ */
+ public Object getPrimaryKeyIDForForeignKeyID(final Object foreignKeyID)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(ForeignKeyRecordImpl.class, foreignKeyID);
+ ForeignKeyRecordImpl fkRecord = (ForeignKeyRecordImpl) foreignKeyID;
+ return fkRecord.getPrimaryKey();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getAccessPatternsInGroup(java.lang.Object)
+ */
+ public Collection getAccessPatternsInGroup(final Object groupID)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ return ((TableRecordImpl)groupID).getAccessPatterns();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInIndex(java.lang.Object)
+ */
+ public List getElementIDsInIndex(final Object index) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(ColumnSetRecordImpl.class, index);
+ return ((ColumnSetRecordImpl)index).getColumns();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInKey(java.lang.Object)
+ */
+ public List getElementIDsInKey(final Object key) throws MetaMatrixComponentException,
QueryMetadataException {
+ ArgCheck.isInstanceOf(ColumnSetRecordImpl.class, key);
+ return ((ColumnSetRecordImpl)key).getColumns();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getElementIDsInAccessPattern(java.lang.Object)
+ */
+ public List getElementIDsInAccessPattern(final Object accessPattern)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(ColumnSetRecordImpl.class, accessPattern);
+ return ((ColumnSetRecordImpl)accessPattern).getColumns();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#isXMLGroup(java.lang.Object)
+ */
+ public boolean isXMLGroup(final Object groupID) throws MetaMatrixComponentException,
QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+
+ TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+ return tableRecord.getTableType() == TableRecordImpl.Type.Document;
+ }
+
+ /**
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#hasMaterialization(java.lang.Object)
+ * @since 4.2
+ */
+ public boolean hasMaterialization(final Object groupID) throws
MetaMatrixComponentException,
+ QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+ return tableRecord.isMaterialized();
+ }
+
+ /**
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getMaterialization(java.lang.Object)
+ * @since 4.2
+ */
+ public Object getMaterialization(final Object groupID) throws
MetaMatrixComponentException,
+ QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+ if(tableRecord.isMaterialized()) {
+ return this.getGroupID(tableRecord.getMaterializedTableName());
+ }
+ return null;
+ }
+
+ /**
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getMaterializationStage(java.lang.Object)
+ * @since 4.2
+ */
+ public Object getMaterializationStage(final Object groupID) throws
MetaMatrixComponentException,
+ QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+ if(tableRecord.isMaterialized()) {
+ return this.getGroupID(tableRecord.getMaterializedStageTableName());
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getMappingNode(java.lang.Object)
+ */
+ public MappingNode getMappingNode(final Object groupID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+
+ TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+ final String groupName = tableRecord.getFullName();
+ if(tableRecord.isVirtual()) {
+ // get mappin transform
+ String document = tableRecord.getSelectTransformation();
+ InputStream inputStream = new ByteArrayInputStream(document.getBytes());
+ MappingLoader reader = new MappingLoader();
+ MappingDocument mappingDoc = null;
+ try{
+ mappingDoc = reader.loadDocument(inputStream);
+ mappingDoc.setName(groupName);
+ } catch (Exception e){
+ throw new MetaMatrixComponentException(e,
DQPPlugin.Util.getString("TransformationMetadata.Error_trying_to_read_virtual_document_{0},_with_body__n{1}_1",
groupName, mappingDoc)); //$NON-NLS-1$
+ } finally {
+ try {
+ inputStream.close();
+ } catch(Exception e) {}
+ }
+ return (MappingDocument)mappingDoc.clone();
+ }
+
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getVirtualDatabaseName()
+ */
+ public String getVirtualDatabaseName() throws MetaMatrixComponentException,
QueryMetadataException {
+ return this.getMetadataStore().getMetadataSource().getName();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getXMLTempGroups(java.lang.Object)
+ */
+ public Collection getXMLTempGroups(final Object groupID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+
+ if(tableRecord.getTableType() == TableRecordImpl.Type.Document) {
+ return this.store.getXMLTempGroups(tableRecord);
+ }
+ return Collections.EMPTY_SET;
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getCardinality(java.lang.Object)
+ */
+ public int getCardinality(final Object groupID) throws MetaMatrixComponentException,
QueryMetadataException {
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ return ((TableRecordImpl) groupID).getCardinality();
+ }
+
+ /* (non-Javadoc)
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getXMLSchemas(java.lang.Object)
+ */
+ public List getXMLSchemas(final Object groupID) throws MetaMatrixComponentException,
QueryMetadataException {
+
+ ArgCheck.isInstanceOf(TableRecordImpl.class, groupID);
+ TableRecordImpl tableRecord = (TableRecordImpl) groupID;
+
+ // lookup transformation record for the group
+ String groupName = tableRecord.getFullName();
+
+ // get the schema Paths
+ List<String> schemaPaths = tableRecord.getSchemaPaths();
+
+ List<String> schemas = new LinkedList<String>();
+ if (schemaPaths == null) {
+ return schemas;
+ }
+ File f = new File(tableRecord.getResourcePath());
+ String path = f.getParent();
+
+ for (String string : schemaPaths) {
+ String schema = getCharacterVDBResource(string);
+
+ if (schema == null) {
+ schema = getCharacterVDBResource(path + File.separator + string);
+ }
+
+ if (schema == null) {
+ throw new
MetaMatrixComponentException(DQPPlugin.Util.getString("TransformationMetadata.Error_trying_to_read_schemas_for_the_document/table____1")+groupName);
//$NON-NLS-1$
+ }
+ }
+
+ return schemas;
+ }
+
+ public String getNameInSource(final Object metadataID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(AbstractMetadataRecord.class, metadataID);
+ return ((AbstractMetadataRecord) metadataID).getNameInSource();
+ }
+
+ public int getElementLength(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getLength();
+ } else if(elementID instanceof ProcedureParameterRecordImpl){
+ return ((ProcedureParameterRecordImpl) elementID).getLength();
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ public int getPosition(final Object elementID) throws MetaMatrixComponentException,
QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getPosition();
+ } else if(elementID instanceof ProcedureParameterRecordImpl) {
+ return ((ProcedureParameterRecordImpl) elementID).getPosition();
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ public int getPrecision(final Object elementID) throws MetaMatrixComponentException,
QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getPrecision();
+ } else if(elementID instanceof ProcedureParameterRecordImpl) {
+ return ((ProcedureParameterRecordImpl) elementID).getPrecision();
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ public int getRadix(final Object elementID) throws MetaMatrixComponentException,
QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getRadix();
+ } else if(elementID instanceof ProcedureParameterRecordImpl) {
+ return ((ProcedureParameterRecordImpl) elementID).getRadix();
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ public String getFormat(Object elementID) throws MetaMatrixComponentException,
QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getFormat();
+ }
+ throw createInvalidRecordTypeException(elementID);
+ }
+
+ public int getScale(final Object elementID) throws MetaMatrixComponentException,
QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getScale();
+ } else if(elementID instanceof ProcedureParameterRecordImpl) {
+ return ((ProcedureParameterRecordImpl) elementID).getScale();
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ public int getDistinctValues(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getDistinctValues();
+ } else if(elementID instanceof ProcedureParameterRecordImpl) {
+ return -1;
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ public int getNullValues(final Object elementID) throws MetaMatrixComponentException,
QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getNullValues();
+ } else if(elementID instanceof ProcedureParameterRecordImpl) {
+ return -1;
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ public String getNativeType(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ if(elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl) elementID).getNativeType();
+ } else if(elementID instanceof ProcedureParameterRecordImpl) {
+ return null;
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ /*
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getExtensionProperties(java.lang.Object)
+ */
+ public Properties getExtensionProperties(final Object metadataID) throws
MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(AbstractMetadataRecord.class, metadataID);
+ AbstractMetadataRecord metadataRecord = (AbstractMetadataRecord) metadataID;
+ Map<String, String> result = metadataRecord.getProperties();
+ if (result == null) {
+ return EMPTY_PROPS;
+ }
+ Properties p = new Properties();
+ p.putAll(result);
+ return p;
+ }
+
+ /**
+ * @see
com.metamatrix.query.metadata.BasicQueryMetadata#getBinaryVDBResource(java.lang.String)
+ * @since 4.3
+ */
+ public byte[] getBinaryVDBResource(String resourcePath) throws
MetaMatrixComponentException,
+ QueryMetadataException {
+ String content = this.getCharacterVDBResource(resourcePath);
+ if(content != null) {
+ return content.getBytes();
+ }
+ return null;
+ }
+
+ /**
+ * @see
com.metamatrix.query.metadata.BasicQueryMetadata#getCharacterVDBResource(java.lang.String)
+ * @since 4.3
+ */
+ public String getCharacterVDBResource(String resourcePath) throws
MetaMatrixComponentException,
+ QueryMetadataException {
+ return MetadataSourceUtil.getFileContentAsString(resourcePath,
this.getMetadataStore().getMetadataSource());
+ }
+
+ public CompositeMetadataStore getMetadataStore() {
+ return this.store;
+ }
+
+ /**
+ * @see com.metamatrix.query.metadata.BasicQueryMetadata#getVDBResourcePaths()
+ * @since 4.3
+ */
+ public String[] getVDBResourcePaths() throws MetaMatrixComponentException,
+ QueryMetadataException {
+ return getMetadataStore().getMetadataSource().getEntries().toArray(new
String[0]);
+ }
+
+ /**
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getModeledType(java.lang.Object)
+ * @since 5.0
+ */
+ public String getModeledType(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ DatatypeRecordImpl record = getDatatypeRecord(elementID);
+ if (record != null) {
+ return record.getDatatypeID();
+ }
+ return null;
+ }
+
+ /**
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getModeledBaseType(java.lang.Object)
+ * @since 5.0
+ */
+ public String getModeledBaseType(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ DatatypeRecordImpl record = getDatatypeRecord(elementID);
+ if (record != null) {
+ return record.getBasetypeID();
+ }
+ return null;
+ }
+
+ /**
+ * @see
com.metamatrix.query.metadata.QueryMetadataInterface#getModeledPrimitiveType(java.lang.Object)
+ * @since 5.0
+ */
+ public String getModeledPrimitiveType(final Object elementID) throws
MetaMatrixComponentException, QueryMetadataException {
+ DatatypeRecordImpl record = getDatatypeRecord(elementID);
+ if (record != null) {
+ return record.getPrimitiveTypeID();
+ }
+ return null;
+ }
+
+ private DatatypeRecordImpl getDatatypeRecord(final Object elementID) {
+ if (elementID instanceof ColumnRecordImpl) {
+ return ((ColumnRecordImpl)elementID).getDatatype();
+ } else if (elementID instanceof ProcedureParameterRecordImpl) {
+ return ((ProcedureParameterRecordImpl)elementID).getDatatype();
+ } else {
+ throw createInvalidRecordTypeException(elementID);
+ }
+ }
+
+ @Override
+ public Object addToMetadataCache(Object metadataID, String key, Object value)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(AbstractMetadataRecord.class, metadataID);
+ key = getCacheKey(key, (AbstractMetadataRecord)metadataID);
+ return this.metadataCache.put(key, value);
+ }
+
+ @Override
+ public Object getFromMetadataCache(Object metadataID, String key)
+ throws MetaMatrixComponentException, QueryMetadataException {
+ ArgCheck.isInstanceOf(AbstractMetadataRecord.class, metadataID);
+ key = getCacheKey(key, (AbstractMetadataRecord)metadataID);
+ return this.metadataCache.get(key);
+ }
+
+ private String getCacheKey(String key, AbstractMetadataRecord record) {
+ return record.getUUID() + "/" + record.getFullName() + "/" + key;
//$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+}
\ No newline at end of file
Property changes on:
trunk/engine/src/main/java/org/teiid/metadata/TransformationMetadata.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties 2009-10-24 18:05:58
UTC (rev 1535)
+++ trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties 2009-10-24 18:07:35
UTC (rev 1536)
@@ -470,4 +470,36 @@
ConnectorEnvironmentImpl.vdb_scope_error=VDB information is not available; VDB scoped
cache can not be accessed.
BufferManagerLobChunkStream.no_tuple_source=Lob chunk is not found in the Buffer Manager
with tuple id {0}
-BufferManagerLobChunkStream.error_processing=Error occurred during the fetching of the
lob chunk from buffer manager with tuple id {0}
\ No newline at end of file
+BufferManagerLobChunkStream.error_processing=Error occurred during the fetching of the
lob chunk from buffer manager with tuple id {0}
+
+TransformationMetadata.does_not_exist._1=does not exist.
+TransformationMetadata.0={0} ambiguous, more than one entity matching the same name
+TransformationMetadata.Group(0}_does_not_have_elements=Group ''{0}'' does
not have any elements.
+TransformationMetadata.Error_trying_to_read_virtual_document_{0},_with_body__n{1}_1=Error
trying to read virtual document {0}, with body \n{1}
+TransformationMetadata.Unknown_support_constant___12=Unknown support constant:
+TransformationMetadata.error_intialize_selector=Error trying to initialize the index
selector.
+TransformationMetadata.Error_trying_to_obtain_index_file_using_IndexSelector_1=Error
trying to obtain index file using IndexSelector {0}
+TransformationMetadata.Model_name_ambiguous,more_than_one_model_exist_with_the_name__2=Model
name ambiguous, more than one model exists with the name
+TransformationMetadata.The_metadataID_passed_does_not_match_a_index_record._1=The
metadataID passed does not match an index record
+TransformationMetadata.Expected_id_of_the_type_key_record_as_the_argument_2=Expected ID
of the type key record as the argument
+TransformationMetadata.Expected_id_of_the_type_accesspattern_record_as_the_argument_3=Expected
ID of the type accesspattern record as the argument
+TransformationMetadata.No_known_index_file_type_associated_with_the_recordType_1=No known
index file type associated with the recordType
+TransformationMetadata.GroupID_ambiguous_there_are_multiple_virtual_plans_available_for_this_groupID__1=GroupID
ambiguous, there are multiple virtual plans available for this groupID
+TransformationMetadata.GroupID_ambiguous_there_are_multiple_insert_plans_available_for_this_groupID__2=GroupID
ambiguous, there are multiple insert plans available for this groupID
+TransformationMetadata.GroupID_ambiguous_there_are_multiple_update_plans_available_for_this_groupID__3=GroupID
ambiguous, there are multiple update plans available for this groupID
+TransformationMetadata.GroupID_ambiguous_there_are_multiple_delete_plans_available_for_this_groupID__4=GroupID
ambiguous, there are multiple delete plans available for this groupID
+TransformationMetadata.Failed_to_create_index_files_for_non-indexed_model_resources__1=Failed
to create index files for non-indexed model resources :
+TransformationMetadata.Procedure_ambiguous_there_are_multiple_procedure_plans_available_for_this_name___4=Procedure
ambiguous, there are multiple procedure plans available for this name:
+TransformationMetadata.Could_not_find_query_plan_for_the_group__5=Could not find query
plan for the group
+TransformationMetadata.QueryPlan_could_not_be_found_for_physical_group__6=QueryPlan could
not be found for physical group
+TransformationMetadata.InsertPlan_could_not_be_found_for_physical_group__8=InsertPlan
could not be found for physical group
+TransformationMetadata.InsertPlan_could_not_be_found_for_physical_group__10=InsertPlan
could not be found for physical group
+TransformationMetadata.DeletePlan_could_not_be_found_for_physical_group__12=DeletePlan
could not be found for physical group
+TransformationMetadata.Could_not_find_transformation_record_for_the_group__1=Could not
find transformation record for the group
+TransformationMetadata.Error_trying_to_read_schemas_for_the_document/table____1=Error
trying to read schemas for the document/table :
+TransformationMetadata.Multiple_transformation_records_found_for_the_group___1=Multiple
transformation records found for the group:
+TransformationMetadata.Multiple_annotation_records_found_for_the_entity_{0}_1=Multiple
annotation records found for the entity {0}
+TransformationMetadata.No_metadata_info_available_for_the_index_with_UUID_{0}._1=No
metadata info available for the index with UUID {0}.
+TransformationMetadata.Ambigous_index_with_UUID_{0},_found_multiple_indexes_with_the_given_UUID._2=Ambigous
index with UUID {0}, found multiple indexes with the given UUID.
+TransformationMetadata.Invalid_type=Invalid type: {0}.
+TransformationMetadata.Unable_to_determine_fullname_for_element__1=Unable to determine
fullname for element
\ No newline at end of file
Modified: trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java
===================================================================
---
trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java 2009-10-24
18:05:58 UTC (rev 1535)
+++
trunk/engine/src/test/java/com/metamatrix/dqp/service/AutoGenDataService.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -30,7 +30,7 @@
import java.util.List;
import java.util.Properties;
-import org.teiid.connector.metadata.runtime.ConnectorMetadata;
+import org.teiid.connector.metadata.runtime.MetadataStore;
import org.teiid.dqp.internal.datamgr.impl.ConnectorWorkItem;
import org.teiid.dqp.internal.process.DQPWorkContext;
@@ -249,7 +249,7 @@
}
@Override
- public ConnectorMetadata getConnectorMetadata(String vdbName,
+ public MetadataStore getConnectorMetadata(String vdbName,
String vdbVersion, String modelName, Properties importProperties) {
throw new UnsupportedOperationException();
}
Modified: trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeMetadataService.java
===================================================================
---
trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeMetadataService.java 2009-10-24
18:05:58 UTC (rev 1535)
+++
trunk/engine/src/test/java/com/metamatrix/dqp/service/FakeMetadataService.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -26,9 +26,9 @@
import java.util.Map;
import org.teiid.connector.metadata.runtime.DatatypeRecordImpl;
+import org.teiid.metadata.CompositeMetadataStore;
import com.metamatrix.api.exception.MetaMatrixComponentException;
-import com.metamatrix.connector.metadata.internal.IObjectSource;
import com.metamatrix.query.metadata.QueryMetadataInterface;
import com.metamatrix.query.unittest.FakeMetadataFactory;
@@ -76,7 +76,7 @@
}
@Override
- public IObjectSource getMetadataObjectSource(String vdbName,
+ public CompositeMetadataStore getMetadataObjectSource(String vdbName,
String vdbVersion) throws MetaMatrixComponentException {
return null;
}
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2009-10-24
18:05:58 UTC (rev 1535)
+++
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2009-10-24
18:07:35 UTC (rev 1536)
@@ -29,10 +29,10 @@
import java.util.Map;
import java.util.Properties;
+import org.teiid.connector.metadata.runtime.MetadataStore;
+
import junit.framework.TestCase;
-import org.teiid.connector.metadata.runtime.ConnectorMetadata;
-
import com.metamatrix.api.exception.ComponentNotFoundException;
import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.api.exception.MetaMatrixException;
@@ -53,6 +53,7 @@
import com.metamatrix.dqp.service.ConnectorStatus;
import com.metamatrix.dqp.service.DataService;
import com.metamatrix.dqp.service.FakeBufferService;
+import com.metamatrix.dqp.service.FakeMetadataService;
import com.metamatrix.dqp.service.FakeVDBService;
import com.metamatrix.platform.security.api.MetaMatrixSessionID;
import com.metamatrix.platform.security.api.SessionToken;
@@ -111,6 +112,7 @@
dataService,
vdbService,
bs,
+ new FakeMetadataService(),
20,
1000,
1000);
@@ -394,10 +396,11 @@
throw new MetaMatrixComponentException("Force fail on executeRequest
for call # " + calls); //$NON-NLS-1$
}
}
- @Override
- public ConnectorMetadata getConnectorMetadata(String vdbName,
- String vdbVersion, String modelName, Properties importProperties) {
- throw new UnsupportedOperationException();
- }
+ @Override
+ public MetadataStore getConnectorMetadata(String vdbName,
+ String vdbVersion, String modelName, Properties importProperties)
+ throws MetaMatrixComponentException {
+ throw new UnsupportedOperationException();
+ }
}
}