[teiid-commits] teiid SVN: r1929 - in trunk: build/kit-jboss-container/deployers/teiid.deployer and 10 other directories.
teiid-commits at lists.jboss.org
teiid-commits at lists.jboss.org
Fri Mar 5 14:56:04 EST 2010
Author: rareddy
Date: 2010-03-05 14:56:03 -0500 (Fri, 05 Mar 2010)
New Revision: 1929
Modified:
trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml
trunk/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java
trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
trunk/common-core/src/main/java/com/metamatrix/core/CoreConstants.java
trunk/common-core/src/main/java/com/metamatrix/core/vdb/VdbConstants.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/ObjectSerializer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
trunk/runtime/src/main/java/org/teiid/deployers/VDBStructure.java
trunk/runtime/src/main/java/org/teiid/services/AuthorizationServiceImpl.java
trunk/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java
trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
trunk/runtime/src/main/java/org/teiid/transport/SocketConfiguration.java
trunk/runtime/src/test/java/com/metamatrix/dqp/service/buffer/TestLocalBufferService.java
Log:
TEIID-998: Renaming the configurationInfo.def into vdb.xml and moving it find it in the META-INF folder. Fixed the clean up of the matadata cache files. Added the DQP Configuration as managable objects.
Modified: trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml
===================================================================
--- trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/build/kit-jboss-container/deploy/teiid/teiid-jboss-beans.xml 2010-03-05 19:56:03 UTC (rev 1929)
@@ -20,23 +20,29 @@
<!-- Teiid Services -->
<bean name="AuthorizationService" class="org.teiid.services.AuthorizationServiceImpl">
<property name="VDBRepository"><inject bean="VDBRepository"/></property>
+ <!-- Turn on checking the entitlements on resources based on the roles defined in VDB -->
<property name="useEntitlements" class="java.lang.Boolean">false</property>
</bean>
<bean name="SessionService" class="org.teiid.services.SessionServiceImpl">
<property name="VDBRepository"><inject bean="VDBRepository"/></property>
<property name="securityHelper"><inject bean="SecurityHelper"/></property>
- <!-- Comma separated list of domains to be used -->
+ <!-- Comma separated list of domains to be used to login into Teiid using JDBC connection-->
<property name="securityDomains">teiid-security</property>
+ <!-- security domain to be used with Admin API (please do not change this, as this should be same as profile service) -->
<property name="adminSecurityDomain">jmx-console</property>
+ <!-- Maximum number of sessions allowed by the system (default 5000) -->
<property name="sessionMaxLimit">5000</property>
+ <!-- Max allowed time before the session is terminated by the system, 0 indicates unlimited (default 0) -->
<property name="sessionExpirationTimeLimit">0</property>
</bean>
<bean name="BufferService" class="org.teiid.services.BufferServiceImpl">
<property name="contextCache"><inject bean="ContextCache"/></property>
<property name="cacheFactory"><inject bean="TeiidCache"/></property>
+ <!-- Use disk for buffer management -->
<property name="useDisk">true</property>
+ <!-- Directory location for the buffer files -->
<property name="diskDirectory">${jboss.server.temp.dir}/teiid</property>
<!-- The max row count of a batch sent internally within the query processor. Should be <= the connectorBatchSize. (default 512) -->
<property name="processorBatchSize">512</property>
@@ -54,8 +60,9 @@
grouping, etc. (default 124)
-->
<property name="maxProcessingBatchesColumns">128</property>
- <!-- Max File size in MB -->
+ <!-- Max File size in MB (default 2GB)-->
<property name="maxFileSize">2024</property>
+ <!-- Max open buffer files (default 128) -->
<property name="maxOpenFiles">256</property>
</bean>
@@ -95,12 +102,12 @@
<property name="resultSetCacheEnabled">true</property>
</bean>
-
+ <!-- JDBC Socket connection properties (SSL see below) -->
<bean name="JdbcSocketConfiguration" class="org.teiid.transport.SocketConfiguration">
<property name="enabled">true</property>
<property name="bindAddress">localhost</property>
<property name="portNumber">31000</property>
- <!-- Max number of threads dedicated to Admin and initial request processing (default 15) -->
+ <!-- Max number of threads dedicated to initial request processing (default 15) -->
<property name="maxSocketThreads">15</property>
<!-- SO_RCVBUF size, 0 indicates that system default should be used (default 0) -->
<property name="inputBufferSize">0</property>
@@ -123,11 +130,12 @@
<property name="clientEncryptionEnabled">true</property>
</bean>
+ <!-- Admin Socket connection settings (SSL see below) -->
<bean name="AdminSocketConfiguration" class="org.teiid.transport.SocketConfiguration">
<property name="enabled">true</property>
<property name="bindAddress">localhost</property>
<property name="portNumber">31443</property>
- <!-- Max number of threads dedicated to Admin and initial request processing (default 15) -->
+ <!-- Max number of threads dedicated to Admin and initial request processing (default 4) -->
<property name="maxSocketThreads">4</property>
<!-- SO_RCVBUF size, 0 indicates that system default should be used (default 0) -->
<property name="inputBufferSize">0</property>
Modified: trunk/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml
===================================================================
--- trunk/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/build/kit-jboss-container/deployers/teiid.deployer/teiid-deployer-jboss-beans.xml 2010-03-05 19:56:03 UTC (rev 1929)
@@ -14,9 +14,6 @@
<bean name="DynamicVDBDeployer" class="org.teiid.deployers.DynamicVDBDeployer">
- <property name="objectSerializer"><inject bean="ObjectSerializer"/></property>
- <property name="VDBRepository"><inject bean="VDBRepository"/></property>
- <property name="connectorManagerRepository"><inject bean="ConnectorManagerRepository"/></property>
</bean>
@@ -42,6 +39,7 @@
<property name="VDBRepository"><inject bean="VDBRepository"/></property>
<property name="contextCache"><inject bean="ContextCache"/></property>
<property name="objectSerializer"><inject bean="ObjectSerializer"/></property>
+ <property name="connectorManagerRepository"><inject bean="ConnectorManagerRepository"/></property>
<depends>SystemVDBDeployer</depends>
</bean>
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -80,7 +80,11 @@
@Override
public String getPropertyValue(String name) {
- return this.properties.getMap().get(name).getValue();
+ PropertyMetadata prop = this.properties.getMap().get(name);
+ if (prop == null) {
+ return null;
+ }
+ return prop.getValue();
}
public void addProperty(String key, String value) {
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/ModelMetaData.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -46,7 +46,7 @@
@XmlAccessorType(XmlAccessType.NONE)
@XmlType(name = "", propOrder = {
"JAXBProperties",
- "JAXBSources",
+ "sources",
"errors"
})
@ManagementObject(properties=ManagementProperties.EXPLICIT)
@@ -55,7 +55,8 @@
private static final String SUPPORTS_MULTI_SOURCE_BINDINGS_KEY = "supports-multi-source-bindings"; //$NON-NLS-1$
private static final long serialVersionUID = 3714234763056162230L;
- private ListOverMap<SourceMapping> sources = new ListOverMap(new KeyBuilder<SourceMapping>() {
+ @XmlElement(name = "source")
+ protected ListOverMap<SourceMapping> sources = new ListOverMap(new KeyBuilder<SourceMapping>() {
@Override
public String getKey(SourceMapping entry) {
return entry.getName();
@@ -66,7 +67,7 @@
protected String modelType = Type.PHYSICAL.name(); //$NON-NLS-1$
@XmlAttribute(name = "visible")
- private Boolean visible = true;
+ protected Boolean visible = true;
@XmlElement(name = "validation-error")
protected List<ValidationError> errors;
@@ -144,12 +145,6 @@
return new ArrayList<SourceMapping>(this.sources.getMap().values());
}
- @XmlElement(name = "source")
- protected List<SourceMapping> getJAXBSources(){
- // do not wrap this in another List object; we need direct access for jaxb
- return this.sources;
- }
-
@Override
public List<String> getSourceNames() {
return new ArrayList<String>(this.sources.getMap().keySet());
@@ -157,6 +152,9 @@
public String getSourceJndiName(String sourceName) {
SourceMapping s = this.sources.getMap().get(sourceName);
+ if (s == null) {
+ return null;
+ }
return s.getJndiName();
}
Modified: trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java
===================================================================
--- trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/client/src/main/java/org/teiid/adminapi/impl/VDBMetaData.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -45,12 +45,13 @@
import com.metamatrix.core.CoreConstants;
+
@ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="vdb"))
@XmlAccessorType(XmlAccessType.NONE)
@XmlType(name = "", propOrder = {
"description",
"JAXBProperties",
- "JAXBModels",
+ "models",
"securityRoleMappings"
})
@XmlRootElement(name = "vdb")
@@ -59,7 +60,12 @@
private static final long serialVersionUID = -4723595252013356436L;
- private ListOverMap<ModelMetaData> models = new ListOverMap<ModelMetaData>(new KeyBuilder<ModelMetaData>() {
+ /**
+ * This simulating a list over a map. JAXB requires a list and performance recommends
+ * map and we would like to keep one variable to represent both.
+ */
+ @XmlElement(name = "model", required = true, type = ModelMetaData.class)
+ protected ListOverMap<ModelMetaData> models = new ListOverMap<ModelMetaData>(new KeyBuilder<ModelMetaData>() {
@Override
public String getKey(ModelMetaData entry) {
return entry.getName();
@@ -70,7 +76,7 @@
private int version = 1;
@XmlElement(name = "description")
- private String description;
+ protected String description;
@XmlElement(name = "role-mapping")
protected ListOverMap<ReferenceMappingMetadata> securityRoleMappings = new ListOverMap<ReferenceMappingMetadata>(new KeyBuilder<ReferenceMappingMetadata>() {
@@ -81,6 +87,7 @@
});
private String fileUrl = null;
+ private boolean dynamic = false;
public VDBMetaData() {
// auto add sytem model.
@@ -145,16 +152,6 @@
return new ArrayList<ModelMetaData>(this.models.getMap().values());
}
- /**
- * This simulating a list over a map. JAXB requires a list and performance recommends
- * map and we would like to keep one variable to represent both.
- * @return
- */
- @XmlElement(name = "model", required = true, type = ModelMetaData.class)
- protected List<ModelMetaData> getJAXBModels(){
- return models;
- }
-
public void addModel(ModelMetaData m) {
this.models.getMap().put(m.getName(), m);
}
@@ -202,6 +199,11 @@
if (resourceNames.isEmpty()) {
return false;
}
+ for (String sourceName:resourceNames) {
+ if (m.getSourceJndiName(sourceName) == null) {
+ return false;
+ }
+ }
}
}
return true;
@@ -248,4 +250,13 @@
protected List<PropertyMetadata> getJAXBProperties(){
return super.getJAXBProperties();
}
+
+ @ManagementProperty(description="Is this a Dynamic VDB")
+ public boolean isDynamic() {
+ return dynamic;
+ }
+
+ public void setDynamic(boolean dynamic) {
+ this.dynamic = dynamic;
+ }
}
Modified: trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java
===================================================================
--- trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/client/src/test/java/org/teiid/adminapi/impl/TestVDBMetaData.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -83,6 +83,7 @@
// UnMarshell
Unmarshaller un = jc.createUnmarshaller();
+ un.setSchema(schema);
vdb = (VDBMetaData)un.unmarshal(new StringReader(sw.toString()));
assertEquals("myVDB", vdb.getName());
Modified: trunk/common-core/src/main/java/com/metamatrix/core/CoreConstants.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/core/CoreConstants.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/common-core/src/main/java/com/metamatrix/core/CoreConstants.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -22,7 +22,6 @@
package com.metamatrix.core;
-import com.metamatrix.core.vdb.VdbConstants;
/**
* @since 4.0
@@ -55,10 +54,6 @@
public static final String SYSTEM_VDB = "System.vdb"; //$NON-NLS-1$
- public static final String EXPORTED_VDB_FILE_EXTENSION = VdbConstants.VDB_DEF_FILE_EXTENSION;
-
- public static final String VDB_ARCHIVE_EXTENSION = VdbConstants.VDB_ARCHIVE_EXTENSION;
-
public static final String PRODUCT_OWNER_NAME_PROPERTY = "ownerName"; //$NON-NLS-1$
/**
Modified: trunk/common-core/src/main/java/com/metamatrix/core/vdb/VdbConstants.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/core/vdb/VdbConstants.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/common-core/src/main/java/com/metamatrix/core/vdb/VdbConstants.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -29,20 +29,10 @@
*/
public interface VdbConstants {
- public static final String DEF_FILE_NAME = "ConfigurationInfo.def"; // !!! DO NOT CHANGE VALUE as this would cause problems with existing VDBs having DEF files !!! //$NON-NLS-1$
- public static final String DATA_ROLES_FILE = "dataroles.xml"; //$NON-NLS-1$
- public static final String VDB_DEF_FILE_EXTENSION = ".def"; //$NON-NLS-1$
+ public static final String DEPLOYMENT_FILE = "vdb.xml"; // !!! DO NOT CHANGE VALUE as this would cause problems with existing VDBs having DEF files !!! //$NON-NLS-1$
public static final String VDB_ARCHIVE_EXTENSION = ".vdb"; //$NON-NLS-1$
- public static final String MATERIALIZATION_MODEL_NAME = "MaterializationModel"; //$NON-NLS-1$
- public static final String MATERIALIZATION_MODEL_FILE_SUFFIX = ".xmi"; //$NON-NLS-1$
- public static final String MANIFEST_MODEL_NAME = "MetaMatrix-VdbManifestModel.xmi"; //$NON-NLS-1$
- public static final String WSDL_FILENAME = "MetaMatrixDataServices.wsdl"; //$NON-NLS-1$
public final static String INDEX_EXT = ".INDEX"; //$NON-NLS-1$
public final static String SEARCH_INDEX_EXT = ".SEARCH_INDEX"; //$NON-NLS-1$
public final static String MODEL_EXT = ".xmi"; //$NON-NLS-1$
public final static String UDF_FILE_NAME = "FunctionDefinitions.xmi"; //$NON-NLS-1$
-
- public static final String VDB = ".vdb"; //$NON-NLS-1$
- public static final String DEF = ".def"; //$NON-NLS-1$
-
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPConfiguration.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -21,6 +21,8 @@
*/
package org.teiid.dqp.internal.process;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
import com.metamatrix.dqp.message.RequestMessage;
public class DQPConfiguration{
@@ -46,11 +48,10 @@
private int codeTablesMaxCount = DEFAULT_MAX_CODE_TABLES;
private int codeTablesMaxRowsPerTable = DEFAULT_MAX_CODE_TABLE_RECORDS;
private int codeTablesMaxRows = DEFAULT_MAX_CODE_RECORDS;
- private String bindAddress = "localhost";
- private int portNumber = 31000;
- private boolean resultSetCacheEnabled = false;
+ private boolean resultSetCacheEnabled = true;
private int maxResultSetCacheEntries = DQPConfiguration.DEFAULT_MAX_RESULTSET_CACHE_ENTRIES;
+ @ManagementProperty (description="Name of the process that uniquely identifies this process")
public String getProcessName() {
return processName;
}
@@ -59,6 +60,7 @@
this.processName = processName;
}
+ @ManagementProperty(description="Process pool maximum thread count. (default 16) Increase this value if your load includes a large number of XQueries or if the system's available processors is larger than 8")
public int getMaxThreads() {
return maxThreads;
}
@@ -67,6 +69,7 @@
this.maxThreads = maxThreads;
}
+ @ManagementProperty(description="Query processor time slice, in milliseconds. (default 2000)")
public int getTimeSliceInMilli() {
return timeSliceInMilli;
}
@@ -75,6 +78,7 @@
this.timeSliceInMilli = timeSliceInMilli;
}
+ @ManagementProperty(description="Process debug allowed")
public boolean isProcessDebugAllowed() {
return processDebugAllowed;
}
@@ -83,6 +87,7 @@
this.processDebugAllowed = processDebugAllowed;
}
+ @ManagementProperty(description="Maximum allowed fetch size, set via JDBC. User requested value ignored above this value. (default 20480)")
public int getMaxRowsFetchSize() {
return maxRowsFetchSize;
}
@@ -91,30 +96,34 @@
this.maxRowsFetchSize = maxRowsFetchSize;
}
+ @ManagementProperty(description="The max lob chunk size in KB transferred each time when processing blobs, clobs(100KB default)")
public int getLobChunkSizeInKB() {
- return lobChunkSizeInKB;
+ return this.lobChunkSizeInKB;
}
public void setLobChunkSizeInKB(int lobChunkSizeInKB) {
this.lobChunkSizeInKB = lobChunkSizeInKB;
}
+ @ManagementProperty(description="The maximum number of query plans that are cached. Note: this is a memory based cache. (default 250)")
public int getPreparedPlanCacheMaxCount() {
- return preparedPlanCacheMaxCount;
+ return this.preparedPlanCacheMaxCount;
}
public void setPreparedPlanCacheMaxCount(int preparedPlanCacheMaxCount) {
this.preparedPlanCacheMaxCount = preparedPlanCacheMaxCount;
}
+ @ManagementProperty(description="Maximum number of cached lookup tables. Note: this is a memory based cache. (default 200)")
public int getCodeTablesMaxCount() {
- return codeTablesMaxCount;
+ return this.codeTablesMaxCount;
}
public void setCodeTablesMaxCount(int codeTablesMaxCount) {
this.codeTablesMaxCount = codeTablesMaxCount;
}
+ @ManagementProperty(description="Maximum number of records in a single lookup table (default 10000)")
public int getCodeTablesMaxRowsPerTable() {
return codeTablesMaxRowsPerTable;
}
@@ -123,30 +132,16 @@
this.codeTablesMaxRowsPerTable = codeTablesMaxRowsPerTable;
}
+ @ManagementProperty(description="Maximum number of records in all lookup tables (default 200000)")
public int getCodeTablesMaxRows() {
- return codeTablesMaxRows;
+ return this.codeTablesMaxRows;
}
public void setCodeTablesMaxRows(int codeTablesMaxRows) {
this.codeTablesMaxRows = codeTablesMaxRows;
}
- public String getBindAddress() {
- return bindAddress;
- }
-
- public void setBindAddress(String bindAddress) {
- this.bindAddress = bindAddress;
- }
-
- public int getPortNumber() {
- return portNumber;
- }
-
- public void setPortNumber(int portNumber) {
- this.portNumber = portNumber;
- }
-
+ @ManagementProperty(description="The maximum number of result set cache entries. 0 indicates no limit. (default 1024)")
public int getResultSetCacheMaxEntries() {
return this.maxResultSetCacheEntries;
}
@@ -155,6 +150,7 @@
this.maxResultSetCacheEntries = value;
}
+ @ManagementProperty(description="Denotes whether or not result set caching is enabled. (default true)")
public boolean isResultSetCacheEnabled() {
return this.resultSetCacheEnabled;
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/deployers/RuntimeEngineDeployer.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -86,6 +86,7 @@
@ManagementObject(isRuntime=true, componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
public class RuntimeEngineDeployer extends DQPConfiguration implements DQPManagement, Serializable , ClientServiceRegistry {
+ private static final long serialVersionUID = -4676205340262775388L;
protected Logger log = Logger.getLogger(getClass());
Modified: trunk/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/runtime/src/main/java/org/teiid/deployers/DynamicVDBDeployer.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -21,31 +21,14 @@
*/
package org.teiid.deployers;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-
-import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;
-import org.jboss.deployers.spi.DeploymentException;
import org.jboss.deployers.vfs.spi.deployer.AbstractVFSParsingDeployer;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.virtual.VirtualFile;
-import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
-import org.teiid.connector.api.ConnectorException;
-import org.teiid.connector.metadata.runtime.MetadataStore;
-import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
-import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
-import org.teiid.metadata.CompositeMetadataStore;
-import com.metamatrix.core.CoreConstants;
-
public class DynamicVDBDeployer extends AbstractVFSParsingDeployer<VDBMetaData> {
- private VDBRepository vdbRepository;
- private ConnectorManagerRepository connectorManagerRepository;
- private ObjectSerializer serializer;
public DynamicVDBDeployer() {
super(VDBMetaData.class);
@@ -54,87 +37,16 @@
@Override
protected VDBMetaData parse(VFSDeploymentUnit unit, VirtualFile file, VDBMetaData root) throws Exception {
- JAXBContext jc = JAXBContext.newInstance(new Class<?>[] {VDBMetaData.class});
- Unmarshaller un = jc.createUnmarshaller();
- VDBMetaData def = (VDBMetaData)un.unmarshal(file.openStream());
+ Unmarshaller un = VDBParserDeployer.getUnMarsheller();
+ VDBMetaData vdb = (VDBMetaData)un.unmarshal(file.openStream());
- def.setUrl(unit.getRoot().toURL().toExternalForm());
+ vdb.setUrl(unit.getRoot().toURL().toExternalForm());
+ vdb.setDynamic(true);
log.debug("VDB "+unit.getRoot().getName()+" has been parsed.");
+ // The loading of metadata from data sources will be done during the real deploy
+ // as the resources are guaranteed to be available by that time.
- ArrayList<MetadataStore> stores = new ArrayList<MetadataStore>();
- for (ModelMetaData model:def.getModels()) {
- if (model.getName().equals(CoreConstants.SYSTEM_MODEL)){
- continue;
- }
- stores.add(buildDynamicMetadataStore(unit, def, model));
- }
-
- CompositeMetadataStore store = new CompositeMetadataStore(stores);
- unit.addAttachment(CompositeMetadataStore.class, store);
-
- return def;
+ return vdb;
}
-
- private MetadataStore buildDynamicMetadataStore(VFSDeploymentUnit unit, VDBMetaData vdb, ModelMetaData model) throws DeploymentException{
- if (model.getSourceNames().isEmpty()) {
- throw new DeploymentException(vdb.getName()+"-"+vdb.getVersion()+" Can not be deployed because model {"+model.getName()+"} is not fully configured.");
- }
-
- boolean cache = "cached".equalsIgnoreCase(vdb.getPropertyValue("UseConnectorMetadata"));
- File cacheFile = null;
- if (cache) {
- try {
- cacheFile = buildCachedFileName(unit, vdb,model.getName());
- if (cacheFile.exists()) {
- return this.serializer.loadAttachment(cacheFile, MetadataStore.class);
- }
- } catch (IOException e) {
- log.warn("invalid metadata in file = "+cacheFile.getAbsolutePath());
- } catch (ClassNotFoundException e) {
- log.warn("invalid metadata in file = "+cacheFile.getAbsolutePath());
- }
- }
-
-
- Exception exception = null;
- for (String connectorName: model.getSourceNames()) {
- ConnectorManager cm = this.connectorManagerRepository.getConnectorManager(connectorName);
- if (cm == null) {
- continue;
- }
- try {
- MetadataStore store = cm.getMetadata(model.getName(), this.vdbRepository.getBuiltinDatatypes(), model.getProperties());
- if (cache) {
- this.serializer.saveAttachment(cacheFile, store);
- }
- return store;
- } catch (ConnectorException e) {
- if (exception != null) {
- exception = e;
- }
- } catch (IOException e) {
- if (exception != null) {
- exception = e;
- }
- }
- }
- throw new DeploymentException(vdb.getName()+"-"+vdb.getVersion()+" Can not be deployed because model {"+model.getName()+"} can not retrive metadata", exception);
- }
-
- public void setVDBRepository(VDBRepository repo) {
- this.vdbRepository = repo;
- }
-
- public void setConnectorManagerRepository(ConnectorManagerRepository repo) {
- this.connectorManagerRepository = repo;
- }
-
- public void setObjectSerializer(ObjectSerializer serializer) {
- this.serializer = serializer;
- }
-
- private File buildCachedFileName(VFSDeploymentUnit unit, VDBMetaData vdb, String modelName) throws IOException {
- return this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion()+"_"+modelName);
- }
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/ObjectSerializer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/ObjectSerializer.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/runtime/src/main/java/org/teiid/deployers/ObjectSerializer.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -27,7 +27,6 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.net.URISyntaxException;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.logging.Logger;
@@ -79,12 +78,12 @@
}
}
- public void removeAttachments(VFSDeploymentUnit vf) throws IOException {
+ public void removeAttachments(VFSDeploymentUnit vf) {
String dirName = baseDirectory(vf);
FileUtils.removeDirectoryAndChildren(new File(dirName));
}
- public File getAttachmentPath(VFSDeploymentUnit vf, String baseName) throws IOException {
+ public File getAttachmentPath(VFSDeploymentUnit vf, String baseName) {
String dirName = baseDirectory(vf);
@@ -96,9 +95,9 @@
return f;
}
- private String baseDirectory(VFSDeploymentUnit vf) throws IOException {
+ private String baseDirectory(VFSDeploymentUnit vf) {
String fileName = vf.getRoot().getName();
- String dirName = this.storagePath + File.separator + fileName + "-"+ vf.getRoot().getLastModified()+ File.separator;
+ String dirName = this.storagePath + File.separator + fileName + File.separator;
return dirName;
}
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBDeployer.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -23,6 +23,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -43,13 +44,17 @@
import org.teiid.adminapi.VDB;
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
+import org.teiid.connector.api.ConnectorException;
import org.teiid.connector.metadata.runtime.MetadataStore;
import org.teiid.dqp.internal.cache.DQPContextCache;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManager;
+import org.teiid.dqp.internal.datamgr.impl.ConnectorManagerRepository;
import org.teiid.metadata.CompositeMetadataStore;
import org.teiid.metadata.TransformationMetadata;
import org.teiid.metadata.index.IndexMetadataFactory;
import com.metamatrix.core.CoreConstants;
+import com.metamatrix.core.util.FileUtils;
import com.metamatrix.query.function.metadata.FunctionMethod;
import com.metamatrix.query.metadata.QueryMetadataInterface;
@@ -57,6 +62,7 @@
protected Logger log = Logger.getLogger(getClass());
private ManagedObjectFactory mof;
private VDBRepository vdbRepository;
+ private ConnectorManagerRepository connectorManagerRepository;
private DQPContextCache contextCache;
private ObjectSerializer serializer;
@@ -84,8 +90,20 @@
// get the metadata store of the VDB (this is build in parse stage)
CompositeMetadataStore store = unit.getAttachment(CompositeMetadataStore.class);
- this.vdbRepository.addMetadataStore(deployment, store);
+ // if store is null and vdb dynamic vdb then try to get the metadata
+ if (store == null && deployment.isDynamic()) {
+ ArrayList<MetadataStore> stores = new ArrayList<MetadataStore>();
+ for (ModelMetaData model:deployment.getModels()) {
+ if (model.getName().equals(CoreConstants.SYSTEM_MODEL)){
+ continue;
+ }
+ stores.add(buildDynamicMetadataStore((VFSDeploymentUnit)unit, deployment, model));
+ }
+ store = new CompositeMetadataStore(stores);
+ unit.addAttachment(CompositeMetadataStore.class, store);
+ }
+
// check if this is a VDB with index files, if there are then build the TransformationMetadata
IndexMetadataFactory indexFactory = unit.getAttachment(IndexMetadataFactory.class);
UDFMetaData udf = unit.getAttachment(UDFMetaData.class);
@@ -106,7 +124,24 @@
// add transformation metadata to the repository.
this.vdbRepository.addMetadata(deployment, metadata);
+ this.vdbRepository.addMetadataStore(deployment, store);
+
+ try {
+ saveMetadataStore((VFSDeploymentUnit)unit, deployment, metadata.getMetadataStore());
+ } catch (IOException e1) {
+ log.warn("failed to save metadata for VDB "+deployment.getName()+"."+deployment.getVersion(), e1);
+ }
+ boolean valid = validateSources(deployment);
+
+ // Check if the VDB is fully configured.
+ if (valid) {
+ deployment.setStatus(VDB.Status.ACTIVE);
+ }
+ log.info("VDB = "+deployment + " deployed");
+ }
+
+ private boolean validateSources(VDBMetaData deployment) {
boolean valid = true;
for(ModelMetaData model:deployment.getModels()) {
for (String sourceName:model.getSourceNames()) {
@@ -122,12 +157,7 @@
}
}
}
-
- // Check if the VDB is fully configured.
- if (valid) {
- deployment.setStatus(VDB.Status.ACTIVE);
- }
- log.info("VDB = "+deployment + " deployed");
+ return valid;
}
@@ -196,12 +226,7 @@
}
try {
- if (((VFSDeploymentUnit)unit).getRoot().exists()) {
- File cacheFileName = this.serializer.getAttachmentPath((VFSDeploymentUnit)unit, deployment.getName()+"_"+deployment.getVersion());
- if (cacheFileName.exists()) {
- cacheFileName.delete();
- }
- }
+ deleteMetadataStore((VFSDeploymentUnit)unit, deployment);
} catch (IOException e) {
log.warn("failed to delete the cached metadata files due to:" + e.getMessage());
}
@@ -217,4 +242,73 @@
this.serializer = serializer;
}
+ public void setConnectorManagerRepository(ConnectorManagerRepository repo) {
+ this.connectorManagerRepository = repo;
+ }
+
+ private void saveMetadataStore(VFSDeploymentUnit unit, VDBMetaData vdb, CompositeMetadataStore store) throws IOException {
+ File cacheFileName = this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion());
+ if (!cacheFileName.exists()) {
+ this.serializer.saveAttachment(cacheFileName,store);
+ }
+ }
+
+ private void deleteMetadataStore(VFSDeploymentUnit unit, VDBMetaData vdb) throws IOException {
+ if (!unit.getRoot().exists()) {
+ File cacheFileName = this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion());
+ if (cacheFileName.exists()) {
+ FileUtils.removeDirectoryAndChildren(cacheFileName.getParentFile());
+ }
+ }
+ }
+
+ private MetadataStore buildDynamicMetadataStore(VFSDeploymentUnit unit, VDBMetaData vdb, ModelMetaData model) throws DeploymentException{
+ if (model.getSourceNames().isEmpty()) {
+ throw new DeploymentException(vdb.getName()+"-"+vdb.getVersion()+" Can not be deployed because model {"+model.getName()+"} is not fully configured.");
+ }
+
+ boolean cache = "cached".equalsIgnoreCase(vdb.getPropertyValue("UseConnectorMetadata"));
+ File cacheFile = null;
+ if (cache) {
+ try {
+ cacheFile = buildCachedFileName(unit, vdb,model.getName());
+ if (cacheFile.exists()) {
+ return this.serializer.loadAttachment(cacheFile, MetadataStore.class);
+ }
+ } catch (IOException e) {
+ log.warn("invalid metadata in file = "+cacheFile.getAbsolutePath());
+ } catch (ClassNotFoundException e) {
+ log.warn("invalid metadata in file = "+cacheFile.getAbsolutePath());
+ }
+ }
+
+
+ Exception exception = null;
+ for (String sourceName: model.getSourceNames()) {
+ ConnectorManager cm = this.connectorManagerRepository.getConnectorManager(model.getSourceJndiName(sourceName));
+ if (cm == null) {
+ continue;
+ }
+ try {
+ MetadataStore store = cm.getMetadata(model.getName(), this.vdbRepository.getBuiltinDatatypes(), model.getProperties());
+ if (cache) {
+ this.serializer.saveAttachment(cacheFile, store);
+ }
+ return store;
+ } catch (ConnectorException e) {
+ if (exception != null) {
+ exception = e;
+ }
+ } catch (IOException e) {
+ if (exception != null) {
+ exception = e;
+ }
+ }
+ }
+ throw new DeploymentException(vdb.getName()+"-"+vdb.getVersion()+" Can not be deployed because model {"+model.getName()+"} can not retrive metadata", exception);
+ }
+
+ private File buildCachedFileName(VFSDeploymentUnit unit, VDBMetaData vdb, String modelName) {
+ return this.serializer.getAttachmentPath(unit, vdb.getName()+"_"+vdb.getVersion()+"_"+modelName);
+ }
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBParserDeployer.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -27,8 +27,12 @@
import java.util.List;
import java.util.Map;
+import javax.xml.XMLConstants;
import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
import org.jboss.logging.Logger;
@@ -38,6 +42,7 @@
import org.teiid.metadata.CompositeMetadataStore;
import org.teiid.metadata.index.IndexConstants;
import org.teiid.metadata.index.IndexMetadataFactory;
+import org.xml.sax.SAXException;
import com.metamatrix.core.CoreConstants;
import com.metamatrix.core.util.StringUtil;
@@ -45,7 +50,7 @@
import com.metamatrix.query.function.metadata.FunctionMetadataReader;
/**
- * This file loads the ".def" file and "manifest" file inside a VDB file.
+ * This file loads the "vdb.xml" file inside a ".vdb" file, along with all the metadata in the .INDEX files
*/
public class VDBParserDeployer extends BaseMultipleVFSParsingDeployer<VDBMetaData> {
protected Logger log = Logger.getLogger(getClass());
@@ -58,7 +63,7 @@
private static Map<String, Class<?>> getCustomMappings() {
Map<String, Class<?>> mappings = new HashMap<String, Class<?>>();
- mappings.put(VdbConstants.DEF_FILE_NAME, VDBMetaData.class);
+ mappings.put(VdbConstants.DEPLOYMENT_FILE, VDBMetaData.class);
mappings.put(VdbConstants.UDF_FILE_NAME, UDFMetaData.class);
return mappings;
}
@@ -66,8 +71,7 @@
@Override
protected <U> U parse(VFSDeploymentUnit unit, Class<U> expectedType, VirtualFile file, Object root) throws Exception {
if (expectedType.equals(VDBMetaData.class)) {
- JAXBContext jc = JAXBContext.newInstance(new Class<?>[] {VDBMetaData.class});
- Unmarshaller un = jc.createUnmarshaller();
+ Unmarshaller un = getUnMarsheller();
VDBMetaData def = (VDBMetaData)un.unmarshal(file.openStream());
return expectedType.cast(def);
@@ -92,6 +96,15 @@
throw new IllegalArgumentException("Cannot match arguments: expectedClass=" + expectedType );
}
}
+
+ static Unmarshaller getUnMarsheller() throws JAXBException, SAXException {
+ JAXBContext jc = JAXBContext.newInstance(new Class<?>[] {VDBMetaData.class});
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ Schema schema = schemaFactory.newSchema(VDBMetaData.class.getResource("/vdb-deployer.xsd"));
+ Unmarshaller un = jc.createUnmarshaller();
+ un.setSchema(schema);
+ return un;
+ }
@Override
protected VDBMetaData mergeMetaData(VFSDeploymentUnit unit, Map<Class<?>, List<Object>> metadata) throws Exception {
@@ -129,7 +142,6 @@
}
else {
store = new CompositeMetadataStore(imf.getMetadataStore());
- this.serializer.saveAttachment(cacheFileName,store);
}
unit.addAttachment(CompositeMetadataStore.class, store);
}
@@ -170,20 +182,11 @@
return false;
}
- // manifest file should not be visible
- if(entry.equalsIgnoreCase(VdbConstants.MANIFEST_MODEL_NAME)) {
+ // deployment file should not be visible
+ if(entry.equalsIgnoreCase(VdbConstants.DEPLOYMENT_FILE)) {
return false;
}
- // materialization models should not be visible
- if(entry.startsWith(VdbConstants.MATERIALIZATION_MODEL_NAME) && entry.endsWith(VdbConstants.MODEL_EXT)) {
- return false;
- }
-
- // wldl file should be visible
- if(entry.equalsIgnoreCase(VdbConstants.WSDL_FILENAME)) {
- return false;
- }
// any other file should be visible
return true;
}
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBStructure.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBStructure.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBStructure.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -45,10 +45,16 @@
try {
if (isLeaf(file) == false) {
if (file.getName().endsWith(".vdb")) {
- if (file.getChild(VdbConstants.DEF_FILE_NAME) == null) {
+
+ VirtualFile metainf = file.getChild("META-INF");
+ if (metainf == null) {
return false;
}
- createContext(structureContext, new String[] {"/", "runtime-inf"});
+
+ if (metainf.getChild(VdbConstants.DEPLOYMENT_FILE) == null) {
+ return false;
+ }
+ createContext(structureContext, new String[] {"/", "META-INF", "runtime-inf"});
return true;
}
}
Modified: trunk/runtime/src/main/java/org/teiid/services/AuthorizationServiceImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/services/AuthorizationServiceImpl.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/runtime/src/main/java/org/teiid/services/AuthorizationServiceImpl.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -34,6 +34,10 @@
import java.util.List;
import java.util.Set;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
import org.teiid.adminapi.AdminRoles;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.deployers.VDBRepository;
@@ -75,6 +79,7 @@
* have the proper administrative role.
* </p>
*/
+ at ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
public class AuthorizationServiceImpl implements AuthorizationService, Serializable {
private static final long serialVersionUID = 5399603007837606243L;
@@ -396,10 +401,12 @@
* @return <code>true</code> iff server-side entitlements checking is enabled.
*/
@Override
+ @ManagementProperty(description="Turn on checking the entitlements on resources based on the roles defined in VDB", readOnly=true)
public boolean checkingEntitlements() {
return useEntitlements;
}
+
/**
* Create realm based on token
* @param token Used to find info about this session
Modified: trunk/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/runtime/src/main/java/org/teiid/services/BufferServiceImpl.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -26,6 +26,10 @@
import java.io.IOException;
import java.io.Serializable;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
import org.teiid.dqp.internal.cache.DQPContextCache;
import com.metamatrix.api.exception.MetaMatrixComponentException;
@@ -44,6 +48,7 @@
* a mixed disk/memory model which requires use of a directory on the disk
* for file service access.
*/
+ at ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
public class BufferServiceImpl implements BufferService, Serializable {
private static final long serialVersionUID = -6217808623863643531L;
@@ -53,13 +58,12 @@
private BufferManagerImpl bufferMgr;
private File bufferDir;
private boolean useDisk = true;
- private int memorySize = 64;
private DQPContextCache contextCache;
- private int processorBatchSize = 2000;
- private int connectorBatchSize = 2000;
+ private int processorBatchSize = 256;
+ private int connectorBatchSize = 512;
private CacheFactory cacheFactory;
private int maxOpenFiles = DEFAULT_MAX_OPEN_FILES;
- private long maxFileSize = 2L; // 2GB
+ private long maxFileSize = 2048; // 2GB
private int maxProcessingBatchesColumns = BufferManager.DEFAULT_MAX_PROCESSING_BATCHES;
private int maxReserveBatchColumns = BufferManager.DEFAULT_RESERVE_BUFFERS;
@@ -147,10 +151,6 @@
}
}
- public void setBufferMemorySizeInMB(int size) {
- this.memorySize = size;
- }
-
public void setProcessorBatchSize(int size) {
this.processorBatchSize = size;
}
@@ -163,19 +163,17 @@
}
public boolean isUseDisk() {
- return useDisk;
+ return this.useDisk;
}
- public int getBufferMemorySizeInMB() {
- return memorySize;
- }
-
+ @ManagementProperty(description="The max row count of a batch sent internally within the query processor. Should be <= the connectorBatchSize. (default 256)")
public int getProcessorBatchSize() {
- return processorBatchSize;
+ return this.processorBatchSize;
}
+ @ManagementProperty(description="The max row count of a batch from a connector. Should be even multiple of processorBatchSize. (default 512)")
public int getConnectorBatchSize() {
- return connectorBatchSize;
+ return this.connectorBatchSize;
}
@Override
@@ -202,4 +200,28 @@
public void setMaxProcessingBatchesColumns(int value) {
this.maxProcessingBatchesColumns = value;
}
+
+ @ManagementProperty(description="Max open buffer files (default 128)")
+ public int getMaxOpenFiles() {
+ return maxOpenFiles;
+ }
+
+ @ManagementProperty(description="Max file size for buffer files (default 2GB)")
+ public long getMaxFileSize() {
+ return maxFileSize;
+ }
+
+ @ManagementProperty(description="#The number of batch columns guarenteed to a processing operation. Set this value lower if the workload typically" +
+ "processes larger numbers of concurrent queries with large intermediate results from operations such as sorting, " +
+ "grouping, etc. (default 124)")
+ public int getMaxProcessingBatchesColumns() {
+ return maxProcessingBatchesColumns;
+ }
+
+ @ManagementProperty(description="#The number of batch columns to allow in memory (default 16384). " +
+ "This value should be set lower or higher depending on the available memory to Teiid in the VM. " +
+ "16384 is considered a good default for a dedicated 32-bit VM running Teiid with a 1 gig heap.")
+ public int getMaxReserveBatchColumns() {
+ return maxReserveBatchColumns;
+ }
}
Modified: trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/runtime/src/main/java/org/teiid/services/SessionServiceImpl.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -37,6 +37,10 @@
import javax.security.auth.login.LoginContext;
import javax.security.auth.login.LoginException;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
import org.teiid.SecurityHelper;
import org.teiid.adminapi.impl.SessionMetadata;
import org.teiid.adminapi.impl.VDBMetaData;
@@ -59,6 +63,7 @@
/**
* This class serves as the primary implementation of the Session Service.
*/
+ at ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
public class SessionServiceImpl implements SessionService {
public static final String SECURITY_DOMAINS = "securitydomains"; //$NON-NLS-1$
@@ -67,6 +72,7 @@
*/
private long sessionMaxLimit = DEFAULT_MAX_SESSIONS;
private long sessionExpirationTimeLimit = DEFAULT_SESSION_EXPIRATION;
+
/*
* Injected state
*/
@@ -279,12 +285,22 @@
return info;
}
- public void setSessionMaxLimit(Long limit) {
- this.sessionMaxLimit = limit.longValue();
+ @ManagementProperty (description="Maximum number of sessions allowed by the system (default 5000)")
+ public long getSessionMaxLimit() {
+ return this.sessionMaxLimit;
}
- public void setsessionExpirationTimeLimit(Long limit) {
- this.sessionExpirationTimeLimit = limit.longValue();
+ public void setSessionMaxLimit(long limit) {
+ this.sessionMaxLimit = limit;
+ }
+
+ @ManagementProperty(description="Max allowed time before the session is terminated by the system, 0 indicates unlimited (default 0)")
+ public long getSessionExpirationTimeLimit() {
+ return this.sessionExpirationTimeLimit;
+ }
+
+ public void setSessionExpirationTimeLimit(long limit) {
+ this.sessionExpirationTimeLimit = limit;
}
public void setSecurityDomains(String domainNameOrder) {
Modified: trunk/runtime/src/main/java/org/teiid/transport/SocketConfiguration.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/SocketConfiguration.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/runtime/src/main/java/org/teiid/transport/SocketConfiguration.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -24,9 +24,15 @@
import java.net.InetAddress;
import java.net.UnknownHostException;
+import org.jboss.managed.api.annotation.ManagementComponent;
+import org.jboss.managed.api.annotation.ManagementObject;
+import org.jboss.managed.api.annotation.ManagementProperties;
+import org.jboss.managed.api.annotation.ManagementProperty;
+
import com.metamatrix.common.util.NetUtils;
import com.metamatrix.core.MetaMatrixRuntimeException;
+ at ManagementObject(componentType=@ManagementComponent(type="teiid",subtype="dqp"), properties=ManagementProperties.EXPLICIT)
public class SocketConfiguration {
private int outputBufferSize;
private int inputBufferSize;
@@ -35,9 +41,11 @@
private InetAddress hostAddress;
private SSLConfiguration sslConfiguration;
private boolean enabled;
+ private String hostName;
public void setBindAddress(String addr) {
+ this.hostName = addr;
this.hostAddress = resolveHostAddress(addr);
}
@@ -72,6 +80,7 @@
}
}
+ @ManagementProperty(description="SSL enabled", readOnly=true)
public boolean isEnabled() {
return enabled;
}
@@ -80,18 +89,22 @@
this.enabled = enabled;
}
+ @ManagementProperty(description="SO_SNDBUF size, 0 indicates that system default should be used (default 0)",readOnly=true)
public int getOutputBufferSize() {
return outputBufferSize;
}
+ @ManagementProperty(description="SO_RCVBUF size, 0 indicates that system default should be used (default 0)",readOnly=true)
public int getInputBufferSize() {
return inputBufferSize;
}
+ @ManagementProperty(description="Max NIO threads",readOnly=true)
public int getMaxSocketThreads() {
return maxSocketThreads;
}
+ @ManagementProperty(description="Port Number",readOnly=true)
public int getPortNumber() {
return portNumber;
}
@@ -99,6 +112,11 @@
public InetAddress getHostAddress() {
return hostAddress;
}
+
+ @ManagementProperty(description="Host Name",readOnly=true)
+ public String getHostName() {
+ return this.hostName;
+ }
public SSLConfiguration getSSLConfiguration() {
return sslConfiguration;
Modified: trunk/runtime/src/test/java/com/metamatrix/dqp/service/buffer/TestLocalBufferService.java
===================================================================
--- trunk/runtime/src/test/java/com/metamatrix/dqp/service/buffer/TestLocalBufferService.java 2010-03-05 19:50:20 UTC (rev 1928)
+++ trunk/runtime/src/test/java/com/metamatrix/dqp/service/buffer/TestLocalBufferService.java 2010-03-05 19:56:03 UTC (rev 1929)
@@ -41,7 +41,6 @@
svc.setDiskDirectory(UnitTestUtil.getTestScratchPath()+"/teiid");
// These are defaults if none of the properties are set.
- assertTrue(64 == svc.getBufferMemorySizeInMB()); //$NON-NLS-1$
assertTrue(svc.getBufferDirectory().isDirectory() && svc.getBufferDirectory().exists());
assertTrue(svc.isUseDisk());
}
@@ -49,12 +48,10 @@
public void testCheckMemPropertyGotSet() throws Exception {
BufferServiceImpl svc = new BufferServiceImpl();
svc.setDiskDirectory(UnitTestUtil.getTestScratchPath()+"/teiid/1");
- svc.setBufferMemorySizeInMB(96);
svc.setUseDisk(true);
svc.start();
// all the properties are set
- assertEquals(96 , svc.getBufferMemorySizeInMB()); //$NON-NLS-1$
assertTrue("Not Directory", svc.getBufferDirectory().isDirectory()); //$NON-NLS-1$
assertTrue("does not exist", svc.getBufferDirectory().exists()); //$NON-NLS-1$
assertTrue("does not end with one", svc.getBufferDirectory().getParent().endsWith("1")); //$NON-NLS-1$ //$NON-NLS-2$
@@ -67,7 +64,6 @@
public void testCheckMemPropertyGotSet2() throws Exception {
BufferServiceImpl svc = new BufferServiceImpl();
svc.setDiskDirectory(UnitTestUtil.getTestScratchPath()+"/teiid/1");
- svc.setBufferMemorySizeInMB(96);
svc.setUseDisk(false);
svc.start();
More information about the teiid-commits
mailing list