Author: shawkins
Date: 2009-04-11 13:17:48 -0400 (Sat, 11 Apr 2009)
New Revision: 755
Modified:
trunk/cache-jbosscache/src/main/java/com/metamatrix/cache/jboss/JBossCache.java
trunk/engine/src/main/java/com/metamatrix/cache/Cache.java
trunk/engine/src/main/java/com/metamatrix/cache/CacheFactory.java
trunk/engine/src/main/java/com/metamatrix/common/application/Application.java
trunk/engine/src/main/java/org/teiid/dqp/internal/cache/ResultSetCache.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorManagerImpl.java
trunk/server/src/main/java/com/metamatrix/platform/security/authorization/service/AuthorizationServiceImpl.java
Log:
TEIID-483 TEIID-40 added appropriate default cache settings and implemented maxfetchsize.
Modified: trunk/cache-jbosscache/src/main/java/com/metamatrix/cache/jboss/JBossCache.java
===================================================================
---
trunk/cache-jbosscache/src/main/java/com/metamatrix/cache/jboss/JBossCache.java 2009-04-11
03:03:46 UTC (rev 754)
+++
trunk/cache-jbosscache/src/main/java/com/metamatrix/cache/jboss/JBossCache.java 2009-04-11
17:17:48 UTC (rev 755)
@@ -39,11 +39,11 @@
*/
public class JBossCache<K, V> implements Cache<K, V> {
- private org.jboss.cache.Cache cacheStore;
+ private org.jboss.cache.Cache<K, V> cacheStore;
private Fqn rootFqn;
private JBossCacheListener cacheListener;
- public JBossCache(org.jboss.cache.Cache cacheStore, Fqn fqn) {
+ public JBossCache(org.jboss.cache.Cache<K, V> cacheStore, Fqn fqn) {
this.cacheStore = cacheStore;
this.rootFqn = fqn;
}
@@ -52,39 +52,39 @@
* {@inheritDoc}
*/
public V get(K key) {
- return (V)this.cacheStore.get(this.rootFqn, key);
+ return this.cacheStore.get(this.rootFqn, key);
}
/**
* {@inheritDoc}
*/
public V put(K key, V value) {
- return (V)this.cacheStore.put(this.rootFqn, key, value);
+ return this.cacheStore.put(this.rootFqn, key, value);
}
/**
* {@inheritDoc}
*/
public V remove(K key) {
- return (V)this.cacheStore.remove(this.rootFqn, key);
+ return this.cacheStore.remove(this.rootFqn, key);
}
/**
* {@inheritDoc}
*/
public Set<K> keySet() {
- Node node = this.cacheStore.getRoot().getChild(this.rootFqn);
+ Node<K, V> node = this.cacheStore.getRoot().getChild(this.rootFqn);
if (node != null) {
return node.getKeys();
}
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
/**
* {@inheritDoc}
*/
public int size() {
- Node node = this.cacheStore.getRoot().getChild(this.rootFqn);
+ Node<K, V> node = this.cacheStore.getRoot().getChild(this.rootFqn);
if (node != null) {
return node.dataSize();
}
@@ -95,7 +95,7 @@
* {@inheritDoc}
*/
public void clear() {
- Node node = this.cacheStore.getRoot().getChild(this.rootFqn);
+ Node<K, V> node = this.cacheStore.getRoot().getChild(this.rootFqn);
if (node != null) {
node.clearData();
}
@@ -103,7 +103,7 @@
@Override
public Collection<V> values() {
- Node node = this.cacheStore.getRoot().getChild(this.rootFqn);
+ Node<K, V> node = this.cacheStore.getRoot().getChild(this.rootFqn);
if (node != null) {
return node.getData().values();
}
@@ -130,21 +130,21 @@
* {@inheritDoc}
*/
@Override
- public Cache addChild(String name) {
- Node node = this.cacheStore.getNode(this.rootFqn);
- Node childNode = node.addChild(Fqn.fromString(name));
- return new JBossCache(this.cacheStore, childNode.getFqn());
+ public Cache<K, V> addChild(String name) {
+ Node<K, V> node = this.cacheStore.getNode(this.rootFqn);
+ Node<K, V> childNode = node.addChild(Fqn.fromString(name));
+ return new JBossCache<K, V>(this.cacheStore, childNode.getFqn());
}
/**
* {@inheritDoc}
*/
@Override
- public Cache getChild(String name) {
- Node node = this.cacheStore.getNode(this.rootFqn);
- Node child = node.getChild(Fqn.fromString(name));
+ public Cache<K, V> getChild(String name) {
+ Node<K, V> node = this.cacheStore.getNode(this.rootFqn);
+ Node<K, V> child = node.getChild(Fqn.fromString(name));
if (child != null) {
- return new JBossCache(this.cacheStore, child.getFqn());
+ return new JBossCache<K, V>(this.cacheStore, child.getFqn());
}
return null;
}
@@ -154,14 +154,14 @@
*/
@Override
public List<Cache> getChildren() {
- Node node = this.cacheStore.getNode(this.rootFqn);
+ Node<K, V> node = this.cacheStore.getNode(this.rootFqn);
Set<Node<K,V>> nodes = node.getChildren();
if (nodes.isEmpty()) {
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
List<Cache> children = new ArrayList<Cache>();
- for(Node child: nodes) {
- children.add(new JBossCache(this.cacheStore, child.getFqn()));
+ for(Node<K, V> child: nodes) {
+ children.add(new JBossCache<K, V>(this.cacheStore, child.getFqn()));
}
return children;
}
@@ -171,7 +171,7 @@
*/
@Override
public boolean removeChild(String name) {
- Node node = this.cacheStore.getNode(this.rootFqn);
+ Node<K, V> node = this.cacheStore.getNode(this.rootFqn);
return node.removeChild(Fqn.fromString(name));
}
}
Modified: trunk/engine/src/main/java/com/metamatrix/cache/Cache.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/cache/Cache.java 2009-04-11 03:03:46 UTC
(rev 754)
+++ trunk/engine/src/main/java/com/metamatrix/cache/Cache.java 2009-04-11 17:17:48 UTC
(rev 755)
@@ -36,7 +36,7 @@
SESSION("Session"), //$NON-NLS-1$
SESSION_MONITOR("Session-Monitor"), //$NON-NLS-1$
AUTHORIZATION_POLICY("Authorization-Policy"), //$NON-NLS-1$
- AUTHORIZATION_PRINCIPLE("Auhtorization-Principle"), //$NON-NLS-1$
+ AUTHORIZATION_PRINCIPAL("Auhtorization-Principal"), //$NON-NLS-1$
RESULTSET("ResultSet"), //$NON-NLS-1$
VDBMETADATA("VdbMetadata"), //$NON-NLS-1$
VDBMODELS("VdbModels"); //$NON-NLS-1$
Modified: trunk/engine/src/main/java/com/metamatrix/cache/CacheFactory.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/cache/CacheFactory.java 2009-04-11 03:03:46
UTC (rev 754)
+++ trunk/engine/src/main/java/com/metamatrix/cache/CacheFactory.java 2009-04-11 17:17:48
UTC (rev 755)
@@ -30,7 +30,7 @@
* @param config configuration setup for the cache
* @return
*/
- Cache get(Cache.Type type, CacheConfiguration config);
+ <K,V> Cache<K, V> get(Cache.Type type, CacheConfiguration config);
/**
* Destroy the cache factory and any caches underneath.
Modified: trunk/engine/src/main/java/com/metamatrix/common/application/Application.java
===================================================================
---
trunk/engine/src/main/java/com/metamatrix/common/application/Application.java 2009-04-11
03:03:46 UTC (rev 754)
+++
trunk/engine/src/main/java/com/metamatrix/common/application/Application.java 2009-04-11
17:17:48 UTC (rev 755)
@@ -57,7 +57,7 @@
final String serviceName = DQPServiceNames.ALL_SERVICES[i];
final Class<? extends ApplicationService> type =
DQPServiceNames.ALL_SERVICE_CLASSES[i];
if(injector.getBinding(Key.get(type)) == null){
- LogManager.logWarning(LogConstants.CTX_DQP,
DQPPlugin.Util.getString("DQPLauncher.InstallService_ServiceIsNull",
serviceName)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_DQP,
DQPPlugin.Util.getString("DQPLauncher.InstallService_ServiceIsNull",
serviceName)); //$NON-NLS-1$
}else{
ApplicationService appService = injector.getInstance(type);
String loggingContext = DQPServiceNames.SERVICE_LOGGING_CONTEXT[i];
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/cache/ResultSetCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/cache/ResultSetCache.java 2009-04-11
03:03:46 UTC (rev 754)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/cache/ResultSetCache.java 2009-04-11
17:17:48 UTC (rev 755)
@@ -27,12 +27,12 @@
import java.util.Map;
import java.util.Properties;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.cache.Cache;
import com.metamatrix.cache.CacheConfiguration;
import com.metamatrix.cache.CacheFactory;
import com.metamatrix.cache.Cache.Type;
import com.metamatrix.cache.CacheConfiguration.Policy;
+import com.metamatrix.common.util.PropertiesUtils;
/**
* Used to cache ResultSet based on the exact match of sql string.
@@ -49,25 +49,41 @@
private Cache<CacheID, CacheResults> cache;
private String scope;
- private Map tempBatchResults = new HashMap();
- private long maxSize; //bytes
+ private Map<CacheID, CacheResults> tempBatchResults = new HashMap<CacheID,
CacheResults>();
+ private int maxSize = 50 * 1024 * 1024; //bytes
+ private int maxAge = 60 * 60; // seconds
+ private int maxEntries = 20 * 1024;
- public ResultSetCache(Properties props, CacheFactory cacheFactory) throws
MetaMatrixComponentException{
- //ObjectCache does a check every 5 seconds.
- //It starts cleaning only if the cache is full.
- //We set the max size of the ObjectCache a little lower than the one user specified
- maxSize = Integer.parseInt(props.getProperty(RS_CACHE_MAX_SIZE)) * 1024 * 1024;
- int maxAgeInSeconds = Integer.parseInt(props.getProperty(RS_CACHE_MAX_AGE));
-
- scope = props.getProperty(RS_CACHE_SCOPE);
- this.cache = cacheFactory.get(Type.RESULTSET, new CacheConfiguration(Policy.MRU,
maxAgeInSeconds, 1000));
+ public ResultSetCache(Properties props, CacheFactory cacheFactory) {
+ PropertiesUtils.setBeanProperties(this, props, null);
+ this.cache = cacheFactory.get(Type.RESULTSET, new CacheConfiguration(Policy.MRU,
maxAge, maxEntries));
}
+ public void setMaxSize(int maxSize) {
+ if (maxSize <= 0 ) {
+ this.maxSize = 0;
+ this.maxEntries = Integer.MAX_VALUE;
+ } else {
+ this.maxSize = maxSize * 1024 * 1024;
+ this.maxEntries = this.maxSize * 1024;
+ }
+ }
+ public void setMaxAge(int maxAge) {
+ if (maxAge <= 0) {
+ this.maxAge = Integer.MAX_VALUE;
+ }
+ this.maxAge = Math.max(1, maxAge / 1000);
+ }
+
+ public void setScope(String scope) {
+ this.scope = scope;
+ }
+
//interval is 1 based.
public final CacheResults getResults(CacheID cacheID, int[] interval){
CacheResults cacheResults = null;
- cacheResults = (CacheResults)cache.get(cacheID);
+ cacheResults = cache.get(cacheID);
if(cacheResults == null){
return null;
}
@@ -80,7 +96,7 @@
return cacheResults;
}
int batchSize = lastRow - firstRow + 1;
- List[] resultsPart = new List[batchSize];
+ List<?>[] resultsPart = new List[batchSize];
System.arraycopy(cacheResults.getResults(), firstRow, resultsPart, 0, batchSize);
boolean isFinal = lastRow == finalRow;
CacheResults newCacheResults = new CacheResults(resultsPart,
cacheResults.getElements(), firstRow + 1, lastRow == finalRow);
@@ -104,7 +120,7 @@
* @return true if the result was cachable
*/
public boolean setResults(CacheID cacheID, CacheResults cacheResults, Object
requestID){
- List[] results = cacheResults.getResults();
+ List<?>[] results = cacheResults.getResults();
if(cacheResults.getSize() == -1){
cacheResults.setSize(ResultSetCacheUtil.getResultsSize(results, true));
}
@@ -118,7 +134,7 @@
}
synchronized(tempBatchResults){
- CacheResults savedResults = (CacheResults)tempBatchResults.get(cacheID);
+ CacheResults savedResults = tempBatchResults.get(cacheID);
if(savedResults == null){
savedResults = new CacheResults(null, cacheResults.getElements(), 1, false);
tempBatchResults.put(cacheID, savedResults);
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
---
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-04-11
03:03:46 UTC (rev 754)
+++
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-04-11
17:17:48 UTC (rev 755)
@@ -57,7 +57,6 @@
import org.teiid.dqp.internal.process.DQPWorkContext;
import org.teiid.dqp.internal.transaction.TransactionProvider;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.common.application.ApplicationEnvironment;
import com.metamatrix.common.application.ApplicationService;
import com.metamatrix.common.application.exception.ApplicationLifecycleException;
@@ -97,6 +96,8 @@
public static final int DEFAULT_MAX_PROCESSOR_THREADS = 15;
public static final int DEFAULT_PROCESSOR_TREAD_TTL = 120000;
+ private static final String DEFAULT_MAX_RESULTSET_CACHE_SIZE = "20";
//$NON-NLS-1$
+ private static final String DEFAULT_MAX_RESULTSET_CACHE_AGE = "3600000";
//$NON-NLS-1$
//state constructed in start
private ConnectorWrapper connector;
@@ -323,18 +324,14 @@
// Initialize and start the connector
initStartConnector(connectorEnv);
- try {
- //check result set cache
- if(PropertiesUtils.getBooleanProperty(props,
ConnectorPropertyNames.USE_RESULTSET_CACHE, false)) {
- Properties rsCacheProps = new Properties();
- rsCacheProps.setProperty(ResultSetCache.RS_CACHE_MAX_SIZE,
props.getProperty(ConnectorPropertyNames.MAX_RESULTSET_CACHE_SIZE, "0"));
//$NON-NLS-1$
- rsCacheProps.setProperty(ResultSetCache.RS_CACHE_MAX_AGE,
props.getProperty(ConnectorPropertyNames.MAX_RESULTSET_CACHE_AGE, "0"));
//$NON-NLS-1$
- rsCacheProps.setProperty(ResultSetCache.RS_CACHE_SCOPE,
props.getProperty(ConnectorPropertyNames.RESULTSET_CACHE_SCOPE,
ResultSetCache.RS_CACHE_SCOPE_VDB));
- this.rsCache = createResultSetCache(rsCacheProps);
- }
- } catch (MetaMatrixComponentException e) {
- throw new ApplicationLifecycleException(e);
- }
+ //check result set cache
+ if(PropertiesUtils.getBooleanProperty(props,
ConnectorPropertyNames.USE_RESULTSET_CACHE, false)) {
+ Properties rsCacheProps = new Properties();
+ rsCacheProps.setProperty(ResultSetCache.RS_CACHE_MAX_SIZE,
props.getProperty(ConnectorPropertyNames.MAX_RESULTSET_CACHE_SIZE,
DEFAULT_MAX_RESULTSET_CACHE_SIZE));
+ rsCacheProps.setProperty(ResultSetCache.RS_CACHE_MAX_AGE,
props.getProperty(ConnectorPropertyNames.MAX_RESULTSET_CACHE_AGE,
DEFAULT_MAX_RESULTSET_CACHE_AGE));
+ rsCacheProps.setProperty(ResultSetCache.RS_CACHE_SCOPE,
props.getProperty(ConnectorPropertyNames.RESULTSET_CACHE_SCOPE,
ResultSetCache.RS_CACHE_SCOPE_VDB));
+ this.rsCache = createResultSetCache(rsCacheProps);
+ }
this.workItemFactory = new ConnectorWorkItemFactory(this, this.rsCache, synchWorkers);
this.started = true;
}
@@ -456,8 +453,7 @@
return c;
}
- protected ResultSetCache createResultSetCache(Properties rsCacheProps)
- throws MetaMatrixComponentException {
+ protected ResultSetCache createResultSetCache(Properties rsCacheProps) {
return new ResultSetCache(rsCacheProps, ResourceFinder.getCacheFactory());
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-04-11
03:03:46 UTC (rev 754)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2009-04-11
17:17:48 UTC (rev 755)
@@ -117,11 +117,15 @@
private static final String PROCESS_PLAN_QUEUE_NAME =
"QueryProcessorQueue"; //$NON-NLS-1$
private static final String DEAFULT_PROCESS_WORKER_TIMEOUT = "120000";
//$NON-NLS-1$
private static final int DEFAULT_MAX_PROCESS_WORKERS = 15;
+ private static final String DEFAULT_MAX_RESULTSET_CACHE_SIZE = "50";
//$NON-NLS-1$
+ private static final String DEFAULT_MAX_RESULTSET_CACHE_AGE = "3600000";
//$NON-NLS-1$
// System properties for Code Table
private int maxCodeTableRecords = DEFAULT_MAX_CODE_TABLE_RECORDS;
private int maxCodeTables = DEFAULT_MAX_CODE_TABLES;
+ private int maxFetchSize = 20000;
+
// Resources
private ConnectorCapabilitiesCache connectorCapabilitiesCache = new
ConnectorCapabilitiesCache();
private BufferManager bufferManager;
@@ -135,7 +139,7 @@
// Query worker pool for processing plans
private WorkerPool processWorkerPool;
private int processorTimeslice = DEFAULT_PROCESSOR_TIMESLICE;
- private boolean processDebugAllowed;
+ private boolean processorDebugAllowed;
private TempTableStoresHolder tempTableStoresHolder;
private int chunkSize = 0;
@@ -228,7 +232,7 @@
RequestID requestID = workContext.getRequestID(reqID);
requestMsg.markProcessingStart();
Map<String, SourceCapabilities> vdbCapabilties =
this.connectorCapabilitiesCache.getVDBConnectorCapabilities(workContext);
-
+ requestMsg.setFetchSize(Math.min(requestMsg.getFetchSize(), maxFetchSize));
Request request = null;
if ( requestMsg.isPreparedStatement() || requestMsg.isCallableStatement()) {
request = new PreparedStatementRequest(prepPlanCache);
@@ -237,7 +241,7 @@
}
request.initialize(requestMsg, getEnvironment(), bufferManager,
dataTierMgr, vdbCapabilties, transactionService,
- processDebugAllowed, this.tempTableStoresHolder
+ processorDebugAllowed, this.tempTableStoresHolder
.getTempTableStore(workContext.getConnectionID()),
workContext, chunkSize);
@@ -358,7 +362,7 @@
}
RequestWorkItem safeGetWorkItem(Object processorID) {
- return this.requests.get((RequestID)processorID);
+ return this.requests.get(processorID);
}
/**
@@ -581,22 +585,18 @@
public void start(Properties props) {
ApplicationEnvironment env = this.getEnvironment();
+
+ PropertiesUtils.setBeanProperties(this, props, null);
this.chunkSize = PropertiesUtils.getIntProperty(props,
DQPConfigSource.STREAMING_BATCH_SIZE, 10) * 1024;
//result set cache
if(PropertiesUtils.getBooleanProperty(props, DQPConfigSource.USE_RESULTSET_CACHE,
false)){
Properties rsCacheProps = new Properties();
- rsCacheProps.setProperty(ResultSetCache.RS_CACHE_MAX_SIZE,
props.getProperty(DQPConfigSource.MAX_RESULTSET_CACHE_SIZE, "0"));
//$NON-NLS-1$
- rsCacheProps.setProperty(ResultSetCache.RS_CACHE_MAX_AGE,
props.getProperty(DQPConfigSource.MAX_RESULTSET_CACHE_AGE, "0")); //$NON-NLS-1$
+ rsCacheProps.setProperty(ResultSetCache.RS_CACHE_MAX_SIZE,
props.getProperty(DQPConfigSource.MAX_RESULTSET_CACHE_SIZE,
DEFAULT_MAX_RESULTSET_CACHE_SIZE));
+ rsCacheProps.setProperty(ResultSetCache.RS_CACHE_MAX_AGE,
props.getProperty(DQPConfigSource.MAX_RESULTSET_CACHE_AGE,
DEFAULT_MAX_RESULTSET_CACHE_AGE));
rsCacheProps.setProperty(ResultSetCache.RS_CACHE_SCOPE,
props.getProperty(DQPConfigSource.RESULTSET_CACHE_SCOPE,
ResultSetCache.RS_CACHE_SCOPE_VDB));
- try {
- this.rsCache = new ResultSetCache(rsCacheProps, ResourceFinder.getCacheFactory());
- } catch (MetaMatrixComponentException e) {
- // this does not really affect the
- //function of DQP, log warning for now
- LogManager.logWarning(LogConstants.CTX_DQP, e,
DQPPlugin.Util.getString("DQPCORE.6")); //$NON-NLS-1$
- }
+ this.rsCache = new ResultSetCache(rsCacheProps, ResourceFinder.getCacheFactory());
}
//prepared plan cache
@@ -604,13 +604,8 @@
prepPlanCache = new PreparedPlanCache(maxSizeTotal);
// Processor debug flag
- this.processDebugAllowed = PropertiesUtils.getBooleanProperty(props,
DQPConfigSource.PROCESSOR_DEBUG_ALLOWED, false);
- LogManager.logInfo(LogConstants.CTX_DQP,
DQPPlugin.Util.getString("DQPCore.Processor_debug_allowed_{0}",
processDebugAllowed)); //$NON-NLS-1$
+ LogManager.logInfo(LogConstants.CTX_DQP,
DQPPlugin.Util.getString("DQPCore.Processor_debug_allowed_{0}",
this.processorDebugAllowed)); //$NON-NLS-1$
- this.maxCodeTables = PropertiesUtils.getIntProperty(props,
DQPConfigSource.MAX_CODE_TABLES, DEFAULT_MAX_CODE_TABLES);
- this.maxCodeTableRecords = PropertiesUtils.getIntProperty(props,
DQPConfigSource.MAX_CODE_TABLE_RECORDS, DEFAULT_MAX_CODE_TABLE_RECORDS);
- this.processorTimeslice = PropertiesUtils.getIntProperty(props,
DQPConfigSource.PROCESSOR_TIMESLICE, DEFAULT_PROCESSOR_TIMESLICE);
-
//get buffer manager
BufferService bufferService = (BufferService)
env.findService(DQPServiceNames.BUFFER_SERVICE);
bufferManager = bufferService.getBufferManager();
@@ -729,5 +724,25 @@
MetaDataProcessor processor = new MetaDataProcessor(this.metadataService, this,
this.prepPlanCache, getEnvironment(), this.tempTableStoresHolder);
return processor.processMessage(workContext.getRequestID(requestID), workContext,
preparedSql, allowDoubleQuotedVariable);
}
+
+ public void setMaxFetchSize(int maxFetchSize) {
+ this.maxFetchSize = maxFetchSize;
+ }
+
+ public void setProcessorDebugAllowed(boolean processorDebugAllowed) {
+ this.processorDebugAllowed = processorDebugAllowed;
+ }
+
+ public void setMaxCodeTableRecords(int maxCodeTableRecords) {
+ this.maxCodeTableRecords = maxCodeTableRecords;
+ }
+
+ public void setMaxCodeTables(int maxCodeTables) {
+ this.maxCodeTables = maxCodeTables;
+ }
+
+ public void setProcessorTimeslice(int processorTimeslice) {
+ this.processorTimeslice = processorTimeslice;
+ }
}
\ No newline at end of file
Modified:
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorManagerImpl.java
===================================================================
---
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorManagerImpl.java 2009-04-11
03:03:46 UTC (rev 754)
+++
trunk/engine/src/test/java/org/teiid/dqp/internal/datamgr/impl/TestConnectorManagerImpl.java 2009-04-11
17:17:48 UTC (rev 755)
@@ -26,11 +26,7 @@
*/
package org.teiid.dqp.internal.datamgr.impl;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
import java.net.URL;
import java.net.URLClassLoader;
@@ -45,7 +41,6 @@
import org.teiid.dqp.internal.pooling.connector.FakeSourceConnectionFactory;
import org.teiid.dqp.internal.process.DQPWorkContext;
-import com.metamatrix.api.exception.MetaMatrixComponentException;
import com.metamatrix.cache.FakeCache;
import com.metamatrix.common.application.ApplicationEnvironment;
import com.metamatrix.common.application.exception.ApplicationLifecycleException;
@@ -157,10 +152,8 @@
@Test public void testCaching() throws Exception {
ConnectorManager cm = new ConnectorManager() {
@Override
- protected ResultSetCache createResultSetCache(
- Properties rsCacheProps)
- throws MetaMatrixComponentException {
- assertEquals(rsCacheProps.get(ResultSetCache.RS_CACHE_MAX_AGE),
String.valueOf(0));
+ protected ResultSetCache createResultSetCache(Properties rsCacheProps) {
+ assertEquals(String.valueOf(3600000),
rsCacheProps.get(ResultSetCache.RS_CACHE_MAX_AGE));
return new ResultSetCache(rsCacheProps, new FakeCache.FakeCacheFactory());
}
};
Modified:
trunk/server/src/main/java/com/metamatrix/platform/security/authorization/service/AuthorizationServiceImpl.java
===================================================================
---
trunk/server/src/main/java/com/metamatrix/platform/security/authorization/service/AuthorizationServiceImpl.java 2009-04-11
03:03:46 UTC (rev 754)
+++
trunk/server/src/main/java/com/metamatrix/platform/security/authorization/service/AuthorizationServiceImpl.java 2009-04-11
17:17:48 UTC (rev 755)
@@ -163,7 +163,7 @@
// Initialize cache
CacheFactory cf = ResourceFinder.getCacheFactory();
CacheConfiguration config = new CacheConfiguration(Policy.LRU, 0, 0);
- this.authorizationCache = new
AuthorizationCache(cf.get(Type.AUTHORIZATION_POLICY, config),
cf.get(Type.AUTHORIZATION_PRINCIPLE, config),environment);
+ this.authorizationCache = new
AuthorizationCache(cf.get(Type.AUTHORIZATION_POLICY, config),
cf.get(Type.AUTHORIZATION_PRINCIPAL, config),environment);
this.serviceClosed = false;