teiid SVN: r3959 - in trunk: admin/src/main/java/org/teiid/adminapi and 14 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-03-30 19:04:00 -0400 (Fri, 30 Mar 2012)
New Revision: 3959
Added:
trunk/jboss-integration/src/main/java/org/teiid/jboss/TupleBufferCacheService.java
Modified:
trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java
trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataMapper.java
trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml
trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java
trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/BaseOperationHandler.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/BufferManagerService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheFactoryService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/Element.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossSessionService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidServiceNames.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java
trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
trunk/jboss-integration/src/main/resources/schema/jboss-teiid.xsd
trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
trunk/jboss-integration/src/test/resources/teiid-model-config.txt
trunk/jboss-integration/src/test/resources/teiid-model-json.txt
trunk/jboss-integration/src/test/resources/teiid-sample-config.xml
trunk/pom.xml
trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
Log:
TEIID-1981:Fixed the ADMIN API responses for the Domain mode. Also fixed issues related to object Replication for result set cache and mat view distribution. Upgraded to 7.1.1
Modified: trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -62,10 +62,12 @@
import org.teiid.adminapi.impl.AdminObjectImpl;
import org.teiid.adminapi.impl.MetadataMapper;
import org.teiid.adminapi.impl.PropertyDefinitionMetadata;
+import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.VDBMetadataMapper;
import org.teiid.adminapi.impl.VDBMetadataMapper.RequestMetadataMapper;
import org.teiid.adminapi.impl.VDBMetadataMapper.SessionMetadataMapper;
import org.teiid.adminapi.impl.VDBMetadataMapper.TransactionMetadataMapper;
+import org.teiid.adminapi.impl.VDBTranslatorMetaData;
import org.teiid.core.util.ObjectConverterUtil;
@@ -299,33 +301,43 @@
}
}
- public Set<String> getInstalledJDBCDrivers() throws AdminException {
+ public Set<String> getInstalledJDBCDrivers() throws AdminProcessingException {
HashSet<String> driverList = new HashSet<String>();
driverList.addAll(getChildNodeNames("datasources", "jdbc-driver"));
- final ModelNode request = buildRequest("datasources", "installed-drivers-list");
- try {
- ModelNode outcome = this.connection.execute(request);
- if (Util.isSuccess(outcome)) {
- List<String> drivers = getList(outcome, new AbstractMetadatMapper() {
- @Override
- public String unwrap(ModelNode node) {
- if (node.hasDefined("driver-name")) {
- return node.get("driver-name").asString();
+ if (!this.domainMode) {
+ //'installed-driver-list' not available in the domain mode.
+ final ModelNode request = buildRequest("datasources", "installed-drivers-list");
+ try {
+ ModelNode outcome = this.connection.execute(request);
+ if (Util.isSuccess(outcome)) {
+ List<String> drivers = getList(outcome, new AbstractMetadatMapper() {
+ @Override
+ public String unwrap(ModelNode node) {
+ if (node.hasDefined("driver-name")) {
+ return node.get("driver-name").asString();
+ }
+ return null;
}
- return null;
- }
- });
- driverList.addAll(drivers);
- }
- } catch (Exception e) {
- // in domain mode this method does not exist; this is expected in some domain mode.
- }
+ });
+ driverList.addAll(drivers);
+ }
+ } catch (Exception e) {
+ throw new AdminProcessingException(e);
+ }
+ }
+ else {
+ // TODO: AS7 needs to provide better way to query the deployed JDBC drivers
+ List<String> deployments = getChildNodeNames(null, "deployment");
+ for (String deployment:deployments) {
+ if (!deployment.contains("translator") && deployment.endsWith(".jar")) {
+ driverList.add(deployment);
+ }
+ }
+ }
return driverList;
}
-
-
public String getProfileName() throws AdminProcessingException {
if (!this.domainMode) {
return null;
@@ -620,7 +632,7 @@
@Override
public Collection<String> getCacheTypes() throws AdminException {
final ModelNode request = buildRequest("teiid", "cache-types");//$NON-NLS-1$ //$NON-NLS-2$
- return executeList(request);
+ return new HashSet<String>(executeList(request));
}
private Collection<String> executeList(final ModelNode request) throws AdminProcessingException {
@@ -1030,8 +1042,10 @@
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
if (outcome.hasDefined("result")) {
- ModelNode result = outcome.get("result");
- return VDBMetadataMapper.VDBTranslatorMetaDataMapper.INSTANCE.unwrap(result);
+ List<VDBTranslatorMetaData> list = getDomainAwareList(outcome, VDBMetadataMapper.VDBTranslatorMetaDataMapper.INSTANCE);
+ if (list != null && !list.isEmpty()) {
+ return list.get(0);
+ }
}
}
@@ -1143,10 +1157,10 @@
try {
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
- if (outcome.hasDefined("result")) {
- ModelNode result = outcome.get("result");
- return VDBMetadataMapper.INSTANCE.unwrap(result);
- }
+ List<VDBMetaData> list = getDomainAwareList(outcome, VDBMetadataMapper.INSTANCE);
+ if (list != null && !list.isEmpty()) {
+ return list.get(0);
+ }
}
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70035, e);
Modified: trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataMapper.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataMapper.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/admin/src/main/java/org/teiid/adminapi/impl/VDBMetadataMapper.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -104,6 +104,8 @@
dataPoliciesNodes.add(DataPolicyMetadataMapper.INSTANCE.wrap((DataPolicyMetadata)policy, new ModelNode()));
}
}
+
+ wrapDomain(vdb, node);
return node;
}
@@ -178,6 +180,7 @@
}
}
+ unwrapDomain(vdb, node);
return vdb;
}
@@ -516,6 +519,7 @@
propsNode.add(PropertyMetaDataMapper.INSTANCE.wrap(prop, new ModelNode()));
}
}
+ wrapDomain(translator, node);
return node;
}
@@ -546,6 +550,7 @@
}
}
}
+ unwrapDomain(translator, node);
return translator;
}
@@ -831,6 +836,7 @@
node.get(HITRATIO).set(object.getHitRatio());
node.get(REQUEST_COUNT).set(object.getRequestCount());
+ wrapDomain(object, node);
return node;
}
@@ -842,6 +848,8 @@
cache.setTotalEntries(node.get(TOTAL_ENTRIES).asInt());
cache.setHitRatio(node.get(HITRATIO).asDouble());
cache.setRequestCount(node.get(REQUEST_COUNT).asInt());
+
+ unwrapDomain(cache, node);
return cache;
}
@@ -884,6 +892,8 @@
}
node.get(STATE).set(request.getState().name());
node.get(THREAD_STATE).set(request.getThreadState().name());
+
+ wrapDomain(request, node);
return node;
}
@@ -905,6 +915,8 @@
}
request.setState(ProcessingState.valueOf(node.get(STATE).asString()));
request.setThreadState(ThreadState.valueOf(node.get(THREAD_STATE).asString()));
+
+ unwrapDomain(request, node);
return request;
}
@@ -959,6 +971,7 @@
if (session.getClientHardwareAddress() != null) {
node.get(CLIENT_HARDWARE_ADRESS).set(session.getClientHardwareAddress());
}
+ wrapDomain(session, node);
return node;
}
@@ -984,6 +997,7 @@
if (node.has(CLIENT_HARDWARE_ADRESS)) {
session.setClientHardwareAddress(node.get(CLIENT_HARDWARE_ADRESS).asString());
}
+ unwrapDomain(session, node);
return session;
}
@@ -1018,7 +1032,7 @@
transaction.get(CREATED_TIME).set(object.getCreatedTime());
transaction.get(SCOPE).set(object.getScope());
transaction.get(ID).set(object.getId());
-
+ wrapDomain(object, transaction);
return transaction;
}
@@ -1031,6 +1045,7 @@
transaction.setCreatedTime(node.get(CREATED_TIME).asLong());
transaction.setScope(node.get(SCOPE).asString());
transaction.setId(node.get(ID).asString());
+ unwrapDomain(transaction, node);
return transaction;
}
@@ -1067,7 +1082,7 @@
node.get(QUEUED).set(stats.getQueued());
node.get(HIGHEST_QUEUED).set(stats.getHighestQueued());
node.get(MAX_THREADS).set(stats.getMaxThreads());
-
+ wrapDomain(stats, node);
return node;
}
@@ -1083,7 +1098,8 @@
stats.setQueueName(node.get(QUEUE_NAME).asString());
stats.setQueued(node.get(QUEUED).asInt());
stats.setHighestQueued(node.get(HIGHEST_QUEUED).asInt());
- stats.setMaxThreads(node.get(MAX_THREADS).asInt());
+ stats.setMaxThreads(node.get(MAX_THREADS).asInt());
+ unwrapDomain(stats, node);
return stats;
}
@@ -1098,8 +1114,35 @@
addAttribute(node, MAX_THREADS, ModelType.INT, true);
return node;
}
+ }
+
+ public static void wrapDomain(AdminObjectImpl anObj, ModelNode node) {
+ if (anObj.getServerGroup() != null) {
+ node.get(SERVER_GROUP).set(anObj.getServerGroup());
+ }
+ if (anObj.getHostName() != null) {
+ node.get(HOST_NAME).set(anObj.getHostName());
+ }
+ if (anObj.getServerName() != null) {
+ node.get(SERVER_NAME).set(anObj.getServerName());
+ }
+ }
+
+ public static void unwrapDomain(AdminObjectImpl anObj, ModelNode node) {
+ if (node.get(SERVER_GROUP).isDefined()) {
+ anObj.setServerGroup(node.get(SERVER_GROUP).asString());
+ }
+ if (node.get(HOST_NAME).isDefined()) {
+ anObj.setHostName(node.get(HOST_NAME).asString());
+ }
+ if (node.get(SERVER_NAME).isDefined()) {
+ anObj.setServerName(node.get(SERVER_NAME).asString());
+ }
}
+ private static final String SERVER_GROUP = "server-group"; //$NON-NLS-1$
+ private static final String HOST_NAME = "host-name"; //$NON-NLS-1$
+ private static final String SERVER_NAME = "server-name"; //$NON-NLS-1$
private static final String DOT_DESC = ".describe"; //$NON-NLS-1$
private static final String TYPE = "type"; //$NON-NLS-1$
private static final String REQUIRED = "required"; //$NON-NLS-1$
@@ -1111,6 +1154,7 @@
node.get(name, REQUIRED).set(required);
return node;
}
+
}
Modified: trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml 2012-03-30 23:04:00 UTC (rev 3959)
@@ -1,7 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
-<domain xmlns="urn:jboss:domain:1.1">
-
+<domain xmlns="urn:jboss:domain:1.2">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.clustering.jgroups"/>
@@ -34,12 +33,10 @@
<extension module="org.jboss.as.webservices"/>
<extension module="org.jboss.as.weld"/>
</extensions>
-
<system-properties>
<!-- IPv4 is not required, but setting this helps avoid unintended use of IPv6 -->
<property name="java.net.preferIPv4Stack" value="true"/>
</system-properties>
-
<profiles>
<profile name="ha">
<subsystem xmlns="urn:jboss:domain:logging:1.1">
@@ -115,10 +112,6 @@
<stateful default-access-timeout="5000" cache-ref="simple" clustered-cache-ref="clustered"/>
<singleton default-access-timeout="5000"/>
</session-bean>
- <mdb>
- <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
- <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
- </mdb>
<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
@@ -146,7 +139,7 @@
</thread-pool>
</thread-pools>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:infinispan:1.1" default-cache-container="cluster">
+ <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="cluster">
<cache-container name="cluster" aliases="ha-partition" default-cache="default">
<transport lock-timeout="60000"/>
<replicated-cache name="default" mode="SYNC" batching="true">
@@ -169,8 +162,10 @@
<eviction strategy="LRU"/>
<file-store/>
</replicated-cache>
- <!-- Clustered cache used internally by EJB subsytem for managing the client-mapping(s) of
- the socketbinding referenced by the EJB remoting connector -->
+ <!--
+ ~ Clustered cache used internally by EJB subsytem for managing the client-mapping(s) of
+ ~ the socketbinding referenced by the EJB remoting connector
+ -->
<replicated-cache name="remote-connector-client-mappings" mode="SYNC" batching="true"/>
<distributed-cache name="dist" mode="ASYNC" batching="true">
<eviction strategy="LRU"/>
@@ -194,12 +189,11 @@
<eviction strategy="NONE"/>
</replicated-cache>
</cache-container>
- <cache-container name="teiid" default-cache="resultset">
+ <cache-container name="teiid-cache" default-cache="resultset">
<transport lock-timeout="60000"/>
<replicated-cache name="resultset" mode="SYNC" batching="true">
<locking isolation="READ_COMMITTED"/>
- <transaction mode="FULL_XA"/>
- <expiration lifespan="7200" />
+ <expiration lifespan="7200000" />
<eviction max-entries="1024" strategy="LRU"/>
</replicated-cache>
</cache-container>
@@ -207,7 +201,7 @@
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
<subsystem xmlns="urn:jboss:domain:jca:1.1">
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
- <bean-validation enabled="false"/>
+ <bean-validation enabled="true"/>
<default-workmanager>
<short-running-threads>
<core-threads count="50"/>
@@ -222,6 +216,7 @@
<keepalive-time time="10" unit="seconds"/>
</long-running-threads>
</default-workmanager>
+ <cached-connection-manager/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="udp">
@@ -260,7 +255,7 @@
</subsystem>
<subsystem xmlns="urn:jboss:domain:jmx:1.1">
<show-model value="true"/>
- <remoting-connector/>
+ <!--<remoting-connector use-management-endpoint="false"/>-->
</subsystem>
<subsystem xmlns="urn:jboss:domain:jpa:1.0">
<jpa default-datasource=""/>
@@ -271,7 +266,11 @@
</mail-session>
</subsystem>
<subsystem xmlns="urn:jboss:domain:modcluster:1.0">
- <mod-cluster-config advertise-socket="modcluster"/>
+ <mod-cluster-config advertise-socket="modcluster">
+ <dynamic-load-provider>
+ <load-metric type="busyness"/>
+ </dynamic-load-provider>
+ </mod-cluster-config>
</subsystem>
<subsystem xmlns="urn:jboss:domain:naming:1.1"/>
<subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy">
@@ -333,8 +332,8 @@
</subsystem>
<subsystem xmlns="urn:jboss:domain:teiid:1.0">
<async-thread-pool>teiid-async</async-thread-pool>
- <distributed-cache jgroups-stack="udp" channel="teiid-channel"/>
- <resultset-cache infinispan-container="teiid"/>
+ <distributed-cache jgroups-stack="udp"/>
+ <resultset-cache infinispan-container="teiid-cache"/>
<transport name="embedded"/>
<transport name="jdbc" protocol="teiid" socket-binding="teiid-jdbc">
@@ -392,6 +391,7 @@
</subsystem>
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
+ <connector name="ajp" protocol="AJP/1.3" scheme="http" socket-binding="ajp"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
@@ -410,34 +410,32 @@
<subsystem xmlns="urn:jboss:domain:weld:1.0"/>
</profile>
</profiles>
-
<!--
- Named interfaces that can be referenced elsewhere in the configuration. The configuration
- for how to associate these logical names with an actual network interface can either
- be specified here or can be declared on a per-host basis in the equivalent element in host.xml.
-
- These default configurations require the binding specification to be done in host.xml.
- -->
+ ~
+ ~ Named interfaces that can be referenced elsewhere in the configuration. The configuration
+ ~ for how to associate these logical names with an actual network interface can either
+ ~ be specified here or can be declared on a per-host basis in the equivalent element in host.xml.
+ ~
+ ~ These default configurations require the binding specification to be done in host.xml.
+ ~
+ -->
<interfaces>
<interface name="management"/>
<interface name="public"/>
<interface name="unsecure"/>
</interfaces>
-
<socket-binding-groups>
<socket-binding-group name="ha-sockets" default-interface="public">
+ <!-- Needed for server groups using the 'ha' profile -->
+ <socket-binding name="ajp" port="8009"/>
<socket-binding name="http" port="8080"/>
<socket-binding name="https" port="8443"/>
- <socket-binding name="jacorb" interface="unsecure" port="3528"/>
- <socket-binding name="jacorb-ssl" interface="unsecure" port="3529"/>
<socket-binding name="jgroups-diagnostics" port="0" multicast-address="224.0.75.75" multicast-port="7500"/>
<socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
<socket-binding name="jgroups-tcp" port="7600"/>
<socket-binding name="jgroups-tcp-fd" port="57600"/>
<socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
<socket-binding name="jgroups-udp-fd" port="54200"/>
- <socket-binding name="messaging" port="5445"/>
- <socket-binding name="messaging-throughput" port="5455"/>
<socket-binding name="modcluster" port="0" multicast-address="224.0.1.105" multicast-port="23364"/>
<socket-binding name="osgi-http" interface="management" port="8090"/>
<socket-binding name="remoting" port="4447"/>
@@ -450,7 +448,6 @@
</outbound-socket-binding>
</socket-binding-group>
</socket-binding-groups>
-
<server-groups>
<server-group name="main-server-group" profile="ha">
<jvm name="default">
@@ -459,5 +456,4 @@
<socket-binding-group ref="ha-sockets"/>
</server-group>
</server-groups>
-
-</domain>
+</domain>
\ No newline at end of file
Modified: trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/build/kits/jboss-as7/standalone/configuration/standalone-teiid.xml 2012-03-30 23:04:00 UTC (rev 3959)
@@ -1,7 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
-<server xmlns="urn:jboss:domain:1.1">
-
+<server xmlns="urn:jboss:domain:1.2">
<extensions>
<extension module="org.jboss.as.clustering.infinispan"/>
<extension module="org.jboss.as.configadmin"/>
@@ -28,7 +27,6 @@
<extension module="org.jboss.as.webservices"/>
<extension module="org.jboss.as.weld"/>
</extensions>
-
<management>
<security-realms>
<security-realm name="ManagementRealm">
@@ -51,7 +49,6 @@
</http-interface>
</management-interfaces>
</management>
-
<profile>
<subsystem xmlns="urn:jboss:domain:logging:1.1">
<console-handler name="CONSOLE">
@@ -129,10 +126,6 @@
<stateful default-access-timeout="5000" cache-ref="simple"/>
<singleton default-access-timeout="5000"/>
</session-bean>
- <mdb>
- <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
- <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
- </mdb>
<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
@@ -158,7 +151,7 @@
</thread-pool>
</thread-pools>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:infinispan:1.1" default-cache-container="hibernate">
+ <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="hibernate">
<cache-container name="hibernate" default-cache="local-query">
<local-cache name="entity">
<transaction mode="NON_XA"/>
@@ -177,7 +170,7 @@
</cache-container>
<cache-container name="teiid" default-cache="resultset">
<local-cache name="resultset">
- <expiration lifespan="7200" />
+ <expiration lifespan="7200000" />
<eviction max-entries="1024" strategy="LRU"/>
</local-cache>
</cache-container>
@@ -185,7 +178,7 @@
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
<subsystem xmlns="urn:jboss:domain:jca:1.1">
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
- <bean-validation enabled="false"/>
+ <bean-validation enabled="true"/>
<default-workmanager>
<short-running-threads>
<core-threads count="50"/>
@@ -200,6 +193,7 @@
<keepalive-time time="10" unit="seconds"/>
</long-running-threads>
</default-workmanager>
+ <cached-connection-manager/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
<subsystem xmlns="urn:jboss:domain:jmx:1.1">
@@ -350,7 +344,6 @@
</subsystem>
<subsystem xmlns="urn:jboss:domain:weld:1.0"/>
</profile>
-
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
@@ -358,14 +351,22 @@
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>
+ <!-- TODO - only show this if the jacorb subsystem is added -->
+ <interface name="unsecure">
+ <!--
+ ~ Used for IIOP sockets in the standard configuration.
+ ~ To secure JacORB you need to setup SSL
+ -->
+ <inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
+ </interface>
</interfaces>
-
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
- <socket-binding name="http" port="8080"/>
- <socket-binding name="https" port="8443"/>
<socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9443}"/>
+ <socket-binding name="ajp" port="8009"/>
+ <socket-binding name="http" port="8080"/>
+ <socket-binding name="https" port="8443"/>
<socket-binding name="osgi-http" interface="management" port="8090"/>
<socket-binding name="remoting" port="4447"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
@@ -376,4 +377,4 @@
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
-</server>
+</server>
\ No newline at end of file
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 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/DQPCore.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -65,7 +65,6 @@
import org.teiid.dqp.internal.process.ThreadReuseExecutor.PrioritizedRunnable;
import org.teiid.dqp.message.AtomicRequestMessage;
import org.teiid.dqp.message.RequestID;
-import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.TransactionContext;
import org.teiid.dqp.service.TransactionContext.Scope;
import org.teiid.dqp.service.TransactionService;
@@ -676,8 +675,8 @@
LogManager.logDetail(LogConstants.CTX_DQP, "DQPCore started maxThreads", this.config.getMaxThreads(), "maxActivePlans", this.maxActivePlans, "source concurrency", this.userRequestSourceConcurrency); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- public void setBufferService(BufferService service) {
- this.bufferManager = service.getBufferManager();
+ public void setBufferManager(BufferManager mgr) {
+ this.bufferManager = mgr;
}
public void setTransactionService(TransactionService service) {
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestCachedResults.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -21,7 +21,9 @@
*/
package org.teiid.dqp.internal.process;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.List;
@@ -30,12 +32,11 @@
import org.teiid.cache.Cache;
import org.teiid.cache.DefaultCache;
import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.BufferManager.TupleSourceType;
import org.teiid.common.buffer.BufferManagerFactory;
import org.teiid.common.buffer.TupleBuffer;
-import org.teiid.common.buffer.BufferManager.TupleSourceType;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.UnitTestUtil;
-import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.FakeBufferService;
import org.teiid.metadata.Table;
import org.teiid.query.processor.FakeProcessorPlan;
@@ -50,7 +51,7 @@
@Test
public void testCaching() throws Exception {
- BufferService fbs = new FakeBufferService(true);
+ FakeBufferService fbs = new FakeBufferService(true);
ElementSymbol x = new ElementSymbol("x"); //$NON-NLS-1$
x.setType(DataTypeManager.DefaultDataClasses.INTEGER);
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDQPCore.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -116,9 +116,9 @@
Mockito.stub(repo.getConnectorManager(Mockito.anyString())).toReturn(agds);
BufferManagerImpl bm = BufferManagerFactory.createBufferManager();
bm.setInlineLobs(false);
- BufferService bs = new FakeBufferService(bm, bm);
+ FakeBufferService bs = new FakeBufferService(bm, bm);
core = new DQPCore();
- core.setBufferService(bs);
+ core.setBufferManager(bs.getBufferManager());
core.setResultsetCache(new SessionAwareCache<CachedResults>(new DefaultCacheFactory(), SessionAwareCache.Type.RESULTSET, new CacheConfiguration()));
core.setPreparedPlanCache(new SessionAwareCache<PreparedPlan>(new DefaultCacheFactory(), SessionAwareCache.Type.PREPAREDPLAN, new CacheConfiguration()));
core.setTransactionService(new FakeTransactionService());
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 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/process/TestDataTierManager.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -85,7 +85,7 @@
rm = new DQPCore();
rm.setTransactionService(new FakeTransactionService());
- rm.setBufferService(new FakeBufferService());
+ rm.setBufferManager(new FakeBufferService().getBufferManager());
rm.setResultsetCache(new SessionAwareCache<CachedResults>(new DefaultCacheFactory(), SessionAwareCache.Type.RESULTSET, new CacheConfiguration()));
rm.setPreparedPlanCache(new SessionAwareCache<PreparedPlan>(new DefaultCacheFactory(), SessionAwareCache.Type.PREPAREDPLAN, new CacheConfiguration()));
rm.start(new DQPConfiguration());
Modified: trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCache.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -31,50 +31,48 @@
/**
* Implementation of Cache using Infinispan
*/
-public class JBossCache<K, V> implements Cache<String, V> {
+public class JBossCache<K, V> implements Cache<K, V> {
- protected org.infinispan.Cache<String, V> cacheStore;
+ protected org.infinispan.AdvancedCache<K, V> cacheStore;
private final String name;
+ private ClassLoader classloader;
- public JBossCache(org.infinispan.Cache<String, V> cacheStore, String cacheName) {
- this.cacheStore = cacheStore;
+ public JBossCache(org.infinispan.Cache<K, V> cacheStore, String cacheName, ClassLoader classloader) {
+ this.cacheStore = cacheStore.getAdvancedCache();
this.name = cacheName;
+ this.classloader = classloader;
}
- private String fqn(String key) {
- return this.name+"."+key; //$NON-NLS-1$
- }
-
@Override
- public V get(String key) {
- return this.cacheStore.get(fqn(key));
+ public V get(K key) {
+ return this.cacheStore.with(this.classloader).get(key);
}
- public V put(String key, V value) {
- return this.cacheStore.put(fqn(key), value);
+ public V put(K key, V value) {
+ return this.cacheStore.with(this.classloader).put(key, value);
}
@Override
- public V put(String key, V value, Long ttl) {
+ public V put(K key, V value, Long ttl) {
if (ttl != null) {
- return this.cacheStore.put(fqn(key), value, ttl, TimeUnit.MILLISECONDS);
+ return this.cacheStore.with(this.classloader).put(key, value, ttl, TimeUnit.MILLISECONDS);
}
- return this.cacheStore.put(fqn(key), value);
+ return this.cacheStore.with(this.classloader).put(key, value);
}
@Override
- public V remove(String key) {
- return this.cacheStore.remove(fqn(key));
+ public V remove(K key) {
+ return this.cacheStore.with(this.classloader).remove(key);
}
@Override
public int size() {
- return this.cacheStore.size();
+ return this.cacheStore.with(this.classloader).size();
}
@Override
public void clear() {
- this.cacheStore.clear();
+ this.cacheStore.with(this.classloader).clear();
}
@Override
@@ -83,7 +81,7 @@
}
@Override
- public Set<String> keys() {
- return this.cacheStore.keySet();
+ public Set<K> keys() {
+ return this.cacheStore.with(this.classloader).keySet();
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/cache/jboss/JBossCacheFactory.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -36,15 +36,17 @@
private static final long serialVersionUID = -2767452034178675653L;
private transient org.infinispan.Cache cacheStore;
private volatile boolean destroyed = false;
+ private ClassLoader classLoader;
- public JBossCacheFactory(String name, CacheContainer cm) {
+ public JBossCacheFactory(String name, CacheContainer cm, ClassLoader classLoader) {
if (name != null) {
this.cacheStore = cm.getCache(name);
}
else {
this.cacheStore = cm.getCache();
}
+ this.classLoader = classLoader;
}
/**
@@ -52,7 +54,7 @@
*/
public Cache get(String location, CacheConfiguration config) {
if (!destroyed) {
- return new JBossCache(this.cacheStore, config.getLocation());
+ return new JBossCache(this.cacheStore, config.getLocation(), this.classLoader);
}
throw new TeiidRuntimeException(IntegrationPlugin.Event.TEIID50066, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50066));
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/BaseOperationHandler.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/BaseOperationHandler.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/BaseOperationHandler.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -57,7 +57,7 @@
}
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
- if (context.getType() == OperationContext.Type.SERVER) {
+ if (context.isNormalServer()) {
context.addStep(new OperationStepHandler() {
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
@@ -69,12 +69,9 @@
context.completeStep();
}
- }, OperationContext.Stage.RUNTIME);
+ }, OperationContext.Stage.RUNTIME);
}
- else {
- context.getResult().set("no metrics available"); //$NON-NLS-1$
- }
- context.completeStep();
+ context.completeStep();
}
@SuppressWarnings("unused")
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/BufferManagerService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/BufferManagerService.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/BufferManagerService.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -27,60 +27,28 @@
import org.jboss.msc.service.StopContext;
import org.jboss.msc.value.InjectedValue;
import org.teiid.common.buffer.BufferManager;
-import org.teiid.common.buffer.TupleBufferCache;
-import org.teiid.dqp.service.BufferService;
-import org.teiid.query.ObjectReplicator;
import org.teiid.services.BufferServiceImpl;
-class BufferManagerService implements Service<BufferService>, BufferService {
-
- private BufferServiceImpl bufferService;
+class BufferManagerService extends BufferServiceImpl implements Service<BufferManager> {
+ private static final long serialVersionUID = -6797455072198476318L;
+
public final InjectedValue<String> pathInjector = new InjectedValue<String>();
- public final InjectedValue<ObjectReplicator> replicatorInjector = new InjectedValue<ObjectReplicator>();
- private BufferManager manager;
- private TupleBufferCache tupleBufferCache;
- public BufferManagerService(BufferServiceImpl buffer) {
- this.bufferService = buffer;
- }
-
@Override
public void start(StartContext context) throws StartException {
- bufferService.setDiskDirectory(pathInjector.getValue());
- bufferService.start();
- manager = bufferService.getBufferManager();
- tupleBufferCache = manager;
- if (replicatorInjector.getValue() != null) {
- try {
- //use a mux name that will not conflict with any vdb
- tupleBufferCache = this.replicatorInjector.getValue().replicate("$BM$", TupleBufferCache.class, this.manager, 0); //$NON-NLS-1$
- } catch (Exception e) {
- throw new StartException(e);
- }
- }
+ setDiskDirectory(pathInjector.getValue());
+ start();
+
}
@Override
public void stop(StopContext context) {
- bufferService.stop();
- if (this.replicatorInjector.getValue() != null) {
- this.replicatorInjector.getValue().stop(bufferService);
- }
+ stop();
}
@Override
- public BufferManager getBufferManager() {
- return manager;
+ public BufferManager getValue() throws IllegalStateException,IllegalArgumentException {
+ return getBufferManager();
}
-
- @Override
- public TupleBufferCache getTupleBufferCache() {
- return tupleBufferCache;
- }
- @Override
- public BufferService getValue() throws IllegalStateException,IllegalArgumentException {
- return this.bufferService;
- }
-
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheFactoryService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheFactoryService.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheFactoryService.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -22,6 +22,7 @@
package org.teiid.jboss;
import org.infinispan.manager.CacheContainer;
+import org.jboss.modules.Module;
import org.jboss.msc.service.Service;
import org.jboss.msc.service.StartContext;
import org.jboss.msc.service.StartException;
@@ -44,7 +45,7 @@
public void start(StartContext context) throws StartException {
CacheContainer cc = cacheContainerInjector.getValue();
if (cc != null) {
- this.cacheFactory = new JBossCacheFactory(this.cacheName, cc);
+ this.cacheFactory = new JBossCacheFactory(this.cacheName, cc, Module.getCallerModule().getClassLoader());
}
else {
this.cacheFactory = new DefaultCacheFactory();
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheService.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/CacheService.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -28,13 +28,13 @@
import org.jboss.msc.value.InjectedValue;
import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheFactory;
+import org.teiid.common.buffer.TupleBufferCache;
import org.teiid.dqp.internal.process.SessionAwareCache;
-import org.teiid.dqp.service.BufferService;
class CacheService<T> implements Service<SessionAwareCache<T>> {
private SessionAwareCache<T> cache;
- protected InjectedValue<BufferService> bufferMgrInjector = new InjectedValue<BufferService>();
+ protected InjectedValue<TupleBufferCache> tupleBufferCacheInjector = new InjectedValue<TupleBufferCache>();
protected InjectedValue<CacheFactory> cacheFactoryInjector = new InjectedValue<CacheFactory>();
private SessionAwareCache.Type type;
@@ -48,7 +48,7 @@
@Override
public void start(StartContext context) throws StartException {
this.cache = new SessionAwareCache<T>(cacheFactoryInjector.getValue(), this.type, this.config);
- this.cache.setTupleBufferCache(this.bufferMgrInjector.getValue().getTupleBufferCache());
+ this.cache.setTupleBufferCache(this.tupleBufferCacheInjector.getValue());
}
@Override
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/DQPCoreService.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -39,6 +39,7 @@
import org.jboss.msc.service.StopContext;
import org.jboss.msc.value.InjectedValue;
import org.teiid.adminapi.impl.SessionMetadata;
+import org.teiid.common.buffer.BufferManager;
import org.teiid.core.TeiidRuntimeException;
import org.teiid.core.util.LRUCache;
import org.teiid.deployers.CompositeVDB;
@@ -50,13 +51,11 @@
import org.teiid.dqp.internal.process.DQPCore;
import org.teiid.dqp.internal.process.SessionAwareCache;
import org.teiid.dqp.internal.process.TransactionServerImpl;
-import org.teiid.dqp.service.BufferService;
import org.teiid.dqp.service.TransactionService;
import org.teiid.events.EventDistributorFactory;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.logging.MessageLevel;
-import org.teiid.services.BufferServiceImpl;
import org.teiid.vdb.runtime.VDBKey;
@@ -69,7 +68,7 @@
private final InjectedValue<WorkManager> workManagerInjector = new InjectedValue<WorkManager>();
private final InjectedValue<XATerminator> xaTerminatorInjector = new InjectedValue<XATerminator>();
private final InjectedValue<TransactionManager> txnManagerInjector = new InjectedValue<TransactionManager>();
- private final InjectedValue<BufferServiceImpl> bufferServiceInjector = new InjectedValue<BufferServiceImpl>();
+ private final InjectedValue<BufferManager> bufferManagerInjector = new InjectedValue<BufferManager>();
private final InjectedValue<TranslatorRepository> translatorRepositoryInjector = new InjectedValue<TranslatorRepository>();
private final InjectedValue<VDBRepository> vdbRepositoryInjector = new InjectedValue<VDBRepository>();
private final InjectedValue<AuthorizationValidator> authorizationValidatorInjector = new InjectedValue<AuthorizationValidator>();
@@ -84,7 +83,7 @@
this.transactionServerImpl.setTransactionManager(getTxnManagerInjector().getValue());
setAuthorizationValidator(authorizationValidatorInjector.getValue());
- setBufferService(bufferServiceInjector.getValue());
+ this.dqpCore.setBufferManager(bufferManagerInjector.getValue());
this.dqpCore.setTransactionService((TransactionService)LogManager.createLoggingProxy(LogConstants.CTX_TXN_LOG, transactionServerImpl, new Class[] {TransactionService.class}, MessageLevel.DETAIL, Thread.currentThread().getContextClassLoader()));
this.dqpCore.setEventDistributor(getEventDistributorFactoryInjector().getValue().getEventDistributor());
@@ -158,10 +157,6 @@
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50002, new Date(System.currentTimeMillis()).toString()));
}
- public void setBufferService(BufferService service) {
- this.dqpCore.setBufferService(service);
- }
-
public InjectedValue<SessionAwareCache> getResultSetCacheInjector() {
return resultSetCacheInjector;
}
@@ -186,8 +181,8 @@
return authorizationValidatorInjector;
}
- public InjectedValue<BufferServiceImpl> getBufferServiceInjector() {
- return bufferServiceInjector;
+ public InjectedValue<BufferManager> getBufferManagerInjector() {
+ return bufferManagerInjector;
}
public InjectedValue<TransactionManager> getTxnManagerInjector() {
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/Element.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/Element.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/Element.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -84,7 +84,6 @@
// Object Replicator
DISTRIBUTED_CACHE("distributed-cache"),
DC_STACK_ATTRIBUTE("jgroups-stack", "distributed-cache-jgroups-stack", ModelType.STRING, false, null),
- DC_CHANNEL_NAME_ATTRIBUTE("channel", "distributed-cache-channel", ModelType.STRING, false, null),
// Result set cache
RESULTSET_CACHE_ELEMENT("resultset-cache"),
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/EventDistributorFactoryService.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -37,9 +37,8 @@
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.query.ObjectReplicator;
-import org.teiid.transport.LocalServerConnection;
-public class EventDistributorFactoryService implements Service<EventDistributorFactory>, EventDistributorFactory {
+public class EventDistributorFactoryService implements Service<EventDistributorFactory> {
InjectedValue<ObjectReplicator> objectReplicatorInjector = new InjectedValue<ObjectReplicator>();
InjectedValue<VDBRepository> vdbRepositoryInjector = new InjectedValue<VDBRepository>();
@@ -51,7 +50,7 @@
return new EventDistributorFactory() {
@Override
public EventDistributor getEventDistributor() {
- return replicatableEventDistributor;
+ return eventDistributorProxy;
}
};
}
@@ -68,7 +67,7 @@
// this instance is by use of teiid internally; only invokes the remote instances
if (objectReplicatorInjector.getValue() != null) {
try {
- this.replicatableEventDistributor = objectReplicatorInjector.getValue().replicate(LocalServerConnection.TEIID_RUNTIME_CONTEXT, EventDistributor.class, ed, 0);
+ this.replicatableEventDistributor = objectReplicatorInjector.getValue().replicate("$TEIID_ED$", EventDistributor.class, ed, 0); //$NON-NLS-1$
} catch (Exception e) {
LogManager.logError(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50004, this));
}
@@ -99,9 +98,4 @@
this.replicatableEventDistributor = null;
}
}
-
- @Override
- public org.teiid.events.EventDistributor getEventDistributor() {
- return eventDistributorProxy;
- }
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossSessionService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossSessionService.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/JBossSessionService.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -35,7 +35,6 @@
import org.jboss.security.SimplePrincipal;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
-import org.teiid.runtime.RuntimePlugin;
import org.teiid.security.Credentials;
import org.teiid.services.SessionServiceImpl;
import org.teiid.services.TeiidLoginContext;
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/JGroupsObjectReplicatorService.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -34,11 +34,6 @@
public final InjectedValue<ChannelFactory> channelFactoryInjector = new InjectedValue<ChannelFactory>();
private JGroupsObjectReplicator replicator;
- /**
- * @param clusterName TODO see if this is still useful
- */
- public JGroupsObjectReplicatorService(String clusterName){
- }
@Override
public void start(StartContext context) throws StartException {
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidAdd.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -44,6 +44,7 @@
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.controller.ServiceVerificationHandler;
import org.jboss.as.controller.descriptions.DescriptionProvider;
+import org.jboss.as.controller.services.path.RelativePathService;
import org.jboss.as.naming.ManagedReferenceFactory;
import org.jboss.as.naming.ServiceBasedNamingStore;
import org.jboss.as.naming.deployment.ContextNames;
@@ -51,7 +52,6 @@
import org.jboss.as.server.AbstractDeploymentChainStep;
import org.jboss.as.server.DeploymentProcessorTarget;
import org.jboss.as.server.deployment.Phase;
-import org.jboss.as.server.services.path.RelativePathService;
import org.jboss.dmr.ModelNode;
import org.jboss.modules.Module;
import org.jboss.modules.ModuleIdentifier;
@@ -68,6 +68,8 @@
import org.teiid.cache.CacheConfiguration;
import org.teiid.cache.CacheConfiguration.Policy;
import org.teiid.cache.CacheFactory;
+import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.TupleBufferCache;
import org.teiid.deployers.SystemVDBDeployer;
import org.teiid.deployers.VDBRepository;
import org.teiid.deployers.VDBStatusChecker;
@@ -79,14 +81,12 @@
import org.teiid.dqp.internal.process.DefaultAuthorizationValidator;
import org.teiid.dqp.internal.process.PreparedPlan;
import org.teiid.dqp.internal.process.SessionAwareCache;
-import org.teiid.dqp.service.BufferService;
import org.teiid.events.EventDistributorFactory;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.query.ObjectReplicator;
import org.teiid.query.function.SystemFunctionManager;
import org.teiid.replication.jboss.JGroupsObjectReplicator;
-import org.teiid.services.BufferServiceImpl;
class TeiidAdd extends AbstractAddStepHandler implements DescriptionProvider {
@@ -110,7 +110,6 @@
// object replicator
Element.DC_STACK_ATTRIBUTE,
- Element.DC_CHANNEL_NAME_ATTRIBUTE,
// Buffer Service
Element.USE_DISK_ATTRIBUTE,
@@ -250,13 +249,8 @@
if (Element.DC_STACK_ATTRIBUTE.isDefined(operation)) {
String stack = Element.DC_STACK_ATTRIBUTE.asString(operation);
- String clusterName = "teiid-rep"; //$NON-NLS-1$
- if (Element.DC_CHANNEL_NAME_ATTRIBUTE.isDefined(operation)) {
- clusterName = Element.DC_CHANNEL_NAME_ATTRIBUTE.asString(operation);
- }
-
replicatorAvailable = true;
- JGroupsObjectReplicatorService replicatorService = new JGroupsObjectReplicatorService(clusterName);
+ JGroupsObjectReplicatorService replicatorService = new JGroupsObjectReplicatorService();
ServiceBuilder<JGroupsObjectReplicator> serviceBuilder = target.addService(TeiidServiceNames.OBJECT_REPLICATOR, replicatorService);
serviceBuilder.addDependency(ServiceName.JBOSS.append("jgroups", "stack", stack), ChannelFactory.class, replicatorService.channelFactoryInjector); //$NON-NLS-1$ //$NON-NLS-2$
newControllers.add(serviceBuilder.install());
@@ -264,12 +258,18 @@
// TODO: remove verbose service by moving the buffer service from runtime project
newControllers.add(RelativePathService.addService(TeiidServiceNames.BUFFER_DIR, "teiid-buffer", "jboss.server.temp.dir", target)); //$NON-NLS-1$ //$NON-NLS-2$
- BufferManagerService bufferService = new BufferManagerService(buildBufferManager(operation));
- ServiceBuilder<BufferService> bufferServiceBuilder = target.addService(TeiidServiceNames.BUFFER_MGR, bufferService);
+ BufferManagerService bufferService = buildBufferManager(operation);
+ ServiceBuilder<BufferManager> bufferServiceBuilder = target.addService(TeiidServiceNames.BUFFER_MGR, bufferService);
bufferServiceBuilder.addDependency(TeiidServiceNames.BUFFER_DIR, String.class, bufferService.pathInjector);
- bufferServiceBuilder.addDependency(replicatorAvailable?DependencyType.REQUIRED:DependencyType.OPTIONAL, TeiidServiceNames.OBJECT_REPLICATOR, ObjectReplicator.class, bufferService.replicatorInjector);
newControllers.add(bufferServiceBuilder.install());
+ TupleBufferCacheService tupleBufferService = new TupleBufferCacheService();
+ ServiceBuilder<TupleBufferCache> tupleBufferBuilder = target.addService(TeiidServiceNames.TUPLE_BUFFER, tupleBufferService);
+ tupleBufferBuilder.addDependency(TeiidServiceNames.BUFFER_MGR, BufferManager.class, tupleBufferService.bufferMgrInjector);
+ tupleBufferBuilder.addDependency(replicatorAvailable?DependencyType.REQUIRED:DependencyType.OPTIONAL, TeiidServiceNames.OBJECT_REPLICATOR, ObjectReplicator.class, tupleBufferService.replicatorInjector);
+ newControllers.add(tupleBufferBuilder.install());
+
+
EventDistributorFactoryService edfs = new EventDistributorFactoryService();
ServiceBuilder<EventDistributorFactory> edfsServiceBuilder = target.addService(TeiidServiceNames.EVENT_DISTRIBUTOR_FACTORY, edfs);
edfsServiceBuilder.addDependency(TeiidServiceNames.VDB_REPO, VDBRepository.class, edfs.vdbRepositoryInjector);
@@ -336,7 +336,7 @@
CacheService<CachedResults> resultSetService = new CacheService<CachedResults>(SessionAwareCache.Type.RESULTSET, buildCacheConfig(operation));
ServiceBuilder<SessionAwareCache<CachedResults>> resultsCacheBuilder = target.addService(TeiidServiceNames.CACHE_RESULTSET, resultSetService);
- resultsCacheBuilder.addDependency(TeiidServiceNames.BUFFER_MGR, BufferService.class, resultSetService.bufferMgrInjector);
+ resultsCacheBuilder.addDependency(TeiidServiceNames.TUPLE_BUFFER, TupleBufferCache.class, resultSetService.tupleBufferCacheInjector);
resultsCacheBuilder.addDependency(cfName, CacheFactory.class, resultSetService.cacheFactoryInjector);
newControllers.add(resultsCacheBuilder.install());
}
@@ -345,7 +345,7 @@
// prepared plan cache, as it is always local)
CacheService<PreparedPlan> preparedPlanService = new PreparedPlanCacheService(SessionAwareCache.Type.PREPAREDPLAN, buildPreparedPlanCacheConfig(operation));
ServiceBuilder<SessionAwareCache<PreparedPlan>> preparedPlanCacheBuilder = target.addService(TeiidServiceNames.CACHE_PREPAREDPLAN, preparedPlanService);
- preparedPlanCacheBuilder.addDependency(TeiidServiceNames.BUFFER_MGR, BufferService.class, preparedPlanService.bufferMgrInjector);
+ preparedPlanCacheBuilder.addDependency(TeiidServiceNames.TUPLE_BUFFER, TupleBufferCache.class, preparedPlanService.tupleBufferCacheInjector);
newControllers.add(preparedPlanCacheBuilder.install());
// Query Engine
@@ -359,7 +359,7 @@
engineBuilder.addDependency(ServiceName.JBOSS.append("connector", "workmanager", workManager), WorkManager.class, engine.getWorkManagerInjector()); //$NON-NLS-1$ //$NON-NLS-2$
engineBuilder.addDependency(ServiceName.JBOSS.append("txn", "XATerminator"), XATerminator.class, engine.getXaTerminatorInjector()); //$NON-NLS-1$ //$NON-NLS-2$
engineBuilder.addDependency(ServiceName.JBOSS.append("txn", "TransactionManager"), TransactionManager.class, engine.getTxnManagerInjector()); //$NON-NLS-1$ //$NON-NLS-2$
- engineBuilder.addDependency(TeiidServiceNames.BUFFER_MGR, BufferServiceImpl.class, engine.getBufferServiceInjector());
+ engineBuilder.addDependency(TeiidServiceNames.BUFFER_MGR, BufferManager.class, engine.getBufferManagerInjector());
engineBuilder.addDependency(TeiidServiceNames.SYSTEM_VDB, SystemVDBDeployer.class, new InjectedValue<SystemVDBDeployer>());
engineBuilder.addDependency(TeiidServiceNames.TRANSLATOR_REPO, TranslatorRepository.class, engine.getTranslatorRepositoryInjector());
engineBuilder.addDependency(TeiidServiceNames.VDB_REPO, VDBRepository.class, engine.getVdbRepositoryInjector());
@@ -421,15 +421,15 @@
moduleId = ModuleIdentifier.create(moduleName);
module = Module.getCallerModuleLoader().loadModule(moduleId);
} catch (ModuleLoadException e) {
- throw new OperationFailedException(e, new ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50069, moduleName))); //$NON-NLS-1$
+ throw new OperationFailedException(e, new ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50069, moduleName)));
}
ServiceLoader<T> services = module.loadService(type);
return services.iterator().next();
}
- private BufferServiceImpl buildBufferManager(ModelNode node) {
- BufferServiceImpl bufferManger = new BufferServiceImpl();
+ private BufferManagerService buildBufferManager(ModelNode node) {
+ BufferManagerService bufferManger = new BufferManagerService();
if (node == null) {
return bufferManger;
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidExtension.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -49,6 +49,9 @@
private static final String RUNTIME_VERSION = "runtime-version"; //$NON-NLS-1$
public static final String TEIID_SUBSYSTEM = "teiid"; //$NON-NLS-1$
+ public static final int MAJOR_VERSION = 1;
+ public static final int MINOR_VERSION = 0;
+
private static TeiidSubsystemParser parser = new TeiidSubsystemParser();
private static TransportAdd TRANSPORT_ADD = new TransportAdd();
private static TransportRemove TRANSPORT_REMOVE = new TransportRemove();
@@ -59,7 +62,7 @@
@Override
public void initialize(ExtensionContext context) {
- final SubsystemRegistration registration = context.registerSubsystem(TEIID_SUBSYSTEM);
+ final SubsystemRegistration registration = context.registerSubsystem(TEIID_SUBSYSTEM, MAJOR_VERSION, MINOR_VERSION);
LogManager.setLogListener(new JBossLogger());
@@ -150,6 +153,6 @@
@Override
public void initializeParsers(ExtensionParsingContext context) {
- context.setSubsystemXmlMapping(Namespace.CURRENT.getUri(), parser);
+ context.setSubsystemXmlMapping(TEIID_SUBSYSTEM, Namespace.CURRENT.getUri(), parser);
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidServiceNames.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidServiceNames.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidServiceNames.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -33,6 +33,7 @@
public static ServiceName BUFFER_DIR = ServiceName.JBOSS.append("teiid", "buffer.dir");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName DATA_DIR = ServiceName.JBOSS.append("teiid", "data.dir");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName BUFFER_MGR = ServiceName.JBOSS.append("teiid", "buffer-mgr");//$NON-NLS-1$ //$NON-NLS-2$
+ public static ServiceName TUPLE_BUFFER = ServiceName.JBOSS.append("teiid", "tuple_buffer");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName SYSTEM_VDB = ServiceName.JBOSS.append("teiid", "system.vdb");//$NON-NLS-1$ //$NON-NLS-2$
public static ServiceName AUTHORIZATION_VALIDATOR = ServiceName.JBOSS.append("teiid", "authorization-validator");//$NON-NLS-1$ //$NON-NLS-2$
private static ServiceName VDB_SVC_BASE = ServiceName.JBOSS.append("teiid", "vdb"); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidSubsystemParser.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -124,7 +124,6 @@
private void writeObjectReplicatorConfiguration(XMLExtendedStreamWriter writer, ModelNode node) throws XMLStreamException {
writeAttribute(writer, Element.DC_STACK_ATTRIBUTE, node);
- writeAttribute(writer, Element.DC_CHANNEL_NAME_ATTRIBUTE, node);
}
private void writeTranslator(XMLExtendedStreamWriter writer, ModelNode node, String translatorName) throws XMLStreamException {
@@ -374,9 +373,6 @@
case DC_STACK_ATTRIBUTE:
node.get(element.getModelName()).set(attrValue);
break;
- case DC_CHANNEL_NAME_ATTRIBUTE:
- node.get(element.getModelName()).set(attrValue);
- break;
default:
throw ParseUtils.unexpectedAttribute(reader, i);
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TranslatorAdd.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -129,7 +129,7 @@
}
if (!added) {
- throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50009, translatorName, moduleName))); //$NON-NLS-1$
+ throw new OperationFailedException(new ModelNode().set(IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50009, translatorName, moduleName)));
}
}
}
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportAdd.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -21,7 +21,11 @@
*/
package org.teiid.jboss;
-import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.*;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.ADD;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.DESCRIPTION;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OPERATION_NAME;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.OP_ADDR;
+import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.REQUEST_PROPERTIES;
import java.util.Arrays;
import java.util.Collections;
@@ -50,12 +54,12 @@
import org.jboss.msc.service.ServiceController;
import org.jboss.msc.service.ServiceName;
import org.jboss.msc.service.ServiceTarget;
+import org.teiid.common.buffer.BufferManager;
import org.teiid.deployers.VDBRepository;
import org.teiid.dqp.internal.process.DQPCore;
import org.teiid.logging.LogConstants;
import org.teiid.logging.LogManager;
import org.teiid.net.socket.AuthenticationType;
-import org.teiid.services.BufferServiceImpl;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.LocalServerConnection;
import org.teiid.transport.SSLConfiguration;
@@ -176,7 +180,7 @@
if (socketBinding != null) {
transportBuilder.addDependency(ServiceName.JBOSS.append("binding", socketBinding), SocketBinding.class, transport.getSocketBindingInjector()); //$NON-NLS-1$
}
- transportBuilder.addDependency(TeiidServiceNames.BUFFER_MGR, BufferServiceImpl.class, transport.getBufferServiceInjector());
+ transportBuilder.addDependency(TeiidServiceNames.BUFFER_MGR, BufferManager.class, transport.getBufferManagerInjector());
transportBuilder.addDependency(TeiidServiceNames.VDB_REPO, VDBRepository.class, transport.getVdbRepositoryInjector());
transportBuilder.addDependency(TeiidServiceNames.ENGINE, DQPCore.class, transport.getDqpInjector());
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TransportService.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -46,6 +46,7 @@
import org.teiid.client.DQP;
import org.teiid.client.security.ILogon;
import org.teiid.client.util.ExceptionUtil;
+import org.teiid.common.buffer.BufferManager;
import org.teiid.core.ComponentNotFoundException;
import org.teiid.deployers.VDBRepository;
import org.teiid.dqp.internal.process.DQPCore;
@@ -56,7 +57,6 @@
import org.teiid.logging.MessageLevel;
import org.teiid.net.socket.AuthenticationType;
import org.teiid.security.SecurityHelper;
-import org.teiid.services.BufferServiceImpl;
import org.teiid.services.SessionServiceImpl;
import org.teiid.transport.ClientServiceRegistry;
import org.teiid.transport.ClientServiceRegistryImpl;
@@ -86,7 +86,7 @@
private final InjectedValue<SocketBinding> socketBindingInjector = new InjectedValue<SocketBinding>();
private final InjectedValue<VDBRepository> vdbRepositoryInjector = new InjectedValue<VDBRepository>();
private final InjectedValue<DQPCore> dqpInjector = new InjectedValue<DQPCore>();
- private final InjectedValue<BufferServiceImpl> bufferServiceInjector = new InjectedValue<BufferServiceImpl>();
+ private final InjectedValue<BufferManager> bufferManagerInjector = new InjectedValue<BufferManager>();
@Override
public <T> T getClientService(Class<T> iface) throws ComponentNotFoundException {
@@ -131,12 +131,12 @@
sslEnabled = this.socketConfig.getSSLConfiguration().isSslEnabled();
}
if (protocol == Protocol.teiid) {
- this.socketListener = new SocketListener(address, this.socketConfig, this.csr, getBufferServiceInjector().getValue().getBufferManager());
+ this.socketListener = new SocketListener(address, this.socketConfig, this.csr, getBufferManagerInjector().getValue());
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50012, address.getHostName(), String.valueOf(address.getPort()), (sslEnabled?"ON":"OFF"), authenticationDomains)); //$NON-NLS-1$ //$NON-NLS-2$
}
else if (protocol == Protocol.pg) {
getVdbRepository().odbcEnabled();
- ODBCSocketListener odbc = new ODBCSocketListener(address, this.socketConfig, this.csr, getBufferServiceInjector().getValue().getBufferManager(), getMaxODBCLobSizeAllowed(), this.logon);
+ ODBCSocketListener odbc = new ODBCSocketListener(address, this.socketConfig, this.csr, getBufferManagerInjector().getValue(), getMaxODBCLobSizeAllowed(), this.logon);
odbc.setAuthenticationType(this.sessionService.getAuthenticationType());
LogManager.logInfo(LogConstants.CTX_RUNTIME, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50037, address.getHostName(), String.valueOf(address.getPort()), (sslEnabled?"ON":"OFF"), authenticationDomains)); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -277,8 +277,8 @@
return dqpInjector;
}
- public InjectedValue<BufferServiceImpl> getBufferServiceInjector() {
- return bufferServiceInjector;
+ public InjectedValue<BufferManager> getBufferManagerInjector() {
+ return bufferManagerInjector;
}
private int getMaxODBCLobSizeAllowed() {
Added: trunk/jboss-integration/src/main/java/org/teiid/jboss/TupleBufferCacheService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TupleBufferCacheService.java (rev 0)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TupleBufferCacheService.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -0,0 +1,65 @@
+/*
+ * 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.jboss;
+
+import org.jboss.msc.service.Service;
+import org.jboss.msc.service.StartContext;
+import org.jboss.msc.service.StartException;
+import org.jboss.msc.service.StopContext;
+import org.jboss.msc.value.InjectedValue;
+import org.teiid.common.buffer.BufferManager;
+import org.teiid.common.buffer.TupleBufferCache;
+import org.teiid.query.ObjectReplicator;
+
+class TupleBufferCacheService implements Service<TupleBufferCache>{
+ public final InjectedValue<ObjectReplicator> replicatorInjector = new InjectedValue<ObjectReplicator>();
+ protected InjectedValue<BufferManager> bufferMgrInjector = new InjectedValue<BufferManager>();
+
+ private TupleBufferCache tupleBufferCache;
+
+ @Override
+ public void start(StartContext context) throws StartException {
+ if (this.replicatorInjector.getValue() != null) {
+ try {
+ //use a mux name that will not conflict with any vdb
+ this.tupleBufferCache = this.replicatorInjector.getValue().replicate("$TEIID_BM$", TupleBufferCache.class, bufferMgrInjector.getValue(), 0); //$NON-NLS-1$
+ } catch (Exception e) {
+ throw new StartException(e);
+ }
+ }
+ }
+
+ @Override
+ public void stop(StopContext context) {
+ if (this.replicatorInjector.getValue() != null && this.tupleBufferCache != null) {
+ this.replicatorInjector.getValue().stop(this.tupleBufferCache);
+ }
+ }
+
+ @Override
+ public TupleBufferCache getValue() throws IllegalStateException, IllegalArgumentException {
+ if (this.tupleBufferCache!= null) {
+ return tupleBufferCache;
+ }
+ return bufferMgrInjector.getValue();
+ }
+}
Property changes on: trunk/jboss-integration/src/main/java/org/teiid/jboss/TupleBufferCacheService.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBDeployer.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -52,6 +52,7 @@
import org.teiid.adminapi.impl.ModelMetaData;
import org.teiid.adminapi.impl.VDBMetaData;
import org.teiid.adminapi.impl.VDBTranslatorMetaData;
+import org.teiid.common.buffer.BufferManager;
import org.teiid.deployers.UDFMetaData;
import org.teiid.deployers.VDBRepository;
import org.teiid.deployers.VDBStatusChecker;
@@ -64,7 +65,6 @@
import org.teiid.query.ObjectReplicator;
import org.teiid.query.metadata.DDLMetadataRepository;
import org.teiid.query.metadata.NativeMetadataRepository;
-import org.teiid.services.BufferServiceImpl;
class VDBDeployer implements DeploymentUnitProcessor {
@@ -175,7 +175,7 @@
vdbService.addDependency(TeiidServiceNames.TRANSLATOR_REPO, TranslatorRepository.class, vdb.getTranslatorRepositoryInjector());
vdbService.addDependency(TeiidServiceNames.executorServiceName(this.asyncThreadPoolName), Executor.class, vdb.getExecutorInjector());
vdbService.addDependency(TeiidServiceNames.OBJECT_SERIALIZER, ObjectSerializer.class, vdb.getSerializerInjector());
- vdbService.addDependency(TeiidServiceNames.BUFFER_MGR, BufferServiceImpl.class, vdb.getBufferServiceInjector());
+ vdbService.addDependency(TeiidServiceNames.BUFFER_MGR, BufferManager.class, vdb.getBufferManagerInjector());
vdbService.addDependency(DependencyType.OPTIONAL, TeiidServiceNames.OBJECT_REPLICATOR, ObjectReplicator.class, vdb.getObjectReplicatorInjector());
vdbService.setInitialMode(Mode.PASSIVE).install();
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/VDBService.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -74,7 +74,6 @@
import org.teiid.query.tempdata.GlobalTableStore;
import org.teiid.query.tempdata.GlobalTableStoreImpl;
import org.teiid.runtime.RuntimePlugin;
-import org.teiid.services.BufferServiceImpl;
import org.teiid.translator.DelegatingExecutionFactory;
import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.TranslatorException;
@@ -85,7 +84,7 @@
private final InjectedValue<TranslatorRepository> translatorRepositoryInjector = new InjectedValue<TranslatorRepository>();
private final InjectedValue<Executor> executorInjector = new InjectedValue<Executor>();
private final InjectedValue<ObjectSerializer> serializerInjector = new InjectedValue<ObjectSerializer>();
- private final InjectedValue<BufferServiceImpl> bufferServiceInjector = new InjectedValue<BufferServiceImpl>();
+ private final InjectedValue<BufferManager> bufferManagerInjector = new InjectedValue<BufferManager>();
private final InjectedValue<ObjectReplicator> objectReplicatorInjector = new InjectedValue<ObjectReplicator>();
private VDBLifeCycleListener vdbListener;
@@ -133,17 +132,20 @@
}
@Override
- public void finishedDeployment(String name, int version,CompositeVDB vdb) {
+ public void finishedDeployment(String name, int version, CompositeVDB vdb) {
+ if (!name.equals(VDBService.this.vdb.getName()) || version != VDBService.this.vdb.getVersion()) {
+ return;
+ }
// add object replication to temp/matview tables
GlobalTableStore gts = new GlobalTableStoreImpl(getBuffermanager(), vdb.getVDB().getAttachment(TransformationMetadata.class));
if (getObjectReplicatorInjector().getValue() != null) {
try {
gts = getObjectReplicatorInjector().getValue().replicate(name + version, GlobalTableStore.class, gts, 300000);
+ vdb.getVDB().addAttchment(GlobalTableStore.class, gts);
} catch (Exception e) {
LogManager.logError(LogConstants.CTX_RUNTIME, e, IntegrationPlugin.Util.gs(IntegrationPlugin.Event.TEIID50023, gts));
}
}
- vdb.getVDB().addAttchment(GlobalTableStore.class, gts);
}
};
@@ -432,12 +434,12 @@
return serializerInjector.getValue();
}
- public InjectedValue<BufferServiceImpl> getBufferServiceInjector() {
- return bufferServiceInjector;
+ public InjectedValue<BufferManager> getBufferManagerInjector() {
+ return bufferManagerInjector;
}
private BufferManager getBuffermanager() {
- return getBufferServiceInjector().getValue().getBufferManager();
+ return getBufferManagerInjector().getValue();
}
public InjectedValue<ObjectReplicator> getObjectReplicatorInjector() {
Modified: trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/java/org/teiid/replication/jboss/JGroupsObjectReplicator.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -40,6 +40,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
@@ -506,19 +507,24 @@
public <T, S> T replicate(String mux_id,
Class<T> iface, final S object, long startTimeout) throws Exception {
Channel channel = channelFactory.createChannel(mux_id);
- Method[] methods = iface.getMethods();
- final HashMap<Method, Short> methodMap = new HashMap<Method, Short>();
- final ArrayList<Method> methodList = new ArrayList<Method>();
-
- for (Method method : methods) {
+ // To keep the order of methods same at all the nodes.
+ TreeMap<String, Method> methods = new TreeMap<String, Method>();
+ for (Method method : iface.getMethods()) {
if (method.getAnnotation(Replicated.class) == null) {
continue;
}
- methodList.add(method);
- methodMap.put(method, (short)(methodList.size() - 1));
+ methods.put(method.toGenericString(), method);
}
+ final HashMap<Method, Short> methodMap = new HashMap<Method, Short>();
+ final ArrayList<Method> methodList = new ArrayList<Method>();
+
+ for (String method : methods.keySet()) {
+ methodList.add(methods.get(method));
+ methodMap.put(methods.get(method), (short)(methodList.size() - 1));
+ }
+
Method hasState = ReplicatedObject.class.getMethod(HAS_STATE, new Class<?>[] {Serializable.class});
methodList.add(hasState);
methodMap.put(hasState, (short)(methodList.size() - 1));
@@ -543,8 +549,7 @@
* TODO: could have an object implement streaming
* Override the normal handle method to support streaming
*/
- ReplicatorRpcDispatcher disp = new ReplicatorRpcDispatcher<S>(channel, proxy, proxy, object,
- object, methodMap, methodList);
+ ReplicatorRpcDispatcher disp = new ReplicatorRpcDispatcher<S>(channel, proxy, proxy, object, object, methodMap, methodList);
proxy.setDisp(disp);
disp.setMethodLookup(new MethodLookup() {
Modified: trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties
===================================================================
--- trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/resources/org/teiid/jboss/i18n.properties 2012-03-30 23:04:00 UTC (rev 3959)
@@ -136,7 +136,6 @@
#object replicator
distributed-cache-jgroups-stack.describe=JGroups stack name for cache replication channel
-distributed-cache-channel.describe=Cache channel name to use for cache entries replication
#transport
transport-name.describe=Name of the transport
Modified: trunk/jboss-integration/src/main/resources/schema/jboss-teiid.xsd
===================================================================
--- trunk/jboss-integration/src/main/resources/schema/jboss-teiid.xsd 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/main/resources/schema/jboss-teiid.xsd 2012-03-30 23:04:00 UTC (rev 3959)
@@ -239,7 +239,6 @@
</xs:annotation>
<xs:complexType>
<xs:attribute name="jgroups-stack" type="xs:string" use="required"/>
- <xs:attribute name="channel" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
Modified: trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java
===================================================================
--- trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/test/java/org/teiid/jboss/TestTeiidConfiguration.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -31,7 +31,6 @@
import junit.framework.Assert;
import org.jboss.as.cli.Util;
-import org.jboss.as.controller.OperationContext.Type;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.PathElement;
import org.jboss.as.subsystem.test.AbstractSubsystemTest;
@@ -54,14 +53,7 @@
@Test
public void testDescribeHandler() throws Exception {
String subsystemXml = ObjectConverterUtil.convertToString(new FileReader("src/test/resources/teiid-sample-config.xml"));
- KernelServices servicesA = super.installInController(
- new AdditionalInitialization() {
- @Override
- protected Type getType() {
- return Type.MANAGEMENT;
- }
- },
- subsystemXml);
+ KernelServices servicesA = super.installInController(AdditionalInitialization.MANAGEMENT,subsystemXml);
//Get the model and the describe operations from the first controller
@@ -99,14 +91,7 @@
ModelNode testModel = ModelNode.fromJSONString(json);
String triggered = outputModel(testModel);
- KernelServices services = super.installInController(
- new AdditionalInitialization() {
- @Override
- protected Type getType() {
- return Type.MANAGEMENT;
- }
- },
- subsystemXml);
+ KernelServices services = super.installInController(AdditionalInitialization.MANAGEMENT,subsystemXml);
//Get the model and the persisted xml from the controller
ModelNode model = services.readWholeModel();
String marshalled = services.getPersistedSubsystemXml();
@@ -125,14 +110,7 @@
ModelNode testModel = ModelNode.fromJSONString(json);
String triggered = outputModel(testModel);
- KernelServices services = super.installInController(
- new AdditionalInitialization() {
- @Override
- protected Type getType() {
- return Type.MANAGEMENT;
- }
- },
- subsystemXml);
+ KernelServices services = super.installInController(AdditionalInitialization.MANAGEMENT,subsystemXml);
//Get the model and the persisted xml from the controller
ModelNode model = services.readWholeModel();
String marshalled = services.getPersistedSubsystemXml();
@@ -146,14 +124,8 @@
String subsystemXml = ObjectConverterUtil.convertToString(new FileReader("src/test/resources/teiid-sample-config.xml"));
validate(subsystemXml);
- KernelServices services = super.installInController(
- new AdditionalInitialization() {
- @Override
- protected Type getType() {
- return Type.MANAGEMENT;
- }
- },
- subsystemXml);
+ KernelServices services = super.installInController(AdditionalInitialization.MANAGEMENT,subsystemXml);
+ ;
//Get the model and the persisted xml from the controller
ModelNode model = services.readWholeModel();
String marshalled = services.getPersistedSubsystemXml();
Modified: trunk/jboss-integration/src/test/resources/teiid-model-config.txt
===================================================================
--- trunk/jboss-integration/src/test/resources/teiid-model-config.txt 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/test/resources/teiid-model-config.txt 2012-03-30 23:04:00 UTC (rev 3959)
@@ -97,11 +97,6 @@
"description" => "JGroups stack name for cache replication channel",
"required" => false
},
- "distributed-cache-channel" => {
- "type" => STRING,
- "description" => "Cache channel name to use for cache entries replication",
- "required" => false
- },
"buffer-service-use-disk" => {
"type" => BOOLEAN,
"description" => "Use disk for buffer management",
Modified: trunk/jboss-integration/src/test/resources/teiid-model-json.txt
===================================================================
--- trunk/jboss-integration/src/test/resources/teiid-model-json.txt 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/test/resources/teiid-model-json.txt 2012-03-30 23:04:00 UTC (rev 3959)
@@ -22,7 +22,6 @@
"max-row-fetch-size" : 20480,
"max-source-rows-allowed" : -1,
"max-threads" : 64,
- "distributed-cache-channel" : "cluster",
"distributed-cache-jgroups-stack" : "stack",
"preparedplan-cache-max-age-in-seconds" : 28800,
"preparedplan-cache-max-entries" : 512,
Modified: trunk/jboss-integration/src/test/resources/teiid-sample-config.xml
===================================================================
--- trunk/jboss-integration/src/test/resources/teiid-sample-config.xml 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/jboss-integration/src/test/resources/teiid-sample-config.xml 2012-03-30 23:04:00 UTC (rev 3959)
@@ -28,7 +28,7 @@
<preparedplan-cache max-entries="512" max-age-in-seconds="28800"/>
- <distributed-cache jgroups-stack="stack" channel="cluster"/>
+ <distributed-cache jgroups-stack="stack"/>
<transport name="jdbc" protocol="teiid" socket-binding="teiid-jdbc" max-socket-threads="1" input-buffer-size="2" output-buffer-size="3"/>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/pom.xml 2012-03-30 23:04:00 UTC (rev 3959)
@@ -15,7 +15,7 @@
<properties>
<ant.version>1.7.0</ant.version>
<site.url>http://www.jboss.org/teiid</site.url>
- <jbossas-version>7.1.0.Final</jbossas-version>
+ <jbossas-version>7.1.1.Final</jbossas-version>
<version.org.jboss.common-core>2.2.17.GA</version.org.jboss.common-core>
<version.org.jboss.staxmapper>1.1.0.Final</version.org.jboss.staxmapper>
<version.org.jboss.jboss-dmr>1.1.1.Final</version.org.jboss.jboss-dmr>
@@ -30,10 +30,10 @@
<version.org.jboss.netty>3.2.6.Final</version.org.jboss.netty>
<version.net.sourceforge.saxon>9.2.1.5</version.net.sourceforge.saxon>
<version.json-simple>1.1</version.json-simple>
- <version.org.jgroups>3.0.5.Final</version.org.jgroups>
+ <version.org.jgroups>3.0.8.Final</version.org.jgroups>
<version.connector-api>1.5</version.connector-api>
<version.jta>1.1</version.jta>
- <version.sun.jaxb>2.2</version.sun.jaxb>
+ <version.sun.jaxb>2.2.4</version.sun.jaxb>
<version.junit>4.10</version.junit>
</properties>
<scm>
Modified: trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/runtime/src/main/java/org/teiid/deployers/VDBStatusChecker.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -89,7 +89,7 @@
boolean dsReplaced = false;
if (!cm.getConnectionName().equals(dsName)){
vdb.setStatus(VDB.Status.INACTIVE);
- String msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40076, vdb.getName(), vdb.getVersion(), model.getSourceTranslatorName(sourceName), dsName); //$NON-NLS-1$
+ String msg = RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40076, vdb.getName(), vdb.getVersion(), model.getSourceTranslatorName(sourceName), dsName);
model.addError(ModelMetaData.ValidationError.Severity.ERROR.name(), msg);
cm = new ConnectorManager(translatorName, dsName);
cm.setExecutionFactory(ef);
@@ -172,7 +172,7 @@
if (!runnables.isEmpty()) {
//the task themselves will set the status on completion/failure
- for (Runnable runnable : runnables) {
+ for (Runnable runnable : runnables) {
getExecutor().execute(runnable);
}
} else if (valid) {
Modified: trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2012-03-30 04:57:26 UTC (rev 3958)
+++ trunk/test-integration/common/src/test/java/org/teiid/jdbc/FakeServer.java 2012-03-30 23:04:00 UTC (rev 3959)
@@ -287,7 +287,7 @@
throw new TeiidRuntimeException(e);
}
}
- this.dqp.setBufferService(bs);
+ this.dqp.setBufferManager(bs.getBufferManager());
//TODO: wire in an infinispan cluster rather than this dummy replicated cache
DefaultCacheFactory dcf = new DefaultCacheFactory() {
12 years, 9 months
teiid SVN: r3957 - in branches/7.7.x/engine/src: test/java/org/teiid/dqp/internal/datamgr and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-03-29 12:17:15 -0400 (Thu, 29 Mar 2012)
New Revision: 3957
Modified:
branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/LanguageBridgeFactory.java
branches/7.7.x/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestInCriteriaImpl.java
Log:
TEIID-1966 adding support for expanding in pushdown
Modified: branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2012-03-29 01:43:03 UTC (rev 3956)
+++ branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/CapabilitiesConverter.java 2012-03-29 16:17:15 UTC (rev 3957)
@@ -63,7 +63,7 @@
tgtCaps.setCapabilitySupport(Capability.CRITERIA_COMPARE_ORDERED, srcCaps.supportsCompareCriteriaOrdered());
tgtCaps.setCapabilitySupport(Capability.CRITERIA_LIKE, srcCaps.supportsLikeCriteria());
setSupports(connectorID, tgtCaps, Capability.CRITERIA_LIKE_ESCAPE, srcCaps.supportsLikeCriteriaEscapeCharacter(), Capability.CRITERIA_LIKE);
- tgtCaps.setCapabilitySupport(Capability.CRITERIA_IN, srcCaps.supportsInCriteria());
+ tgtCaps.setCapabilitySupport(Capability.CRITERIA_IN, srcCaps.supportsInCriteria() || (srcCaps.supportsCompareCriteriaEquals() && srcCaps.supportsOrCriteria()));
tgtCaps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, srcCaps.supportsInCriteriaSubquery());
tgtCaps.setCapabilitySupport(Capability.CRITERIA_ISNULL, srcCaps.supportsIsNullCriteria());
tgtCaps.setCapabilitySupport(Capability.CRITERIA_OR, srcCaps.supportsOrCriteria());
Modified: branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2012-03-29 01:43:03 UTC (rev 3956)
+++ branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/ConnectorWorkItem.java 2012-03-29 16:17:15 UTC (rev 3957)
@@ -219,6 +219,7 @@
Command command = this.requestMsg.getCommand();
this.expectedColumns = command.getProjectedSymbols().size();
LanguageBridgeFactory factory = new LanguageBridgeFactory(queryMetadata);
+ factory.setConvertIn(!this.connector.supportsInCriteria());
this.translatedCommand = factory.translate(command);
RuntimeMetadata rmd = new RuntimeMetadataImpl(queryMetadata);
Modified: branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/LanguageBridgeFactory.java
===================================================================
--- branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/LanguageBridgeFactory.java 2012-03-29 01:43:03 UTC (rev 3956)
+++ branches/7.7.x/engine/src/main/java/org/teiid/dqp/internal/datamgr/LanguageBridgeFactory.java 2012-03-29 16:17:15 UTC (rev 3957)
@@ -35,37 +35,10 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidException;
import org.teiid.core.TeiidRuntimeException;
-import org.teiid.language.AggregateFunction;
-import org.teiid.language.AndOr;
-import org.teiid.language.Argument;
-import org.teiid.language.BatchedUpdates;
-import org.teiid.language.Call;
-import org.teiid.language.ColumnReference;
-import org.teiid.language.Condition;
+import org.teiid.language.*;
import org.teiid.language.DerivedColumn;
-import org.teiid.language.DerivedTable;
-import org.teiid.language.Exists;
-import org.teiid.language.ExpressionValueSource;
-import org.teiid.language.In;
-import org.teiid.language.InsertValueSource;
-import org.teiid.language.IsNull;
-import org.teiid.language.IteratorValueSource;
-import org.teiid.language.Join;
-import org.teiid.language.Like;
-import org.teiid.language.Literal;
-import org.teiid.language.NamedTable;
-import org.teiid.language.Not;
-import org.teiid.language.QueryExpression;
-import org.teiid.language.SearchedCase;
-import org.teiid.language.SearchedWhenClause;
import org.teiid.language.Select;
-import org.teiid.language.SortSpecification;
-import org.teiid.language.SubqueryComparison;
-import org.teiid.language.SubqueryIn;
-import org.teiid.language.TableReference;
import org.teiid.language.WindowSpecification;
-import org.teiid.language.With;
-import org.teiid.language.WithItem;
import org.teiid.language.Argument.Direction;
import org.teiid.language.Comparison.Operator;
import org.teiid.language.SortSpecification.Ordering;
@@ -74,62 +47,37 @@
import org.teiid.metadata.ProcedureParameter;
import org.teiid.metadata.FunctionMethod.PushDown;
import org.teiid.query.metadata.QueryMetadataInterface;
-import org.teiid.query.sql.lang.BatchedUpdateCommand;
+import org.teiid.query.sql.lang.*;
import org.teiid.query.sql.lang.Command;
-import org.teiid.query.sql.lang.CompareCriteria;
-import org.teiid.query.sql.lang.CompoundCriteria;
-import org.teiid.query.sql.lang.Criteria;
import org.teiid.query.sql.lang.Delete;
-import org.teiid.query.sql.lang.ExistsCriteria;
-import org.teiid.query.sql.lang.FromClause;
import org.teiid.query.sql.lang.GroupBy;
import org.teiid.query.sql.lang.Insert;
-import org.teiid.query.sql.lang.IsNullCriteria;
-import org.teiid.query.sql.lang.JoinPredicate;
-import org.teiid.query.sql.lang.JoinType;
import org.teiid.query.sql.lang.Limit;
-import org.teiid.query.sql.lang.MatchCriteria;
-import org.teiid.query.sql.lang.NotCriteria;
import org.teiid.query.sql.lang.OrderBy;
-import org.teiid.query.sql.lang.OrderByItem;
-import org.teiid.query.sql.lang.Query;
-import org.teiid.query.sql.lang.QueryCommand;
-import org.teiid.query.sql.lang.SPParameter;
import org.teiid.query.sql.lang.SetClause;
-import org.teiid.query.sql.lang.SetClauseList;
-import org.teiid.query.sql.lang.SetCriteria;
import org.teiid.query.sql.lang.SetQuery;
-import org.teiid.query.sql.lang.StoredProcedure;
-import org.teiid.query.sql.lang.SubqueryCompareCriteria;
-import org.teiid.query.sql.lang.SubqueryFromClause;
-import org.teiid.query.sql.lang.SubquerySetCriteria;
-import org.teiid.query.sql.lang.UnaryFromClause;
import org.teiid.query.sql.lang.Update;
-import org.teiid.query.sql.lang.WithQueryCommand;
-import org.teiid.query.sql.symbol.AggregateSymbol;
-import org.teiid.query.sql.symbol.AliasSymbol;
-import org.teiid.query.sql.symbol.Constant;
-import org.teiid.query.sql.symbol.ElementSymbol;
+import org.teiid.query.sql.symbol.*;
import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.sql.symbol.ExpressionSymbol;
import org.teiid.query.sql.symbol.Function;
-import org.teiid.query.sql.symbol.GroupSymbol;
import org.teiid.query.sql.symbol.ScalarSubquery;
-import org.teiid.query.sql.symbol.SearchedCaseExpression;
-import org.teiid.query.sql.symbol.SelectSymbol;
-import org.teiid.query.sql.symbol.SingleElementSymbol;
import org.teiid.query.sql.symbol.WindowFunction;
import org.teiid.translator.TranslatorException;
public class LanguageBridgeFactory {
private RuntimeMetadataImpl metadataFactory = null;
+ private boolean convertIn;
public LanguageBridgeFactory(QueryMetadataInterface metadata) {
if (metadata != null) {
metadataFactory = new RuntimeMetadataImpl(metadata);
}
}
+
+ public void setConvertIn(boolean convertIn) {
+ this.convertIn = convertIn;
+ }
public org.teiid.language.Command translate(Command command) {
if (command == null) return null;
@@ -372,13 +320,25 @@
return like;
}
- In translate(SetCriteria criteria) {
+ Condition translate(SetCriteria criteria) {
Collection expressions = criteria.getValues();
List<org.teiid.language.Expression> translatedExpressions = new ArrayList<org.teiid.language.Expression>();
for (Iterator i = expressions.iterator(); i.hasNext();) {
translatedExpressions.add(translate((Expression)i.next()));
}
- return new In(translate(criteria.getExpression()),
+ org.teiid.language.Expression expr = translate(criteria.getExpression());
+ if (convertIn) {
+ Condition condition = null;
+ for (org.teiid.language.Expression expression : translatedExpressions) {
+ if (condition == null) {
+ condition = new Comparison(expr, expression, criteria.isNegated()?Operator.NE:Operator.EQ);
+ } else {
+ condition = new AndOr(new Comparison(expr, expression, criteria.isNegated()?Operator.NE:Operator.EQ), condition, criteria.isNegated()?AndOr.Operator.AND:AndOr.Operator.OR);
+ }
+ }
+ return condition;
+ }
+ return new In(expr,
translatedExpressions,
criteria.isNegated());
}
Modified: branches/7.7.x/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestInCriteriaImpl.java
===================================================================
--- branches/7.7.x/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestInCriteriaImpl.java 2012-03-29 01:43:03 UTC (rev 3956)
+++ branches/7.7.x/engine/src/test/java/org/teiid/dqp/internal/datamgr/TestInCriteriaImpl.java 2012-03-29 16:17:15 UTC (rev 3957)
@@ -22,30 +22,24 @@
package org.teiid.dqp.internal.datamgr;
+import static org.junit.Assert.*;
+
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
+import org.junit.Test;
+import org.teiid.language.AndOr;
import org.teiid.language.Expression;
import org.teiid.language.In;
import org.teiid.language.Literal;
+import org.teiid.language.AndOr.Operator;
import org.teiid.query.sql.lang.SetCriteria;
+import org.teiid.query.unittest.RealMetadataFactory;
+public class TestInCriteriaImpl {
-import junit.framework.TestCase;
-
-public class TestInCriteriaImpl extends TestCase {
-
- /**
- * Constructor for TestInCriteriaImpl.
- * @param name
- */
- public TestInCriteriaImpl(String name) {
- super(name);
- }
-
public static SetCriteria helpExample(boolean negated) {
- ArrayList values = new ArrayList();
+ ArrayList<org.teiid.query.sql.symbol.Expression> values = new ArrayList<org.teiid.query.sql.symbol.Expression>();
values.add(TestLiteralImpl.helpExample(100));
values.add(TestLiteralImpl.helpExample(200));
values.add(TestLiteralImpl.helpExample(300));
@@ -59,24 +53,31 @@
return (In)TstLanguageBridgeFactory.factory.translate(helpExample(negated));
}
- public void testGetLeftExpression() throws Exception {
+ @Test public void testGetLeftExpression() throws Exception {
In inCriteria = example(false);
assertNotNull(inCriteria.getLeftExpression());
assertTrue(inCriteria.getLeftExpression() instanceof Literal);
assertEquals(new Integer(300), ((Literal)inCriteria.getLeftExpression()).getValue());
}
+
+ @Test public void testExpansion() throws Exception {
+ SetCriteria inCriteria = helpExample(false);
+ LanguageBridgeFactory lbf = new LanguageBridgeFactory(RealMetadataFactory.example1Cached());
+ lbf.setConvertIn(true);
+ AndOr or = (AndOr) lbf.translate(inCriteria);
+ assertEquals(Operator.OR, or.getOperator());
+ inCriteria.setNegated(true);
+ AndOr and = (AndOr) lbf.translate(inCriteria);
+ assertEquals(Operator.AND, and.getOperator());
+ }
- public void testGetRightExpressions() throws Exception {
- List values = example(false).getRightExpressions();
+ @Test public void testGetRightExpressions() throws Exception {
+ List<Expression> values = example(false).getRightExpressions();
assertNotNull(values);
assertEquals(4, values.size());
- for (Iterator i = values.iterator(); i.hasNext();) {
- assertTrue(i.next() instanceof Expression);
- }
-
}
- public void testIsNegated() throws Exception {
+ @Test public void testIsNegated() throws Exception {
assertTrue(example(true).isNegated());
assertFalse(example(false).isNegated());
}
12 years, 9 months
teiid SVN: r3956 - in trunk: engine/src/main/java/org/teiid/common/buffer and 14 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-03-28 21:43:03 -0400 (Wed, 28 Mar 2012)
New Revision: 3956
Added:
trunk/engine/src/main/java/org/teiid/query/function/aggregate/SingleArgumentAggregateFunction.java
Modified:
trunk/api/src/main/java/org/teiid/metadata/AggregateAttributes.java
trunk/engine/src/main/java/org/teiid/common/buffer/BufferManager.java
trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/RankingFunction.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/Sum.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java
trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java
trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java
trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java
trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
trunk/engine/src/main/java/org/teiid/query/sql/LanguageObject.java
trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java
trunk/engine/src/main/java/org/teiid/query/sql/symbol/Function.java
trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
trunk/engine/src/main/resources/org/teiid/query/i18n.properties
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestDuplicateFilter.java
trunk/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java
Log:
TEIID-1560 adding support for n-ary aggregate functions
Modified: trunk/api/src/main/java/org/teiid/metadata/AggregateAttributes.java
===================================================================
--- trunk/api/src/main/java/org/teiid/metadata/AggregateAttributes.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/api/src/main/java/org/teiid/metadata/AggregateAttributes.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -33,8 +33,8 @@
private boolean allowsDistinct;
private boolean windowable;
- private boolean decomposable;
- private boolean respectsNulls;
+ private boolean usesAllRows = true;
+ private boolean respectsNulls = true;
private boolean allowsOrderBy;
public boolean allowsOrderBy() {
@@ -61,14 +61,6 @@
this.windowable = windowable;
}
- public boolean isDecomposable() {
- return decomposable;
- }
-
- public void setDecomposable(boolean decomposable) {
- this.decomposable = decomposable;
- }
-
public boolean respectsNulls() {
return respectsNulls;
}
@@ -77,4 +69,12 @@
this.respectsNulls = respectsNulls;
}
+ public void setUsesAllRows(boolean usesAllRows) {
+ this.usesAllRows = usesAllRows;
+ }
+
+ public boolean usesAllRows() {
+ return this.usesAllRows;
+ }
+
}
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/BufferManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/BufferManager.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/BufferManager.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -122,7 +122,7 @@
*/
int getSchemaSize(List<? extends Expression> elements);
- STree createSTree(final List elements, String groupName, int keyLength);
+ STree createSTree(List<? extends Expression> elements, String groupName, int keyLength);
void addTupleBuffer(TupleBuffer tb);
Modified: trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/common/buffer/impl/BufferManagerImpl.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -482,7 +482,7 @@
return tupleBuffer;
}
- public STree createSTree(final List elements, String groupName, int keyLength) {
+ public STree createSTree(final List<? extends Expression> elements, String groupName, int keyLength) {
Long newID = this.tsId.getAndIncrement();
int[] lobIndexes = LobManager.getLobIndexes(elements);
Class<?>[] types = getTypeClasses(elements);
@@ -503,7 +503,7 @@
return new STree(keyManager, bm, new ListNestedSortComparator(compareIndexes), getProcessorBatchSize(elements.subList(0, keyLength)), getProcessorBatchSize(elements), keyLength, lobManager);
}
- private static Class<?>[] getTypeClasses(final List elements) {
+ private static Class<?>[] getTypeClasses(final List<? extends Expression> elements) {
Class<?>[] types = new Class[elements.size()];
for (ListIterator<? extends Expression> i = elements.listIterator(); i.hasNext();) {
Expression expr = i.next();
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/ExecutionContextImpl.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -259,8 +259,7 @@
@Override
public String getConnectionID() {
- // TODO Auto-generated method stub
- return null;
+ return getConnectionId();
}
@Override
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/MetaDataProcessor.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -58,7 +58,6 @@
import org.teiid.query.sql.lang.SPParameter;
import org.teiid.query.sql.lang.StoredProcedure;
import org.teiid.query.sql.symbol.AggregateSymbol;
-import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.symbol.AliasSymbol;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
@@ -67,6 +66,7 @@
import org.teiid.query.sql.symbol.Reference;
import org.teiid.query.sql.symbol.Symbol;
import org.teiid.query.sql.symbol.WindowFunction;
+import org.teiid.query.sql.symbol.AggregateSymbol.Type;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.ReferenceCollectorVisitor;
import org.teiid.query.tempdata.TempTableStore;
@@ -341,9 +341,9 @@
private Map createAggregateMetadata(String shortColumnName,
AggregateSymbol symbol) throws QueryMetadataException, TeiidComponentException {
- Expression expression = symbol.getExpression();
Type function = symbol.getAggregateFunction();
if(function == Type.MIN || function == Type.MAX){
+ Expression expression = symbol.getArg(0);
if(expression instanceof ElementSymbol) {
return createColumnMetadata(shortColumnName, expression);
}
Modified: trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/QueryPlugin.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -468,8 +468,6 @@
TEIID30422,
TEIID30423,
TEIID30424,
- TEIID30425,
- TEIID30426,
TEIID30427,
TEIID30428,
TEIID30429,
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/AggregateFunction.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -38,11 +38,11 @@
*/
public abstract class AggregateFunction {
- private int expressionIndex = -1;
+ protected int[] argIndexes;
private int conditionIndex = -1;
- public void setExpressionIndex(int expressionIndex) {
- this.expressionIndex = expressionIndex;
+ public void setArgIndexes(int[] argIndexes) {
+ this.argIndexes = argIndexes;
}
public void setConditionIndex(int conditionIndex) {
@@ -53,9 +53,13 @@
* Called to initialize the function. In the future this may expand
* with additional information.
* @param dataType Data type of element begin aggregated
- * @param inputType
+ * @param inputTypes
*/
- public void initialize(Class<?> dataType, Class<?> inputType) {}
+ public void initialize(Class<?> dataType, Class<?>[] inputTypes) {}
+
+ public int[] getArgIndexes() {
+ return argIndexes;
+ }
/**
* Called to reset the state of the function.
@@ -66,14 +70,14 @@
if (conditionIndex != -1 && !Boolean.TRUE.equals(tuple.get(conditionIndex))) {
return;
}
- if (expressionIndex == -1) {
- addInputDirect(null, tuple);
- return;
+ if (!respectsNull()) {
+ for (int i = 0; i < argIndexes.length; i++) {
+ if (tuple.get(argIndexes[i]) == null) {
+ return;
+ }
+ }
}
- Object input = tuple.get(expressionIndex);
- if (input != null || respectsNull()) {
- addInputDirect(input, tuple);
- }
+ addInputDirect(tuple);
}
public boolean respectsNull() {
@@ -82,11 +86,10 @@
/**
* Called for the element value in every row of a group.
- * @param input Input value, may be null
* @param tuple
* @throws TeiidProcessingException
*/
- public abstract void addInputDirect(Object input, List<?> tuple) throws TeiidComponentException, TeiidProcessingException;
+ public abstract void addInputDirect(List<?> tuple) throws TeiidComponentException, TeiidProcessingException;
/**
* Called after all values have been processed to get the result.
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/ArrayAgg.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -30,7 +30,7 @@
import org.teiid.core.TeiidProcessingException;
import org.teiid.query.util.CommandContext;
-public class ArrayAgg extends AggregateFunction {
+public class ArrayAgg extends SingleArgumentAggregateFunction {
private ArrayList<Object> result;
private CommandContext context;
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Avg.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -60,7 +60,7 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(Object, List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
*/
public void addInputDirect(Object input, List<?> tuple)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/ConstantFunction.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -31,7 +31,7 @@
/**
*/
-public class ConstantFunction extends AggregateFunction {
+public class ConstantFunction extends SingleArgumentAggregateFunction {
private Object value;
@@ -45,7 +45,7 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(Object, List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
*/
public void addInputDirect(Object input, List<?> tuple)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Count.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -24,6 +24,9 @@
import java.util.List;
+import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidProcessingException;
+
/**
* Just a simple COUNT() implementation that counts every non-null row it sees.
*/
@@ -34,11 +37,10 @@
public void reset() {
count = 0;
}
-
- /**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(Object, List)
- */
- public void addInputDirect(Object input, List<?> tuple) {
+
+ @Override
+ public void addInputDirect(List<?> tuple)
+ throws TeiidComponentException, TeiidProcessingException {
count++;
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Max.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -27,12 +27,12 @@
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
-import org.teiid.query.QueryPlugin;
+import org.teiid.query.sql.symbol.Constant;
/**
*/
-public class Max extends AggregateFunction {
+public class Max extends SingleArgumentAggregateFunction {
private Object maxValue;
@@ -41,7 +41,7 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(Object, List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
*/
public void addInputDirect(Object value, List<?> tuple)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
@@ -49,14 +49,10 @@
if(maxValue == null) {
maxValue = value;
} else {
- if(value instanceof Comparable) {
- Comparable valueComp = (Comparable) value;
+ Comparable valueComp = (Comparable) value;
- if(valueComp.compareTo(maxValue) > 0) {
- maxValue = valueComp;
- }
- } else {
- throw new FunctionExecutionException(QueryPlugin.Event.TEIID30425, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30425, "MAX", value.getClass().getName()));//$NON-NLS-1$
+ if (Constant.COMPARATOR.compare(valueComp, maxValue) > 0) {
+ maxValue = valueComp;
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Min.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -27,12 +27,12 @@
import org.teiid.api.exception.query.ExpressionEvaluationException;
import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.core.TeiidComponentException;
-import org.teiid.query.QueryPlugin;
+import org.teiid.query.sql.symbol.Constant;
/**
*/
-public class Min extends AggregateFunction {
+public class Min extends SingleArgumentAggregateFunction {
private Object minValue;
@@ -41,7 +41,7 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(Object, List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
*/
public void addInputDirect(Object value, List<?> tuple)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
@@ -49,14 +49,10 @@
if(minValue == null) {
minValue = value;
} else {
- if(value instanceof Comparable) {
- Comparable valueComp = (Comparable) value;
+ Comparable valueComp = (Comparable) value;
- if(valueComp.compareTo(minValue) < 0) {
- minValue = valueComp;
- }
- } else {
- throw new FunctionExecutionException(QueryPlugin.Event.TEIID30426, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30426, "MIN", value.getClass().getName())); //$NON-NLS-1$
+ if(Constant.COMPARATOR.compare(valueComp, minValue) < 0) {
+ minValue = valueComp;
}
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/RankingFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/RankingFunction.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/RankingFunction.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -49,7 +49,7 @@
}
@Override
- public void addInputDirect(Object input, List<?> tuple)
+ public void addInputDirect(List<?> tuple)
throws FunctionExecutionException, ExpressionEvaluationException,
TeiidComponentException {
if (type == Type.RANK) {
Added: trunk/engine/src/main/java/org/teiid/query/function/aggregate/SingleArgumentAggregateFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/SingleArgumentAggregateFunction.java (rev 0)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/SingleArgumentAggregateFunction.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -0,0 +1,52 @@
+/*
+ * 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.query.function.aggregate;
+
+import java.util.List;
+
+import org.teiid.core.TeiidComponentException;
+import org.teiid.core.TeiidProcessingException;
+
+public abstract class SingleArgumentAggregateFunction extends AggregateFunction {
+
+ @Override
+ public void addInputDirect(List<?> tuple)
+ throws TeiidComponentException, TeiidProcessingException {
+ addInputDirect(tuple.get(argIndexes[0]), tuple);
+ }
+
+ public void initialize(java.lang.Class<?> dataType, java.lang.Class<?>[] inputTypes) {
+ initialize(dataType, inputTypes[0]);
+ }
+
+ /**
+ * @param dataType
+ * @param inputType
+ */
+ public void initialize(java.lang.Class<?> dataType, java.lang.Class<?> inputType) {
+
+ }
+
+ public abstract void addInputDirect(Object input, List<?> tuple)
+ throws TeiidProcessingException, TeiidComponentException;
+}
Property changes on: trunk/engine/src/main/java/org/teiid/query/function/aggregate/SingleArgumentAggregateFunction.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/StatsFunction.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -29,7 +29,7 @@
import org.teiid.core.TeiidComponentException;
import org.teiid.query.sql.symbol.AggregateSymbol.Type;
-public class StatsFunction extends AggregateFunction {
+public class StatsFunction extends SingleArgumentAggregateFunction {
private double sum = 0;
private double sumSq = 0;
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/Sum.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/Sum.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/Sum.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -37,7 +37,7 @@
* of a column. The type of the result varies depending on the type
* of the input {@see AggregateSymbol}
*/
-public class Sum extends AggregateFunction {
+public class Sum extends SingleArgumentAggregateFunction {
// Various possible accumulators, depending on type
protected static final int LONG = 0;
@@ -85,7 +85,7 @@
}
/**
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(Object, List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
*/
public void addInputDirect(Object input, List<?> tuple)
throws FunctionExecutionException, ExpressionEvaluationException, TeiidComponentException {
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/TextAgg.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -31,8 +31,8 @@
import javax.sql.rowset.serial.SerialBlob;
import org.teiid.common.buffer.FileStore;
+import org.teiid.common.buffer.FileStoreInputStreamFactory;
import org.teiid.common.buffer.FileStore.FileStoreOutputStream;
-import org.teiid.common.buffer.FileStoreInputStreamFactory;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.BlobImpl;
@@ -47,7 +47,7 @@
/**
* Aggregates Text entries
*/
-public class TextAgg extends AggregateFunction {
+public class TextAgg extends SingleArgumentAggregateFunction {
private FileStoreInputStreamFactory result;
private CommandContext context;
@@ -87,7 +87,7 @@
/**
* @throws TeiidProcessingException
* @throws TeiidComponentException
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(Object, List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
*/
public void addInputDirect(Object input, List<?> tuple) throws TeiidComponentException, TeiidProcessingException {
try {
Modified: trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/function/aggregate/XMLAgg.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -33,7 +33,7 @@
/**
* Aggregates XML entries
*/
-public class XMLAgg extends AggregateFunction {
+public class XMLAgg extends SingleArgumentAggregateFunction {
private XMLType result;
private XmlConcat concat;
@@ -51,7 +51,7 @@
/**
* @throws TeiidProcessingException
* @throws TeiidComponentException
- * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(Object, List)
+ * @see org.teiid.query.function.aggregate.AggregateFunction#addInputDirect(List)
*/
public void addInputDirect(Object input, List<?> tuple) throws TeiidComponentException, TeiidProcessingException {
if (concat == null) {
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/CapabilitiesUtil.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -151,7 +151,7 @@
Type func = aggregate.getAggregateFunction();
switch (func) {
case COUNT:
- if(aggregate.getExpression() == null) {
+ if(aggregate.getArgs().length == 0) {
if(! caps.supportsCapability(Capability.QUERY_AGGREGATES_COUNT_STAR)) {
return false;
}
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RuleAssignOutputElements.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -580,9 +580,9 @@
Expression ex = symbolMap.getMappedExpression((ElementSymbol) outputSymbol);
if(ex instanceof AggregateSymbol) {
AggregateSymbol agg = (AggregateSymbol)ex;
- Expression aggExpr = agg.getExpression();
- if(aggExpr != null) {
- ElementCollectorVisitor.getElements(aggExpr, requiredSymbols);
+ Expression[] aggExprs = agg.getArgs();
+ for (Expression expression : aggExprs) {
+ ElementCollectorVisitor.getElements(expression, requiredSymbols);
}
OrderBy orderBy = agg.getOrderBy();
if(orderBy != null) {
Modified: trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/optimizer/relational/rules/RulePushAggregates.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -22,19 +22,7 @@
package org.teiid.query.optimizer.relational.rules;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import org.teiid.api.exception.query.QueryMetadataException;
import org.teiid.api.exception.query.QueryPlannerException;
@@ -55,10 +43,10 @@
import org.teiid.query.optimizer.relational.RelationalPlanner;
import org.teiid.query.optimizer.relational.RuleStack;
import org.teiid.query.optimizer.relational.plantree.NodeConstants;
-import org.teiid.query.optimizer.relational.plantree.NodeConstants.Info;
import org.teiid.query.optimizer.relational.plantree.NodeEditor;
import org.teiid.query.optimizer.relational.plantree.NodeFactory;
import org.teiid.query.optimizer.relational.plantree.PlanNode;
+import org.teiid.query.optimizer.relational.plantree.NodeConstants.Info;
import org.teiid.query.resolver.util.ResolverUtil;
import org.teiid.query.resolver.util.ResolverVisitor;
import org.teiid.query.rewriter.QueryRewriter;
@@ -70,17 +58,8 @@
import org.teiid.query.sql.lang.OrderBy;
import org.teiid.query.sql.lang.Select;
import org.teiid.query.sql.lang.SetQuery.Operation;
-import org.teiid.query.sql.symbol.AggregateSymbol;
+import org.teiid.query.sql.symbol.*;
import org.teiid.query.sql.symbol.AggregateSymbol.Type;
-import org.teiid.query.sql.symbol.AliasSymbol;
-import org.teiid.query.sql.symbol.Constant;
-import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.sql.symbol.ExpressionSymbol;
-import org.teiid.query.sql.symbol.Function;
-import org.teiid.query.sql.symbol.GroupSymbol;
-import org.teiid.query.sql.symbol.SearchedCaseExpression;
-import org.teiid.query.sql.symbol.Symbol;
import org.teiid.query.sql.util.SymbolMap;
import org.teiid.query.sql.visitor.AggregateSymbolCollectorVisitor;
import org.teiid.query.sql.visitor.ElementCollectorVisitor;
@@ -420,16 +399,17 @@
for (AggregateSymbol agg : aggregates) {
agg = (AggregateSymbol)agg.clone();
if (agg.getAggregateFunction() == Type.COUNT) {
- if (agg.getExpression() == null) {
+ if (agg.getArgs().length == 0) {
allSymbols.addSymbol(new ExpressionSymbol("stagedAgg", new Constant(1))); //$NON-NLS-1$
} else {
- SearchedCaseExpression count = new SearchedCaseExpression(Arrays.asList(new IsNullCriteria(agg.getExpression())), Arrays.asList(new Constant(Integer.valueOf(0))));
+ SearchedCaseExpression count = new SearchedCaseExpression(Arrays.asList(new IsNullCriteria(agg.getArg(0))), Arrays.asList(new Constant(Integer.valueOf(0))));
count.setElseExpression(new Constant(Integer.valueOf(1)));
count.setType(DataTypeManager.DefaultDataClasses.INTEGER);
allSymbols.addSymbol(new ExpressionSymbol("stagedAgg", count)); //$NON-NLS-1$
}
} else { //min, max, sum
- Expression ex = agg.getExpression();
+ assert agg.getArgs().length == 1; //prior canStage should ensure this is true
+ Expression ex = agg.getArg(0);
ex = ResolverUtil.convertExpression(ex, DataTypeManager.getDataTypeName(agg.getType()), metadata);
allSymbols.addSymbol(new ExpressionSymbol("stagedAgg", ex)); //$NON-NLS-1$
}
@@ -669,7 +649,7 @@
if (stagedGroupingSymbols.isEmpty()) {
// if the source has no rows we need to insert a select node with criteria count(*)>0
PlanNode selectNode = NodeFactory.getNewNode(NodeConstants.Types.SELECT);
- AggregateSymbol count = new AggregateSymbol(NonReserved.COUNT, false, null); //$NON-NLS-1$
+ AggregateSymbol count = new AggregateSymbol(NonReserved.COUNT, false, null);
aggregates.add(count); //consider the count aggregate for the push down call below
selectNode.setProperty(NodeConstants.Info.SELECT_CRITERIA, new CompareCriteria(count, CompareCriteria.GT,
new Constant(new Integer(0))));
@@ -702,10 +682,10 @@
//remove any aggregates that are computed over a group by column
for (final Iterator<AggregateSymbol> iterator = aggregates.iterator(); iterator.hasNext();) {
final AggregateSymbol symbol = iterator.next();
- Expression expr = symbol.getExpression();
- if (expr == null) {
- continue;
+ if (symbol.getArgs().length != 1) {
+ continue;
}
+ Expression expr = symbol.getArg(0);
if (stagedGroupingSymbols.contains(expr)) {
iterator.remove();
}
@@ -796,12 +776,12 @@
return result;
}
for (T aggregateSymbol : expressions) {
- if (aggs && ((AggregateSymbol)aggregateSymbol).getExpression() == null) {
- return null; //count(*) is not yet handled. a general approach would be count(*) => count(r.col) * count(l.col), but the logic here assumes a simpler initial mapping
+ if (aggs) {
+ AggregateSymbol as = (AggregateSymbol)aggregateSymbol;
+ if ((!as.canStage() && as.isCardinalityDependent()) || (as.getAggregateFunction() == Type.COUNT && as.getArgs().length == 0)) {
+ return null; //count(*) is not yet handled. a general approach would be count(*) => count(r.col) * count(l.col), but the logic here assumes a simpler initial mapping
+ }
}
- if (aggs && !((AggregateSymbol)aggregateSymbol).canStage()) {
- continue;
- }
Set<GroupSymbol> groups = GroupsUsedByElementsVisitor.getGroups(aggregateSymbol);
if (groups.isEmpty()) {
continue;
@@ -862,7 +842,7 @@
Type aggFunction = partitionAgg.getAggregateFunction();
if (aggFunction == Type.COUNT) {
//COUNT(x) -> CONVERT(SUM(COUNT(x)), INTEGER)
- AggregateSymbol newAgg = new AggregateSymbol(NonReserved.SUM, false, partitionAgg); //$NON-NLS-1$
+ AggregateSymbol newAgg = new AggregateSymbol(NonReserved.SUM, false, partitionAgg);
// Build conversion function to convert SUM (which returns LONG) back to INTEGER
Function convertFunc = new Function(FunctionLibrary.CONVERT, new Expression[] {newAgg, new Constant(DataTypeManager.getDataTypeName(partitionAgg.getType()))});
ResolverVisitor.resolveLanguageObject(convertFunc, metadata);
@@ -871,11 +851,11 @@
nestedAggregates.add(partitionAgg);
} else if (aggFunction == Type.AVG) {
//AVG(x) -> SUM(SUM(x)) / SUM(COUNT(x))
- AggregateSymbol countAgg = new AggregateSymbol(NonReserved.COUNT, false, partitionAgg.getExpression()); //$NON-NLS-1$
- AggregateSymbol sumAgg = new AggregateSymbol(NonReserved.SUM, false, partitionAgg.getExpression()); //$NON-NLS-1$
+ AggregateSymbol countAgg = new AggregateSymbol(NonReserved.COUNT, false, partitionAgg.getArg(0));
+ AggregateSymbol sumAgg = new AggregateSymbol(NonReserved.SUM, false, partitionAgg.getArg(0));
- AggregateSymbol sumSumAgg = new AggregateSymbol(NonReserved.SUM, false, sumAgg); //$NON-NLS-1$
- AggregateSymbol sumCountAgg = new AggregateSymbol(NonReserved.SUM, false, countAgg); //$NON-NLS-1$
+ AggregateSymbol sumSumAgg = new AggregateSymbol(NonReserved.SUM, false, sumAgg);
+ AggregateSymbol sumCountAgg = new AggregateSymbol(NonReserved.SUM, false, countAgg);
Expression convertedSum = new Function(FunctionLibrary.CONVERT, new Expression[] {sumSumAgg, new Constant(DataTypeManager.getDataTypeName(partitionAgg.getType()))});
Expression convertCount = new Function(FunctionLibrary.CONVERT, new Expression[] {sumCountAgg, new Constant(DataTypeManager.getDataTypeName(partitionAgg.getType()))});
@@ -888,13 +868,13 @@
nestedAggregates.add(sumAgg);
} else if (partitionAgg.isEnhancedNumeric()) {
//e.g. STDDEV_SAMP := CASE WHEN COUNT(X) > 1 THEN SQRT((SUM(X^2) - SUM(X)^2/COUNT(X))/(COUNT(X) - 1))
- AggregateSymbol countAgg = new AggregateSymbol(NonReserved.COUNT, false, partitionAgg.getExpression()); //$NON-NLS-1$
- AggregateSymbol sumAgg = new AggregateSymbol(NonReserved.SUM, false, partitionAgg.getExpression()); //$NON-NLS-1$
- AggregateSymbol sumSqAgg = new AggregateSymbol(NonReserved.SUM, false, new Function(SourceSystemFunctions.POWER, new Expression[] {partitionAgg.getExpression(), new Constant(2)})); //$NON-NLS-1$
+ AggregateSymbol countAgg = new AggregateSymbol(NonReserved.COUNT, false, partitionAgg.getArg(0));
+ AggregateSymbol sumAgg = new AggregateSymbol(NonReserved.SUM, false, partitionAgg.getArg(0));
+ AggregateSymbol sumSqAgg = new AggregateSymbol(NonReserved.SUM, false, new Function(SourceSystemFunctions.POWER, new Expression[] {partitionAgg.getArg(0), new Constant(2)}));
- AggregateSymbol sumSumAgg = new AggregateSymbol(NonReserved.SUM, false, sumAgg); //$NON-NLS-1$
- AggregateSymbol sumCountAgg = new AggregateSymbol(NonReserved.SUM, false, countAgg); //$NON-NLS-1$
- AggregateSymbol sumSumSqAgg = new AggregateSymbol(NonReserved.SUM, false, sumSqAgg); //$NON-NLS-1$
+ AggregateSymbol sumSumAgg = new AggregateSymbol(NonReserved.SUM, false, sumAgg);
+ AggregateSymbol sumCountAgg = new AggregateSymbol(NonReserved.SUM, false, countAgg);
+ AggregateSymbol sumSumSqAgg = new AggregateSymbol(NonReserved.SUM, false, sumSqAgg);
Expression convertedSum = new Function(FunctionLibrary.CONVERT, new Expression[] {sumSumAgg, new Constant(DataTypeManager.DefaultDataTypes.DOUBLE)});
@@ -926,7 +906,7 @@
nestedAggregates.add(sumSqAgg);
} else {
//AGG(X) -> AGG(AGG(X))
- newExpression = new AggregateSymbol(aggFunction.name(), false, partitionAgg); //$NON-NLS-1$
+ newExpression = new AggregateSymbol(aggFunction.name(), false, partitionAgg);
nestedAggregates.add(partitionAgg);
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/GroupingNode.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -26,6 +26,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
@@ -93,7 +94,7 @@
// Collection phase
private int phase = COLLECTION;
private Map elementMap; // Map of incoming symbol to index in source elements
- private List<Expression> collectedExpressions; // Collected Expressions
+ private LinkedHashMap<Expression, Integer> collectedExpressions; // Collected Expressions
private int distinctCols = -1;
// Sort phase
@@ -158,22 +159,19 @@
// Incoming elements and lookup map for evaluating expressions
List<? extends Expression> sourceElements = this.getChildren()[0].getElements();
this.elementMap = createLookupMap(sourceElements);
-
+ this.collectedExpressions = new LinkedHashMap<Expression, Integer>();
// List should contain all grouping columns / expressions as we need those for sorting
if(this.orderBy != null) {
- this.collectedExpressions = new ArrayList<Expression>(this.orderBy.size() + getElements().size());
for (OrderByItem item : this.orderBy) {
Expression ex = SymbolMap.getExpression(item.getSymbol());
- this.collectedExpressions.add(ex);
+ getIndex(ex, this.collectedExpressions);
}
if (removeDuplicates) {
for (Expression ses : sourceElements) {
- collectExpression(SymbolMap.getExpression(ses));
+ getIndex(ses, collectedExpressions);
}
distinctCols = collectedExpressions.size();
}
- } else {
- this.collectedExpressions = new ArrayList<Expression>(getElements().size());
}
// Construct aggregate function state accumulators
@@ -184,100 +182,117 @@
symbol = outputMapping.getMappedExpression((ElementSymbol)symbol);
}
Class<?> outputType = symbol.getType();
- Class<?> inputType = symbol.getType();
if(symbol instanceof AggregateSymbol) {
- AggregateSymbol aggSymbol = (AggregateSymbol) symbol;
- if(aggSymbol.getExpression() == null) {
- functions[i] = new Count();
- } else {
- Expression ex = aggSymbol.getExpression();
- inputType = ex.getType();
- int index = collectExpression(ex);
- Type function = aggSymbol.getAggregateFunction();
- switch (function) {
- case COUNT:
- functions[i] = new Count();
- break;
- case SUM:
- functions[i] = new Sum();
- break;
- case AVG:
- functions[i] = new Avg();
- break;
- case MIN:
- functions[i] = new Min();
- break;
- case MAX:
- functions[i] = new Max();
- break;
- case XMLAGG:
- functions[i] = new XMLAgg(context);
- break;
- case ARRAY_AGG:
- functions[i] = new ArrayAgg(context);
- break;
- case TEXTAGG:
- functions[i] = new TextAgg(context, (TextLine)ex);
- break;
- default:
- functions[i] = new StatsFunction(function);
- }
-
- if(aggSymbol.isDistinct()) {
- functions[i] = handleDistinct(functions[i], inputType, getBufferManager(), getConnectionID());
- } else if (aggSymbol.getOrderBy() != null) { //handle the xmlagg case
- int[] orderIndecies = new int[aggSymbol.getOrderBy().getOrderByItems().size()];
- List<OrderByItem> orderByItems = new ArrayList<OrderByItem>(orderIndecies.length);
- List<ElementSymbol> schema = new ArrayList<ElementSymbol>(orderIndecies.length + 1);
- ElementSymbol element = new ElementSymbol("val"); //$NON-NLS-1$
- element.setType(inputType);
- schema.add(element);
- for (ListIterator<OrderByItem> iterator = aggSymbol.getOrderBy().getOrderByItems().listIterator(); iterator.hasNext();) {
- OrderByItem item = iterator.next();
- orderIndecies[iterator.previousIndex()] = collectExpression(item.getSymbol());
- element = new ElementSymbol(String.valueOf(iterator.previousIndex()));
- element.setType(item.getSymbol().getType());
- schema.add(element);
- OrderByItem newItem = item.clone();
- newItem.setSymbol(element);
- orderByItems.add(newItem);
- }
- SortingFilter filter = new SortingFilter(functions[i], getBufferManager(), getConnectionID(), false);
- filter.setIndecies(orderIndecies);
- filter.setElements(schema);
- filter.setSortItems(orderByItems);
- functions[i] = filter;
- }
- functions[i].setExpressionIndex(index);
- }
- if (aggSymbol.getCondition() != null) {
- functions[i].setConditionIndex(collectExpression(aggSymbol.getCondition()));
- }
+ AggregateSymbol aggSymbol = (AggregateSymbol) symbol;
+ functions[i] = initAccumulator(context, aggSymbol, this, this.collectedExpressions);
} else {
functions[i] = new ConstantFunction();
- functions[i].setExpressionIndex(this.collectedExpressions.indexOf(symbol));
+ functions[i].setArgIndexes(new int[] {this.collectedExpressions.get(symbol)});
+ functions[i].initialize(outputType, new Class<?>[]{symbol.getType()});
}
- functions[i].initialize(outputType, inputType);
}
}
+
+ static Integer getIndex(Expression ex, LinkedHashMap<Expression, Integer> expressionIndexes) {
+ Integer index = expressionIndexes.get(ex);
+ if (index == null) {
+ index = expressionIndexes.size();
+ expressionIndexes.put(ex, index);
+ }
+ return index;
+ }
- static SortingFilter handleDistinct(AggregateFunction af, Class<?> inputType, BufferManager bm, String cid) {
- SortingFilter filter = new SortingFilter(af, bm, cid, true);
- ElementSymbol element = new ElementSymbol("val"); //$NON-NLS-1$
- element.setType(inputType);
- filter.setElements(Arrays.asList(element));
- return filter;
+ static AggregateFunction initAccumulator(CommandContext context,
+ AggregateSymbol aggSymbol, RelationalNode node, LinkedHashMap<Expression, Integer> expressionIndexes) {
+ int[] argIndexes = new int[aggSymbol.getArgs().length];
+ AggregateFunction result = null;
+ Expression[] args = aggSymbol.getArgs();
+ Class<?>[] inputTypes = new Class[args.length];
+ for (int j = 0; j < args.length; j++) {
+ inputTypes[j] = args[j].getType();
+ argIndexes[j] = getIndex(args[j], expressionIndexes);
+ }
+ Type function = aggSymbol.getAggregateFunction();
+ switch (function) {
+ case RANK:
+ case DENSE_RANK:
+ result = new RankingFunction(function);
+ break;
+ case ROW_NUMBER: //same as count(*)
+ case COUNT:
+ result = new Count();
+ break;
+ case SUM:
+ result = new Sum();
+ break;
+ case AVG:
+ result = new Avg();
+ break;
+ case MIN:
+ result = new Min();
+ break;
+ case MAX:
+ result = new Max();
+ break;
+ case XMLAGG:
+ result = new XMLAgg(context);
+ break;
+ case ARRAY_AGG:
+ result = new ArrayAgg(context);
+ break;
+ case TEXTAGG:
+ result = new TextAgg(context, (TextLine)args[0]);
+ break;
+ default:
+ result = new StatsFunction(function);
+ }
+ if(aggSymbol.isDistinct()) {
+ SortingFilter filter = new SortingFilter(result, node.getBufferManager(), node.getConnectionID(), true);
+ List<ElementSymbol> elements = createSortSchema(result, inputTypes);
+ filter.setElements(elements);
+ result = filter;
+ } else if (aggSymbol.getOrderBy() != null) {
+ int numOrderByItems = aggSymbol.getOrderBy().getOrderByItems().size();
+ List<OrderByItem> orderByItems = new ArrayList<OrderByItem>(numOrderByItems);
+ List<ElementSymbol> schema = createSortSchema(result, inputTypes);
+ argIndexes = Arrays.copyOf(argIndexes, argIndexes.length + numOrderByItems);
+ for (ListIterator<OrderByItem> iterator = aggSymbol.getOrderBy().getOrderByItems().listIterator(); iterator.hasNext();) {
+ OrderByItem item = iterator.next();
+ argIndexes[args.length + iterator.previousIndex()] = getIndex(item.getSymbol(), expressionIndexes);
+ ElementSymbol element = new ElementSymbol(String.valueOf(iterator.previousIndex()));
+ element.setType(item.getSymbol().getType());
+ schema.add(element);
+ OrderByItem newItem = item.clone();
+ newItem.setSymbol(element);
+ orderByItems.add(newItem);
+ }
+ SortingFilter filter = new SortingFilter(result, node.getBufferManager(), node.getConnectionID(), false);
+ filter.setElements(schema);
+ filter.setSortItems(orderByItems);
+ result = filter;
+ }
+ result.setArgIndexes(argIndexes);
+ if (aggSymbol.getCondition() != null) {
+ result.setConditionIndex(getIndex(aggSymbol.getCondition(), expressionIndexes));
+ }
+ result.initialize(aggSymbol.getType(), inputTypes);
+ return result;
}
- private int collectExpression(Expression ex) {
- int index = this.collectedExpressions.indexOf(ex);
- if(index == -1) {
- index = this.collectedExpressions.size();
- this.collectedExpressions.add(ex);
+ private static List<ElementSymbol> createSortSchema(AggregateFunction af,
+ Class<?>[] inputTypes) {
+ List<ElementSymbol> elements = new ArrayList<ElementSymbol>(inputTypes.length);
+ int[] filteredArgIndexes = new int[inputTypes.length];
+ for (int i = 0; i < inputTypes.length; i++) {
+ ElementSymbol element = new ElementSymbol("val" + i); //$NON-NLS-1$
+ element.setType(inputTypes[i]);
+ elements.add(element);
+ filteredArgIndexes[i] = i;
}
- return index;
- }
-
+ af.setArgIndexes(filteredArgIndexes);
+ return elements;
+ }
+
AggregateFunction[] getFunctions() {
return functions;
}
@@ -306,7 +321,7 @@
public TupleSource getCollectionTupleSource() {
final RelationalNode sourceNode = this.getChildren()[0];
- return new ProjectingTupleSource(sourceNode, eval, collectedExpressions);
+ return new ProjectingTupleSource(sourceNode, eval, new ArrayList<Expression>(collectedExpressions.keySet()));
}
private void collectionPhase() {
@@ -337,7 +352,7 @@
}
this.indexes = Arrays.copyOf(sortIndexes, orderBy.size());
this.sortUtility = new SortUtility(getCollectionTupleSource(), removeDuplicates?Mode.DUP_REMOVE_SORT:Mode.SORT, getBufferManager(),
- getConnectionID(), collectedExpressions, sortTypes, nullOrdering, sortIndexes);
+ getConnectionID(), new ArrayList<Expression>(collectedExpressions.keySet()), sortTypes, nullOrdering, sortIndexes);
this.phase = SORT;
}
}
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/SortingFilter.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -25,8 +25,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.teiid.api.exception.query.ExpressionEvaluationException;
-import org.teiid.api.exception.query.FunctionExecutionException;
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.TupleBuffer;
import org.teiid.common.buffer.TupleSource;
@@ -36,12 +34,12 @@
import org.teiid.query.function.aggregate.AggregateFunction;
import org.teiid.query.processor.relational.SortUtility.Mode;
import org.teiid.query.sql.lang.OrderByItem;
+import org.teiid.query.sql.symbol.ElementSymbol;
/**
*/
public class SortingFilter extends AggregateFunction {
- private static final int[] NO_INDECIES = new int[0];
// Initial setup - can be reused
private AggregateFunction proxy;
private BufferManager mgr;
@@ -49,11 +47,9 @@
private boolean removeDuplicates;
// Derived and static - can be reused
- private List elements;
+ private List<ElementSymbol> elements;
private List<OrderByItem> sortItems;
- private int[] indecies = NO_INDECIES;
-
// Temporary state - should be reset
private TupleBuffer collectionBuffer;
private SortUtility sortUtility;
@@ -70,27 +66,21 @@
this.removeDuplicates = removeDuplicates;
}
- public List getElements() {
+ public List<ElementSymbol> getElements() {
return elements;
}
- public void setElements(List elements) {
+ public void setElements(List<ElementSymbol> elements) {
this.elements = elements;
}
- public void setIndecies(int[] indecies) {
- this.indecies = indecies;
- }
-
public void setSortItems(List<OrderByItem> sortItems) {
this.sortItems = sortItems;
}
- /**
- * @see org.teiid.query.function.aggregate.AggregateFunction#initialize(String, Class)
- */
- public void initialize(Class<?> dataType, Class<?> inputType) {
- this.proxy.initialize(dataType, inputType);
+ @Override
+ public void initialize(java.lang.Class<?> dataType, java.lang.Class<?>[] inputTypes) {
+ this.proxy.initialize(dataType, inputTypes);
}
public void reset() {
@@ -107,17 +97,16 @@
}
@Override
- public void addInputDirect(Object input, List<?> tuple)
- throws FunctionExecutionException, ExpressionEvaluationException,
- TeiidComponentException, TeiidProcessingException {
+ public void addInputDirect(List<?> tuple)
+ throws TeiidComponentException, TeiidProcessingException {
if(collectionBuffer == null) {
collectionBuffer = mgr.createTupleBuffer(elements, groupName, TupleSourceType.PROCESSOR);
collectionBuffer.setForwardOnly(true);
}
- List<Object> row = new ArrayList<Object>(1 + indecies.length);
- row.add(input);
- for (int i = 0; i < indecies.length; i++) {
- row.add(tuple.get(indecies[i]));
+ List<Object> row = new ArrayList<Object>(argIndexes.length);
+ //TODO remove overlap
+ for (int i = 0; i < argIndexes.length; i++) {
+ row.add(tuple.get(argIndexes[i]));
}
this.collectionBuffer.addTuple(row);
}
@@ -142,11 +131,12 @@
// Add all input to proxy
TupleSource sortedSource = sorted.createIndexedTupleSource();
while(true) {
- List tuple = sortedSource.nextTuple();
+ List<?> tuple = sortedSource.nextTuple();
if(tuple == null) {
break;
}
- this.proxy.addInputDirect(tuple.get(0), null);
+ //TODO should possibly remove the order by columns from this tuple
+ this.proxy.addInputDirect(tuple);
}
} finally {
sorted.remove();
Modified: trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/processor/relational/WindowFunctionProjectNode.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -45,25 +45,13 @@
import org.teiid.language.SortSpecification.NullOrdering;
import org.teiid.query.eval.Evaluator;
import org.teiid.query.function.aggregate.AggregateFunction;
-import org.teiid.query.function.aggregate.ArrayAgg;
-import org.teiid.query.function.aggregate.Avg;
-import org.teiid.query.function.aggregate.Count;
-import org.teiid.query.function.aggregate.Max;
-import org.teiid.query.function.aggregate.Min;
-import org.teiid.query.function.aggregate.RankingFunction;
-import org.teiid.query.function.aggregate.StatsFunction;
-import org.teiid.query.function.aggregate.Sum;
-import org.teiid.query.function.aggregate.TextAgg;
-import org.teiid.query.function.aggregate.XMLAgg;
import org.teiid.query.processor.ProcessorDataManager;
import org.teiid.query.processor.relational.GroupingNode.ProjectingTupleSource;
import org.teiid.query.processor.relational.SortUtility.Mode;
import org.teiid.query.sql.lang.OrderBy;
import org.teiid.query.sql.lang.OrderByItem;
-import org.teiid.query.sql.symbol.AggregateSymbol;
import org.teiid.query.sql.symbol.ElementSymbol;
import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.sql.symbol.TextLine;
import org.teiid.query.sql.symbol.WindowFunction;
import org.teiid.query.sql.symbol.WindowSpecification;
import org.teiid.query.sql.symbol.AggregateSymbol.Type;
@@ -83,8 +71,6 @@
private static class WindowFunctionInfo {
WindowFunction function;
- int expressionIndex = -1;
- int conditionIndex = -1;
int outputIndex;
}
@@ -99,9 +85,9 @@
private LinkedHashMap<WindowSpecification, WindowSpecificationInfo> windows = new LinkedHashMap<WindowSpecification, WindowSpecificationInfo>();
private LinkedHashMap<Expression, Integer> expressionIndexes;
- private LinkedHashMap<Integer, Integer> passThrough = new LinkedHashMap<Integer, Integer>();
+ private List<int[]> passThrough = new ArrayList<int[]>();
- private Map elementMap;
+ private Map<Expression, Integer> elementMap;
//processing state
private Phase phase = Phase.COLLECT;
@@ -171,7 +157,7 @@
public void init() {
expressionIndexes = new LinkedHashMap<Expression, Integer>();
for (int i = 0; i < getElements().size(); i++) {
- Expression ex = SymbolMap.getExpression((Expression) getElements().get(i));
+ Expression ex = SymbolMap.getExpression(getElements().get(i));
if (ex instanceof WindowFunction) {
WindowFunction wf = (WindowFunction)ex;
WindowSpecification ws = wf.getWindowSpecification();
@@ -181,7 +167,7 @@
windows.put(wf.getWindowSpecification(), wsi);
if (ws.getPartition() != null) {
for (Expression ex1 : ws.getPartition()) {
- Integer index = getIndex(ex1);
+ Integer index = GroupingNode.getIndex(ex1, expressionIndexes);
wsi.groupIndexes.add(index);
wsi.orderType.add(OrderBy.ASC);
wsi.nullOrderings.add(null);
@@ -190,7 +176,7 @@
if (ws.getOrderBy() != null) {
for (OrderByItem item : ws.getOrderBy().getOrderByItems()) {
Expression ex1 = SymbolMap.getExpression(item.getSymbol());
- Integer index = getIndex(ex1);
+ Integer index = GroupingNode.getIndex(ex1, expressionIndexes);
wsi.sortIndexes.add(index);
wsi.orderType.add(item.isAscending());
wsi.nullOrderings.add(item.getNullOrdering());
@@ -199,13 +185,17 @@
}
WindowFunctionInfo wfi = new WindowFunctionInfo();
wfi.function = wf;
- ex = wf.getFunction().getExpression();
- if (ex != null) {
- wfi.expressionIndex = getIndex(ex);
+ //collect the agg expressions
+ for (Expression e : wf.getFunction().getArgs()) {
+ GroupingNode.getIndex(e, expressionIndexes);
}
+ if (wf.getFunction().getOrderBy() != null) {
+ for (OrderByItem item : wf.getFunction().getOrderBy().getOrderByItems()) {
+ GroupingNode.getIndex(item.getSymbol(), expressionIndexes);
+ }
+ }
if (wf.getFunction().getCondition() != null) {
- ex = wf.getFunction().getCondition();
- wfi.conditionIndex = getIndex(ex);
+ GroupingNode.getIndex(wf.getFunction().getCondition(), expressionIndexes);
}
wfi.outputIndex = i;
if (wf.getFunction().getAggregateFunction() == Type.ROW_NUMBER) {
@@ -214,8 +204,8 @@
wsi.functions.add(wfi);
}
} else {
- int index = getIndex(ex);
- passThrough.put(i, index);
+ int index = GroupingNode.getIndex(ex, expressionIndexes);
+ passThrough.add(new int[] {i, index});
}
}
}
@@ -249,8 +239,8 @@
for (int i = 0; i < size; i++) {
outputRow.add(null);
}
- for (Map.Entry<Integer, Integer> entry : passThrough.entrySet()) {
- outputRow.set(entry.getKey(), tuple.get(entry.getValue()));
+ for (int[] entry : passThrough) {
+ outputRow.set(entry[0], tuple.get(entry[1]));
}
List<Map.Entry<WindowSpecification, WindowSpecificationInfo>> specs = new ArrayList<Map.Entry<WindowSpecification,WindowSpecificationInfo>>(windows.entrySet());
for (int specIndex = 0; specIndex < specs.size(); specIndex++) {
@@ -398,7 +388,6 @@
}
/**
- * TODO: consolidate with {@link GroupingNode}
* @param functions
* @param specIndex
* @param rowValues
@@ -409,77 +398,19 @@
if (functions.isEmpty()) {
return aggs;
}
- //initialize the function accumulators
- List<ElementSymbol> elements = new ArrayList<ElementSymbol>(functions.size() + 1);
- ElementSymbol key = new ElementSymbol("id"); //$NON-NLS-1$
- key.setType(DataTypeManager.DefaultDataClasses.INTEGER);
- elements.add(key);
-
- CommandContext context = this.getContext();
+ List<ElementSymbol> elements = new ArrayList<ElementSymbol>(functions.size());
for (WindowFunctionInfo wfi : functions) {
- AggregateSymbol aggSymbol = wfi.function.getFunction();
- Class<?> outputType = aggSymbol.getType();
+ aggs.add(GroupingNode.initAccumulator(this.getContext(), wfi.function.getFunction(), this, expressionIndexes));
+ Class<?> outputType = wfi.function.getType();
ElementSymbol value = new ElementSymbol("val"); //$NON-NLS-1$
value.setType(outputType);
elements.add(value);
- Class<?> inputType = aggSymbol.getType();
- if (aggSymbol.getExpression() != null) {
- inputType = aggSymbol.getExpression().getType();
- }
- Type function = aggSymbol.getAggregateFunction();
- AggregateFunction af = null;
- switch (function) {
- case RANK:
- case DENSE_RANK:
- af = new RankingFunction(function);
- break;
- case ROW_NUMBER: //same as count(*)
- case COUNT:
- af = new Count();
- break;
- case SUM:
- af = new Sum();
- break;
- case AVG:
- af = new Avg();
- break;
- case MIN:
- af = new Min();
- break;
- case MAX:
- af = new Max();
- break;
- case XMLAGG:
- af = new XMLAgg(context);
- break;
- case ARRAY_AGG:
- af = new ArrayAgg(context);
- break;
- case TEXTAGG:
- af = new TextAgg(context, (TextLine)aggSymbol.getExpression());
- break;
- default:
- af = new StatsFunction(function);
- }
-
- if(aggSymbol.isDistinct()) {
- af = GroupingNode.handleDistinct(af, inputType, getBufferManager(), getConnectionID());
- }
-
- af.setExpressionIndex(wfi.expressionIndex);
- af.setConditionIndex(wfi.conditionIndex);
- af.initialize(outputType, inputType);
- aggs.add(af);
}
-
- if (!aggs.isEmpty()) {
- if (!rowValues) {
- valueMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1);
- } else {
- rowValueMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1);
- }
+ if (!rowValues) {
+ valueMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1);
+ } else {
+ rowValueMapping[specIndex] = this.getBufferManager().createSTree(elements, this.getConnectionID(), 1);
}
-
return aggs;
}
@@ -531,20 +462,11 @@
inputTs = null;
}
- private Integer getIndex(Expression ex) {
- Integer index = expressionIndexes.get(ex);
- if (index == null) {
- index = expressionIndexes.size();
- expressionIndexes.put(ex, index);
- }
- return index;
- }
-
@Override
public void initialize(CommandContext context, BufferManager bufferManager,
ProcessorDataManager dataMgr) {
super.initialize(context, bufferManager, dataMgr);
- List sourceElements = this.getChildren()[0].getElements();
+ List<? extends Expression> sourceElements = this.getChildren()[0].getElements();
this.elementMap = createLookupMap(sourceElements);
}
Modified: trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/rewriter/QueryRewriter.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -2002,13 +2002,13 @@
if (expression.isDistinct()) {
expression.setDistinct(false);
}
- if (rewriteAggs && expression.getExpression() != null && EvaluatableVisitor.willBecomeConstant(expression.getExpression())) {
- return expression.getExpression();
+ if (rewriteAggs && expression.getArg(0) != null && EvaluatableVisitor.willBecomeConstant(expression.getArg(0))) {
+ return expression.getArg(0);
}
}
- if (expression.getExpression() != null && expression.getCondition() != null && !expression.respectsNulls()) {
+ if (expression.getArgs().length == 1 && expression.getCondition() != null && !expression.respectsNulls()) {
Expression cond = expression.getCondition();
- Expression ex = expression.getExpression();
+ Expression ex = expression.getArg(0);
if (!(cond instanceof Criteria)) {
cond = new ExpressionCriteria(cond);
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/LanguageObject.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/LanguageObject.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/sql/LanguageObject.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -23,6 +23,7 @@
package org.teiid.query.sql;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
/**
@@ -57,6 +58,19 @@
}
return result;
}
+
+ @SuppressWarnings("unchecked")
+ public static <T extends LanguageObject> T[] deepClone(T[] collection) {
+ if (collection == null) {
+ return null;
+ }
+ T[] copy = Arrays.copyOf(collection, collection.length);
+ for (int i = 0; i < copy.length; i++) {
+ LanguageObject t = copy[i];
+ copy[i] = (T) t.clone();
+ }
+ return copy;
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/sql/navigator/PreOrPostOrderNavigator.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -26,86 +26,9 @@
import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.LanguageVisitor;
-import org.teiid.query.sql.lang.AlterProcedure;
-import org.teiid.query.sql.lang.AlterTrigger;
-import org.teiid.query.sql.lang.AlterView;
-import org.teiid.query.sql.lang.ArrayTable;
-import org.teiid.query.sql.lang.BatchedUpdateCommand;
-import org.teiid.query.sql.lang.BetweenCriteria;
-import org.teiid.query.sql.lang.CompareCriteria;
-import org.teiid.query.sql.lang.CompoundCriteria;
-import org.teiid.query.sql.lang.Create;
-import org.teiid.query.sql.lang.Delete;
-import org.teiid.query.sql.lang.DependentSetCriteria;
-import org.teiid.query.sql.lang.Drop;
-import org.teiid.query.sql.lang.DynamicCommand;
-import org.teiid.query.sql.lang.ExistsCriteria;
-import org.teiid.query.sql.lang.ExpressionCriteria;
-import org.teiid.query.sql.lang.From;
-import org.teiid.query.sql.lang.GroupBy;
-import org.teiid.query.sql.lang.Insert;
-import org.teiid.query.sql.lang.Into;
-import org.teiid.query.sql.lang.IsNullCriteria;
-import org.teiid.query.sql.lang.JoinPredicate;
-import org.teiid.query.sql.lang.JoinType;
-import org.teiid.query.sql.lang.Limit;
-import org.teiid.query.sql.lang.MatchCriteria;
-import org.teiid.query.sql.lang.NotCriteria;
-import org.teiid.query.sql.lang.Option;
-import org.teiid.query.sql.lang.OrderBy;
-import org.teiid.query.sql.lang.OrderByItem;
-import org.teiid.query.sql.lang.Query;
-import org.teiid.query.sql.lang.SPParameter;
-import org.teiid.query.sql.lang.Select;
-import org.teiid.query.sql.lang.SetClause;
-import org.teiid.query.sql.lang.SetClauseList;
-import org.teiid.query.sql.lang.SetCriteria;
-import org.teiid.query.sql.lang.SetQuery;
-import org.teiid.query.sql.lang.StoredProcedure;
-import org.teiid.query.sql.lang.SubqueryCompareCriteria;
-import org.teiid.query.sql.lang.SubqueryFromClause;
-import org.teiid.query.sql.lang.SubquerySetCriteria;
-import org.teiid.query.sql.lang.TextTable;
-import org.teiid.query.sql.lang.UnaryFromClause;
-import org.teiid.query.sql.lang.Update;
-import org.teiid.query.sql.lang.WithQueryCommand;
-import org.teiid.query.sql.lang.XMLTable;
-import org.teiid.query.sql.proc.AssignmentStatement;
-import org.teiid.query.sql.proc.Block;
-import org.teiid.query.sql.proc.BranchingStatement;
-import org.teiid.query.sql.proc.CommandStatement;
-import org.teiid.query.sql.proc.CreateProcedureCommand;
-import org.teiid.query.sql.proc.DeclareStatement;
-import org.teiid.query.sql.proc.IfStatement;
-import org.teiid.query.sql.proc.LoopStatement;
-import org.teiid.query.sql.proc.RaiseErrorStatement;
-import org.teiid.query.sql.proc.TriggerAction;
-import org.teiid.query.sql.proc.WhileStatement;
-import org.teiid.query.sql.symbol.AggregateSymbol;
-import org.teiid.query.sql.symbol.AliasSymbol;
-import org.teiid.query.sql.symbol.CaseExpression;
-import org.teiid.query.sql.symbol.Constant;
-import org.teiid.query.sql.symbol.DerivedColumn;
-import org.teiid.query.sql.symbol.ElementSymbol;
-import org.teiid.query.sql.symbol.Expression;
-import org.teiid.query.sql.symbol.ExpressionSymbol;
-import org.teiid.query.sql.symbol.Function;
-import org.teiid.query.sql.symbol.GroupSymbol;
-import org.teiid.query.sql.symbol.MultipleElementSymbol;
-import org.teiid.query.sql.symbol.QueryString;
-import org.teiid.query.sql.symbol.Reference;
-import org.teiid.query.sql.symbol.ScalarSubquery;
-import org.teiid.query.sql.symbol.SearchedCaseExpression;
-import org.teiid.query.sql.symbol.TextLine;
-import org.teiid.query.sql.symbol.WindowFunction;
-import org.teiid.query.sql.symbol.WindowSpecification;
-import org.teiid.query.sql.symbol.XMLAttributes;
-import org.teiid.query.sql.symbol.XMLElement;
-import org.teiid.query.sql.symbol.XMLForest;
-import org.teiid.query.sql.symbol.XMLNamespaces;
-import org.teiid.query.sql.symbol.XMLParse;
-import org.teiid.query.sql.symbol.XMLQuery;
-import org.teiid.query.sql.symbol.XMLSerialize;
+import org.teiid.query.sql.lang.*;
+import org.teiid.query.sql.proc.*;
+import org.teiid.query.sql.symbol.*;
@@ -140,7 +63,12 @@
public void visit(AggregateSymbol obj) {
preVisitVisitor(obj);
- visitNode(obj.getExpression());
+ Expression[] args = obj.getArgs();
+ if(args != null) {
+ for(int i=0; i<args.length; i++) {
+ visitNode(args[i]);
+ }
+ }
visitNode(obj.getOrderBy());
visitNode(obj.getCondition());
postVisitVisitor(obj);
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/AggregateSymbol.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -25,11 +25,13 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
+import java.util.TreeMap;
import org.teiid.core.types.DataTypeManager;
import org.teiid.core.util.EquivalenceUtil;
import org.teiid.core.util.HashCodeUtil;
import org.teiid.query.parser.SQLParserUtil;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.lang.OrderBy;
@@ -44,6 +46,8 @@
*/
public class AggregateSymbol extends Function implements DerivedExpression {
+ private static final Expression[] EMPTY_ARGS = new Expression[0];
+
public enum Type {
COUNT,
SUM,
@@ -65,6 +69,17 @@
ROW_NUMBER,
USER_DEFINED;
}
+
+ private static final Map<String, Type> nameMap = new TreeMap<String, Type>(String.CASE_INSENSITIVE_ORDER);
+
+ static {
+ for (Type t : Type.values()) {
+ if (t == Type.USER_DEFINED) {
+ continue;
+ }
+ nameMap.put(t.name(), t);
+ }
+ }
private Type aggregate;
private boolean distinct;
@@ -104,8 +119,8 @@
* @param canonicalName
* @since 4.3
*/
- protected AggregateSymbol(String name, Type aggregateFunction, boolean isDistinct, Expression expression) {
- super(name, expression == null?new Expression[0]:new Expression[] {expression});
+ protected AggregateSymbol(String name, Type aggregateFunction, boolean isDistinct, Expression[] args) {
+ super(name, args);
this.aggregate = aggregateFunction;
this.distinct = isDistinct;
}
@@ -117,10 +132,9 @@
* @param expression Contained expression
*/
public AggregateSymbol(String aggregateFunction, boolean isDistinct, Expression expression) {
- super(aggregateFunction, expression == null?new Expression[0]:new Expression[] {expression});
- try {
- this.aggregate = Type.valueOf(aggregateFunction.toUpperCase());
- } catch (IllegalArgumentException e) {
+ super(aggregateFunction, expression == null?EMPTY_ARGS:new Expression[] {expression});
+ this.aggregate = nameMap.get(aggregateFunction);
+ if (this.aggregate == null) {
this.aggregate = Type.USER_DEFINED;
}
this.distinct = isDistinct;
@@ -172,10 +186,10 @@
case COUNT:
return COUNT_TYPE;
case SUM:
- Class<?> expressionType = this.getExpression().getType();
+ Class<?> expressionType = this.getArg(0).getType();
return SUM_TYPES.get(expressionType);
case AVG:
- expressionType = this.getExpression().getType();
+ expressionType = this.getArg(0).getType();
return AVG_TYPES.get(expressionType);
case ARRAY_AGG:
return DataTypeManager.DefaultDataClasses.OBJECT;
@@ -191,7 +205,7 @@
if (isAnalytical()) {
return DataTypeManager.DefaultDataClasses.INTEGER;
}
- return this.getExpression().getType();
+ return this.getArg(0).getType();
}
public boolean isAnalytical() {
@@ -233,12 +247,7 @@
* Return a deep copy of this object
*/
public Object clone() {
- AggregateSymbol copy = null;
- if(getExpression() != null) {
- copy = new AggregateSymbol(getName(), getAggregateFunction(), isDistinct(), (Expression) getExpression().clone());
- } else {
- copy = new AggregateSymbol(getName(), getAggregateFunction(), isDistinct(), null);
- }
+ AggregateSymbol copy = new AggregateSymbol(getName(), getAggregateFunction(), isDistinct(), LanguageObject.Util.deepClone(getArgs()));
if (orderBy != null) {
copy.setOrderBy(orderBy.clone());
}
@@ -246,6 +255,8 @@
copy.setCondition((Expression) condition.clone());
}
copy.isWindowed = this.isWindowed;
+ copy.setType(getType());
+ copy.setFunctionDescriptor(getFunctionDescriptor());
return copy;
}
@@ -254,7 +265,7 @@
*/
public int hashCode() {
int hasCode = HashCodeUtil.hashCode(aggregate.hashCode(), distinct);
- return HashCodeUtil.hashCode(hasCode, this.getExpression());
+ return HashCodeUtil.hashCode(hasCode, super.hashCode());
}
/**
@@ -267,10 +278,10 @@
AggregateSymbol other = (AggregateSymbol)obj;
- return this.aggregate.equals(other.aggregate)
+ return super.equals(obj)
+ && this.aggregate.equals(other.aggregate)
&& this.distinct == other.distinct
&& this.isWindowed == other.isWindowed
- && EquivalenceUtil.areEqual(this.getExpression(), other.getExpression())
&& EquivalenceUtil.areEqual(this.condition, other.condition)
&& EquivalenceUtil.areEqual(this.getOrderBy(), other.getOrderBy());
}
@@ -286,6 +297,8 @@
case SOME:
case EVERY:
return false;
+ case USER_DEFINED:
+ return getFunctionDescriptor().getMethod().getAggregateAttributes().usesAllRows();
}
return true;
}
@@ -323,6 +336,8 @@
return false;
case XMLAGG:
return orderBy == null;
+ case USER_DEFINED:
+ return false;
}
return true;
}
@@ -335,15 +350,4 @@
this.isWindowed = isWindowed;
}
- @Deprecated
- public Expression getExpression() {
- if (this.getArgs().length == 0) {
- return null;
- }
- if (this.getArgs().length > 1) {
- throw new AssertionError("getExpression should not be used with a non-unary aggregate"); //$NON-NLS-1$
- }
- return this.getArg(0);
- }
-
}
Modified: trunk/engine/src/main/java/org/teiid/query/sql/symbol/Function.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/sql/symbol/Function.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/sql/symbol/Function.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -26,6 +26,7 @@
import org.teiid.core.util.EquivalenceUtil;
import org.teiid.core.util.HashCodeUtil;
import org.teiid.query.function.FunctionDescriptor;
+import org.teiid.query.sql.LanguageObject;
import org.teiid.query.sql.LanguageVisitor;
import org.teiid.query.sql.visitor.SQLStringVisitor;
@@ -224,13 +225,7 @@
* @return Deep copy of the object
*/
public Object clone() {
- Expression[] copyArgs = new Expression[args.length];
- for(int i=0; i<args.length; i++) {
- if(args[i] != null) {
- copyArgs[i] = (Expression) args[i].clone();
- }
- }
-
+ Expression[] copyArgs = LanguageObject.Util.deepClone(this.args);
Function copy = new Function(getName(), copyArgs);
copy.setType(getType());
copy.setFunctionDescriptor(getFunctionDescriptor());
Modified: trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/java/org/teiid/query/validator/ValidationVisitor.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -987,9 +987,11 @@
Expression condition = obj.getCondition();
validateNoSubqueriesOrOuterReferences(condition);
}
- Expression aggExp = obj.getExpression();
-
- validateNoNestedAggs(aggExp);
+ Expression[] aggExps = obj.getArgs();
+
+ for (Expression expression : aggExps) {
+ validateNoNestedAggs(expression);
+ }
validateNoNestedAggs(obj.getOrderBy());
validateNoNestedAggs(obj.getCondition());
@@ -998,17 +1000,17 @@
if((aggregateFunction == Type.SUM || aggregateFunction == Type.AVG) && obj.getType() == null) {
handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0041", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
} else if (obj.getType() != DataTypeManager.DefaultDataClasses.NULL) {
- if (aggregateFunction == Type.XMLAGG && aggExp.getType() != DataTypeManager.DefaultDataClasses.XML) {
+ if (aggregateFunction == Type.XMLAGG && aggExps[0].getType() != DataTypeManager.DefaultDataClasses.XML) {
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_xml", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
- } else if (obj.isBoolean() && aggExp.getType() != DataTypeManager.DefaultDataClasses.BOOLEAN) {
+ } else if (obj.isBoolean() && aggExps[0].getType() != DataTypeManager.DefaultDataClasses.BOOLEAN) {
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_boolean", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
}
}
- if((obj.isDistinct() || aggregateFunction == Type.MIN || aggregateFunction == Type.MAX) && DataTypeManager.isNonComparable(DataTypeManager.getDataTypeName(aggExp.getType()))) {
+ if((obj.isDistinct() || aggregateFunction == Type.MIN || aggregateFunction == Type.MAX) && DataTypeManager.isNonComparable(DataTypeManager.getDataTypeName(aggExps[0].getType()))) {
handleValidationError(QueryPlugin.Util.getString("AggregateValidationVisitor.non_comparable", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
}
if(obj.isEnhancedNumeric()) {
- if (!Number.class.isAssignableFrom(aggExp.getType())) {
+ if (!Number.class.isAssignableFrom(aggExps[0].getType())) {
handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0041", new Object[] {aggregateFunction, obj}), obj); //$NON-NLS-1$
}
if (obj.isDistinct()) {
@@ -1018,7 +1020,7 @@
if (obj.getAggregateFunction() != Type.TEXTAGG) {
return;
}
- TextLine tl = (TextLine)obj.getExpression();
+ TextLine tl = (TextLine)aggExps[0];
if (tl.isIncludeHeader()) {
validateDerivedColumnNames(obj, tl.getExpressions());
}
Modified: trunk/engine/src/main/resources/org/teiid/query/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/main/resources/org/teiid/query/i18n.properties 2012-03-29 01:43:03 UTC (rev 3956)
@@ -1001,8 +1001,6 @@
TEIID30410=Parse Exception occurs for executing: {0} {1}
TEIID30413=Unable to evaluate {0}: expected Properties for command payload but got object of type {1}
TEIID30416=Expected a java.sql.Array, or java array type, but got: {0}
-TEIID30425=Unable to compute aggregate function {0} on data of type {1}
-TEIID30426=Unable to compute aggregate function {0} on data of type {1}
TEIID30431={0} has invalid character: {1}
TEIID30449=Invalid escape sequence "{0}" with escape character "{1}"
TEIID30451=Unable to evaluate {0}: {1}
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestDuplicateFilter.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestDuplicateFilter.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestDuplicateFilter.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -22,62 +22,54 @@
package org.teiid.query.processor.relational;
+import static org.junit.Assert.*;
+
import java.util.Arrays;
+import org.junit.Test;
import org.teiid.common.buffer.BufferManager;
import org.teiid.common.buffer.BufferManagerFactory;
import org.teiid.core.TeiidComponentException;
import org.teiid.core.TeiidProcessingException;
import org.teiid.core.types.DataTypeManager;
import org.teiid.query.function.aggregate.Count;
-import org.teiid.query.processor.relational.SortingFilter;
import org.teiid.query.sql.symbol.ElementSymbol;
-import junit.framework.TestCase;
-
-
/**
*/
-public class TestDuplicateFilter extends TestCase {
+public class TestDuplicateFilter {
- /**
- * Constructor for TestDuplicateFilter.
- * @param arg0
- */
- public TestDuplicateFilter(String arg0) {
- super(arg0);
- }
-
- public void helpTestDuplicateFilter(Object[] input, Class dataType, int expected) throws TeiidComponentException, TeiidProcessingException {
+ public void helpTestDuplicateFilter(Object[] input, Class<?> dataType, int expected) throws TeiidComponentException, TeiidProcessingException {
BufferManager mgr = BufferManagerFactory.getStandaloneBufferManager();
SortingFilter filter = new SortingFilter(new Count(), mgr, "test", true); //$NON-NLS-1$
- filter.initialize(dataType, dataType);
+ filter.initialize(dataType, new Class[] {dataType});
ElementSymbol element = new ElementSymbol("val"); //$NON-NLS-1$
element.setType(dataType);
filter.setElements(Arrays.asList(element));
+ filter.setArgIndexes(new int[] {0});
filter.reset();
// Add inputs
for(int i=0; i<input.length; i++) {
- filter.addInputDirect(input[i], null);
+ filter.addInputDirect(Arrays.asList(input[i]));
}
Integer actual = (Integer) filter.getResult();
assertEquals("Did not get expected number of results", expected, actual.intValue()); //$NON-NLS-1$
}
- public void testNoInputs() throws Exception {
+ @Test public void testNoInputs() throws Exception {
helpTestDuplicateFilter(new Object[0], DataTypeManager.DefaultDataClasses.STRING, 0);
}
- public void testSmall() throws Exception {
+ @Test public void testSmall() throws Exception {
Object[] input = new Object[] { "a", "b", "a", "c", "a", "c", "c", "f" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$
helpTestDuplicateFilter(input, DataTypeManager.DefaultDataClasses.STRING, 4);
}
- public void testBig() throws Exception {
+ @Test public void testBig() throws Exception {
int NUM_VALUES = 10000;
int NUM_OUTPUT = 200;
Object[] input = new Object[NUM_VALUES];
Modified: trunk/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java 2012-03-28 15:29:46 UTC (rev 3955)
+++ trunk/engine/src/test/java/org/teiid/query/processor/relational/TestGroupingNode.java 2012-03-29 01:43:03 UTC (rev 3956)
@@ -174,7 +174,7 @@
AggregateFunction[] functions = node.getFunctions();
AggregateFunction countDist = functions[5];
SortingFilter dup = (SortingFilter)countDist;
- assertEquals(DataTypeManager.DefaultDataClasses.INTEGER, ((ElementSymbol)dup.getElements().get(0)).getType());
+ assertEquals(DataTypeManager.DefaultDataClasses.INTEGER, dup.getElements().get(0).getType());
}
@Test public void test2() throws Exception {
12 years, 9 months
teiid SVN: r3955 - in branches/7.7.x: api/src/test/java/org/teiid and 2 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-03-28 11:29:46 -0400 (Wed, 28 Mar 2012)
New Revision: 3955
Added:
branches/7.7.x/api/src/test/java/org/teiid/translator/
branches/7.7.x/api/src/test/java/org/teiid/translator/TestBaseDelegatingExecutionFactory.java
Modified:
branches/7.7.x/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java
branches/7.7.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java
branches/7.7.x/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
Log:
TEIID-1983 updating delegation for all properties
Modified: branches/7.7.x/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java
===================================================================
--- branches/7.7.x/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java 2012-03-28 15:25:43 UTC (rev 3954)
+++ branches/7.7.x/api/src/main/java/org/teiid/translator/BaseDelegatingExecutionFactory.java 2012-03-28 15:29:46 UTC (rev 3955)
@@ -59,6 +59,9 @@
return this.delegate;
}
+ /**
+ * Sets the delegate, will be called by Teiid after {@link #start()}
+ */
public void setDelegate(ExecutionFactory<F, C> delegate) {
this.delegate = delegate;
}
@@ -344,4 +347,86 @@
public int hashCode() {
return delegate.hashCode();
}
+ @Override
+ public boolean isCopyLobs() {
+ return delegate.isCopyLobs();
+ }
+ @Override
+ public boolean supportsArrayAgg() {
+ return delegate.supportsArrayAgg();
+ }
+ @Override
+ public boolean supportsElementaryOlapOperations() {
+ return delegate.supportsElementaryOlapOperations();
+ }
+ @Override
+ public boolean supportsFormatLiteral(String literal,
+ org.teiid.translator.ExecutionFactory.Format format) {
+ return delegate.supportsFormatLiteral(literal, format);
+ }
+ @Override
+ public boolean supportsLikeRegex() {
+ return delegate.supportsLikeRegex();
+ }
+ @Override
+ public boolean supportsOnlyFormatLiterals() {
+ return delegate.supportsOnlyFormatLiterals();
+ }
+ @Override
+ public boolean supportsOnlySingleTableGroupBy() {
+ return delegate.supportsOnlySingleTableGroupBy();
+ }
+ @Override
+ public boolean supportsSimilarTo() {
+ return delegate.supportsSimilarTo();
+ }
+ @Override
+ public boolean supportsWindowDistinctAggregates() {
+ return delegate.supportsWindowDistinctAggregates();
+ }
+ @Override
+ public boolean supportsWindowOrderByWithAggregates() {
+ return delegate.supportsWindowOrderByWithAggregates();
+ }
+ @Override
+ public int getMaxInCriteriaSize() {
+ return delegate.getMaxInCriteriaSize();
+ }
+ @Override
+ public org.teiid.translator.ExecutionFactory.SupportedJoinCriteria getSupportedJoinCriteria() {
+ return delegate.getSupportedJoinCriteria();
+ }
+ @Override
+ public boolean requiresCriteria() {
+ return delegate.requiresCriteria();
+ }
+ @Override
+ public boolean supportsFullOuterJoins() {
+ return delegate.supportsFullOuterJoins();
+ }
+ @Override
+ public boolean supportsInnerJoins() {
+ return delegate.supportsInnerJoins();
+ }
+ @Override
+ public boolean supportsOrderBy() {
+ return delegate.supportsOrderBy();
+ }
+ @Override
+ public boolean supportsOuterJoins() {
+ return delegate.supportsOuterJoins();
+ }
+ @Override
+ public boolean supportsSelectDistinct() {
+ return delegate.supportsSelectDistinct();
+ }
+
+ @Override
+ public int getMaxDependentInPredicates() {
+ return delegate.getMaxDependentInPredicates();
+ }
+ @Override
+ public boolean supportsAdvancedOlapOperations() {
+ return delegate.supportsAdvancedOlapOperations();
+ }
}
Modified: branches/7.7.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java
===================================================================
--- branches/7.7.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2012-03-28 15:25:43 UTC (rev 3954)
+++ branches/7.7.x/api/src/main/java/org/teiid/translator/ExecutionFactory.java 2012-03-28 15:29:46 UTC (rev 3955)
@@ -276,7 +276,7 @@
* @since 3.1 SP2
*/
@TranslatorProperty(display="Supports Select Distinct", description="True, if this connector supports SELECT DISTINCT", advanced=true)
- public final boolean supportsSelectDistinct() {
+ public boolean supportsSelectDistinct() {
return supportsSelectDistinct;
}
@@ -308,7 +308,7 @@
* @since 6.1.0
*/
@TranslatorProperty(display="Supported Join Criteria", description="Returns one of any, theta, equi, or key", advanced=true)
- public final SupportedJoinCriteria getSupportedJoinCriteria() {
+ public SupportedJoinCriteria getSupportedJoinCriteria() {
return supportedJoinCriteria;
}
@@ -322,7 +322,7 @@
* @since 6.1.0
*/
@TranslatorProperty(display="Supports Inner Joins", description="True, if this connector supports inner joins", advanced=true)
- public final boolean supportsInnerJoins() {
+ public boolean supportsInnerJoins() {
return supportsInnerJoins;
}
@@ -345,7 +345,7 @@
* @since 3.1 SP2
*/
@TranslatorProperty(display="Supports Outer Joins", description="True, if this connector supports outer joins", advanced=true)
- public final boolean supportsOuterJoins() {
+ public boolean supportsOuterJoins() {
return supportsOuterJoins;
}
@@ -358,7 +358,7 @@
* @since 3.1 SP2
*/
@TranslatorProperty(display="Supports Full Outer Joins", description="True, if this connector supports full outer joins", advanced=true)
- public final boolean supportsFullOuterJoins() {
+ public boolean supportsFullOuterJoins() {
return supportsFullOuterJoins;
}
@@ -490,7 +490,7 @@
* @since 3.1 SP2
*/
@TranslatorProperty(display="Supports ORDER BY", description="True, if this connector supports ORDER BY", advanced=true)
- public final boolean supportsOrderBy() {
+ public boolean supportsOrderBy() {
return supportsOrderBy;
}
@@ -718,7 +718,7 @@
* @since 5.0
*/
@TranslatorProperty(display="Max number of IN predicate entries", advanced=true)
- public final int getMaxInCriteriaSize() {
+ public int getMaxInCriteriaSize() {
return maxInSize;
}
@@ -788,7 +788,7 @@
* @since 6.0
*/
@TranslatorProperty(display="Requries Criteria", description="True, if this connector requires criteria on source queries", advanced=true)
- public final boolean requiresCriteria() {
+ public boolean requiresCriteria() {
return requiresCriteria;
}
Added: branches/7.7.x/api/src/test/java/org/teiid/translator/TestBaseDelegatingExecutionFactory.java
===================================================================
--- branches/7.7.x/api/src/test/java/org/teiid/translator/TestBaseDelegatingExecutionFactory.java (rev 0)
+++ branches/7.7.x/api/src/test/java/org/teiid/translator/TestBaseDelegatingExecutionFactory.java 2012-03-28 15:29:46 UTC (rev 3955)
@@ -0,0 +1,40 @@
+/*
+ * 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.translator;
+
+import static org.junit.Assert.*;
+
+import java.lang.reflect.Method;
+
+import org.junit.Test;
+
+public class TestBaseDelegatingExecutionFactory {
+
+ @Test public void testMethodOverrides() {
+ Method[] methods = ExecutionFactory.class.getDeclaredMethods();
+ Method[] proxyMethods = BaseDelegatingExecutionFactory.class.getDeclaredMethods();
+ //excluding the setter methods the counts should be equal
+ assertEquals(methods.length - 9, proxyMethods.length);
+ }
+
+}
Property changes on: branches/7.7.x/api/src/test/java/org/teiid/translator/TestBaseDelegatingExecutionFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/7.7.x/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml
===================================================================
--- branches/7.7.x/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2012-03-28 15:25:43 UTC (rev 3954)
+++ branches/7.7.x/documentation/developer-guide/src/main/docbook/en-US/content/translator-api.xml 2012-03-28 15:29:46 UTC (rev 3955)
@@ -1570,7 +1570,7 @@
<title>Delegating Translator</title>
<para>In some instances you may wish to extend several differnt kinds of translators with the same functionality.
Rather than create separate subclasses for each extension, you can use the delegating translator framework which provides you with a proxying mechanism to override translator behavior.
- It implement a delegating translator, your common translator logic should be added to a subclass of BaseDelegatingExecutionFactory where you can override any of the delegation methods to perform whatever logic you want.
+ Your common translator logic can be added to a subclass of <code>BaseDelegatingExecutionFactory</code> where you can override any of the delegation methods to perform whatever logic you want.
<example>
<title>Example BaseDelegatingExecutionFactory Subclass</title>
<programlisting language="JAVA"><![CDATA[@Translator(name="custom-delegator")
@@ -1605,7 +1605,8 @@
</translator>]]></programlisting>
<para>From the previous example the translator type is custom-delegator. Now my-translator can be used as a translator-name on a source and will proxy all calls to whatever delegate instance you assign.</para>
</example>
- <note><para>Note that the delegate instance can be any translator instance, whether configured by it's own translator entry or just the name of a standard translator type.</para></note>
+ <note><para>The delegate instance can be any translator instance whether configured by it's own translator entry or just the name of a standard translator type. Using a <code>BaseDelegatingExecutionFactory</code> by default means that standard override translator property settings on your instance will have no effect, since the underlying delegate is called instead.</para></note>
+ <para>You may also wish to use a different class hierarchy and instead make your custom translator just implement <code>DelegatingExecutionFactory</code> instead.</para>
</para>
</section>
12 years, 9 months
teiid SVN: r3954 - in branches/7.7.x/connectors: connector-salesforce/src/test/java and 6 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2012-03-28 11:25:43 -0400 (Wed, 28 Mar 2012)
New Revision: 3954
Added:
branches/7.7.x/connectors/connector-salesforce/src/test/java/org/
branches/7.7.x/connectors/connector-salesforce/src/test/java/org/teiid/
branches/7.7.x/connectors/connector-salesforce/src/test/java/org/teiid/resource/
branches/7.7.x/connectors/connector-salesforce/src/test/java/org/teiid/resource/adapter/
branches/7.7.x/connectors/connector-salesforce/src/test/java/org/teiid/resource/adapter/salesforce/
branches/7.7.x/connectors/connector-salesforce/src/test/java/org/teiid/resource/adapter/salesforce/TestSalesforceConnectionImpl.java
Modified:
branches/7.7.x/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java
branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java
branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java
Log:
TEIID-1978 correcting getDeleted and returned datetime/timestamp values
Modified: branches/7.7.x/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java
===================================================================
--- branches/7.7.x/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2012-03-24 14:27:37 UTC (rev 3953)
+++ branches/7.7.x/connectors/connector-salesforce/src/main/java/org/teiid/resource/adapter/salesforce/SalesforceConnectionImpl.java 2012-03-28 15:25:43 UTC (rev 3954)
@@ -45,88 +45,85 @@
import com.sforce.soap.partner.sobject.SObject;
public class SalesforceConnectionImpl extends BasicConnection implements SalesforceConnection {
- private SforceService sfService;
private Soap sfSoap;
- private SessionHeader sh;
- private CallOptions co;
- private SalesForceManagedConnectionFactory mcf;
private ObjectFactory partnerFactory = new ObjectFactory();
PackageVersionHeader pvHeader = partnerFactory.createPackageVersionHeader();
public SalesforceConnectionImpl(String username, String password, URL url, SalesForceManagedConnectionFactory mcf) throws ResourceException {
- this.mcf = mcf;
- login(username, password, url);
+ login(username, password, url, mcf);
}
+ protected SalesforceConnectionImpl(Soap soap) {
+ this.sfSoap = soap;
+ }
+
String getUserName() throws ResourceException {
- try {
- return sfSoap.getUserInfo().getUserName();
- } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ResourceException(e);
- }
+ try {
+ return sfSoap.getUserInfo().getUserName();
+ } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
+ throw new ResourceException(e);
+ }
}
Soap getBinding() {
return sfSoap;
}
- private void login(String username, String password, URL url) throws ResourceException {
- if (!isValid()) {
- LoginResult loginResult = null;
- sfSoap = null;
- sfService = null;
- co = new CallOptions();
- // This value identifies Teiid as a SF certified solution.
- // It was provided by SF and should not be changed.
- co.setClient("RedHat/MetaMatrix/"); //$NON-NLS-1$
-
- if(url == null) {
- throw new ResourceException("SalesForce URL is not specified, please provide a valid URL"); //$NON-NLS-1$
- }
+ private void login(String username, String password, URL url, SalesForceManagedConnectionFactory mcf) throws ResourceException {
+ LoginResult loginResult = null;
+ SforceService sfService = null;
+ SessionHeader sh = null;
+ CallOptions co = new CallOptions();
+ // This value identifies Teiid as a SF certified solution.
+ // It was provided by SF and should not be changed.
+ co.setClient("RedHat/MetaMatrix/"); //$NON-NLS-1$
+
+ if(url == null) {
+ throw new ResourceException("SalesForce URL is not specified, please provide a valid URL"); //$NON-NLS-1$
+ }
- Bus bus = BusFactory.getThreadDefaultBus();
- BusFactory.setThreadDefaultBus(mcf.getBus());
- try {
- sfService = new SforceService();
- sh = new SessionHeader();
-
- // Session Id must be passed in soapHeader - add the handler
- sfService.setHandlerResolver(new SalesforceHandlerResolver(sh));
-
- sfSoap = sfService.getSoap();
- ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url.toExternalForm());
- loginResult = sfSoap.login(username, password);
-
- // Set the SessionId after login, for subsequent calls
- sh.setSessionId(loginResult.getSessionId());
- } catch (LoginFault e) {
- throw new ResourceException(e);
- } catch (InvalidIdFault e) {
- throw new ResourceException(e);
- } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ResourceException(e);
- } finally {
- BusFactory.setThreadDefaultBus(bus);
- }
- LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username); //$NON-NLS-1$
-
- // Reset the SOAP endpoint to the returned server URL
- ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,loginResult.getServerUrl());
- // or maybe org.apache.cxf.message.Message.ENDPOINT_ADDRESS
- ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,Boolean.TRUE);
- // Set the timeout.
- //((BindingProvider)sfSoap).getRequestContext().put(JAXWSProperties.CONNECT_TIMEOUT, timeout);
-
+ Bus bus = BusFactory.getThreadDefaultBus();
+ BusFactory.setThreadDefaultBus(mcf.getBus());
+ try {
+ sfService = new SforceService();
+ sh = new SessionHeader();
- // Test the connection.
- try {
- sfSoap.getUserInfo();
- } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
- throw new ResourceException(e);
- }
+ // Session Id must be passed in soapHeader - add the handler
+ sfService.setHandlerResolver(new SalesforceHandlerResolver(sh));
+
+ sfSoap = sfService.getSoap();
+ ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url.toExternalForm());
+ loginResult = sfSoap.login(username, password);
+
+ // Set the SessionId after login, for subsequent calls
+ sh.setSessionId(loginResult.getSessionId());
+ } catch (LoginFault e) {
+ throw new ResourceException(e);
+ } catch (InvalidIdFault e) {
+ throw new ResourceException(e);
+ } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
+ throw new ResourceException(e);
+ } finally {
+ BusFactory.setThreadDefaultBus(bus);
}
+ LogManager.logTrace(LogConstants.CTX_CONNECTOR, "Login was successful for username " + username); //$NON-NLS-1$
+
+ // Reset the SOAP endpoint to the returned server URL
+ ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,loginResult.getServerUrl());
+ // or maybe org.apache.cxf.message.Message.ENDPOINT_ADDRESS
+ ((BindingProvider)sfSoap).getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY,Boolean.TRUE);
+ // Set the timeout.
+ //((BindingProvider)sfSoap).getRequestContext().put(JAXWSProperties.CONNECT_TIMEOUT, timeout);
+
+
+ // Test the connection.
+ try {
+ sfSoap.getUserInfo();
+ } catch (com.sforce.soap.partner.UnexpectedErrorFault e) {
+ throw new ResourceException(e);
+ }
}
@@ -313,12 +310,11 @@
result.setEarliestDateAvailable(deleted.getEarliestDateAvailable().toGregorianCalendar());
List<DeletedRecord> records = deleted.getDeletedRecords();
List<DeletedObject> resultRecords = new ArrayList<DeletedObject>();
- DeletedObject object;
- if(null !=records) {
- for (DeletedObject record : resultRecords) {
- object = new DeletedObject();
- object.setID(record.getID());
- object.setDeletedDate(record.getDeletedDate());
+ if(records != null) {
+ for (DeletedRecord record : records) {
+ DeletedObject object = new DeletedObject();
+ object.setID(record.getId());
+ object.setDeletedDate(record.getDeletedDate().toGregorianCalendar());
resultRecords.add(object);
}
}
Added: branches/7.7.x/connectors/connector-salesforce/src/test/java/org/teiid/resource/adapter/salesforce/TestSalesforceConnectionImpl.java
===================================================================
--- branches/7.7.x/connectors/connector-salesforce/src/test/java/org/teiid/resource/adapter/salesforce/TestSalesforceConnectionImpl.java (rev 0)
+++ branches/7.7.x/connectors/connector-salesforce/src/test/java/org/teiid/resource/adapter/salesforce/TestSalesforceConnectionImpl.java 2012-03-28 15:25:43 UTC (rev 3954)
@@ -0,0 +1,57 @@
+/*
+ * 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.resource.adapter.salesforce;
+
+import static org.junit.Assert.*;
+
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.teiid.translator.salesforce.execution.DeletedResult;
+
+import com.sforce.soap.partner.DeletedRecord;
+import com.sforce.soap.partner.GetDeletedResult;
+import com.sforce.soap.partner.Soap;
+
+@SuppressWarnings("nls")
+public class TestSalesforceConnectionImpl {
+
+ @Test public void testGetDeleted() throws Exception {
+ Soap soap = Mockito.mock(Soap.class);
+ GetDeletedResult gdr = new GetDeletedResult();
+ XMLGregorianCalendar c = DatatypeFactory.newInstance().newXMLGregorianCalendar();
+ gdr.setEarliestDateAvailable(c);
+ gdr.setLatestDateCovered(c);
+ DeletedRecord dr = new DeletedRecord();
+ dr.setDeletedDate(c);
+ dr.setId("id");
+ gdr.getDeletedRecords().add(dr);
+ Mockito.stub(soap.getDeleted("x", null, null)).toReturn(gdr);
+ SalesforceConnectionImpl sfci = new SalesforceConnectionImpl(soap);
+ DeletedResult result = sfci.getDeleted("x", null, null);
+ assertEquals(1, result.getResultRecords().size());
+ }
+
+}
Property changes on: branches/7.7.x/connectors/connector-salesforce/src/test/java/org/teiid/resource/adapter/salesforce/TestSalesforceConnectionImpl.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java
===================================================================
--- branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java 2012-03-24 14:27:37 UTC (rev 3953)
+++ branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetDeletedExecutionImpl.java 2012-03-28 15:25:43 UTC (rev 3954)
@@ -50,9 +50,6 @@
public class GetDeletedExecutionImpl implements SalesforceProcedureExecution {
- private static final int EARLIESTDATEAVAILABLE = 4;
- private static final int RESULT = 5;
-
private ProcedureExecutionParent parent;
private DeletedResult deletedResult;
@@ -108,23 +105,21 @@
}
}
- @SuppressWarnings("unchecked")
@Override
public List<?> getOutputParameterValues() {
- List result = new ArrayList();
- result.add(deletedResult.getLatestDateCovered());
- result.add(deletedResult.getEarliestDateAvailable());
+ List<Timestamp> result = new ArrayList<Timestamp>();
+ result.add(new Timestamp(deletedResult.getLatestDateCovered().getTimeInMillis()));
+ result.add(new Timestamp(deletedResult.getEarliestDateAvailable().getTimeInMillis()));
return result;
}
- @SuppressWarnings("unchecked")
@Override
public List<?> next() {
- List result = null;
+ List<Object> result = null;
if(deletedResult.getResultRecords() != null && resultIndex < deletedResult.getResultRecords().size()){
- result = new ArrayList(2);
+ result = new ArrayList<Object>(2);
result.add(deletedResult.getResultRecords().get(resultIndex).getID());
- result.add(deletedResult.getResultRecords().get(resultIndex).getDeletedDate());
+ result.add(new Timestamp(deletedResult.getResultRecords().get(resultIndex).getDeletedDate().getTimeInMillis()));
resultIndex++;
}
return result;
Modified: branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java
===================================================================
--- branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java 2012-03-24 14:27:37 UTC (rev 3953)
+++ branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/GetUpdatedExecutionImpl.java 2012-03-28 15:25:43 UTC (rev 3954)
@@ -24,7 +24,6 @@
import java.sql.Timestamp;
import java.util.ArrayList;
-import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
@@ -50,8 +49,6 @@
public class GetUpdatedExecutionImpl implements SalesforceProcedureExecution {
- private static final int RESULT = 4;
-
private ProcedureExecutionParent parent;
private UpdatedResult updatedResult;
private int idIndex = 0;
@@ -105,18 +102,17 @@
}
@Override
- public List<Calendar> getOutputParameterValues() {
- List<Calendar> result = new ArrayList<Calendar>(1);
- result.add(updatedResult.getLatestDateCovered());
+ public List<Timestamp> getOutputParameterValues() {
+ List<Timestamp> result = new ArrayList<Timestamp>(1);
+ result.add(new Timestamp(updatedResult.getLatestDateCovered().getTimeInMillis()));
return result;
}
- @SuppressWarnings("unchecked")
@Override
- public List next() {
- List result = null;
+ public List<?> next() {
+ List<Object> result = null;
if(updatedResult.getIDs() != null && idIndex < updatedResult.getIDs().size()){
- result = new ArrayList(1);
+ result = new ArrayList<Object>(1);
result.add(updatedResult.getIDs().get(idIndex));
idIndex++;
}
Modified: branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java
===================================================================
--- branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java 2012-03-24 14:27:37 UTC (rev 3953)
+++ branches/7.7.x/connectors/translator-salesforce/src/main/java/org/teiid/translator/salesforce/execution/ProcedureExecutionParentImpl.java 2012-03-28 15:25:43 UTC (rev 3954)
@@ -26,15 +26,17 @@
import org.teiid.language.Call;
import org.teiid.metadata.RuntimeMetadata;
-import org.teiid.translator.TranslatorException;
import org.teiid.translator.DataNotAvailableException;
import org.teiid.translator.ExecutionContext;
import org.teiid.translator.ProcedureExecution;
+import org.teiid.translator.TranslatorException;
import org.teiid.translator.salesforce.SalesforceConnection;
public class ProcedureExecutionParentImpl implements ProcedureExecution, ProcedureExecutionParent {
+ public static final String GET_DELETED = "GetDeleted"; //$NON-NLS-1$
+ public static final String GET_UPDATED = "GetUpdated"; //$NON-NLS-1$
private Call command;
private ExecutionContext executionContext;
private RuntimeMetadata metadata;
@@ -75,9 +77,9 @@
if (name == null) {
name = getCommand().getProcedureName();
}
- if("GetUpdated".equalsIgnoreCase(name)) { //$NON-NLS-1$
+ if(GET_UPDATED.equalsIgnoreCase(name)) {
execution = new GetUpdatedExecutionImpl(this);
- } else if("GetDeleted".equalsIgnoreCase(name)) { //$NON-NLS-1$
+ } else if(GET_DELETED.equalsIgnoreCase(name)) {
execution = new GetDeletedExecutionImpl(this);
} else {
throw new AssertionError("Unknown procedure " + getCommand().getProcedureName() + " with name in source " + getCommand().getMetadataObject().getNameInSource()); //$NON-NLS-1$ //$NON-NLS-2$
12 years, 9 months
teiid SVN: r3953 - in branches/7.7.x/build: assembly and 1 other directories.
by teiid-commits@lists.jboss.org
Author: van.halbert
Date: 2012-03-24 10:27:37 -0400 (Sat, 24 Mar 2012)
New Revision: 3953
Added:
branches/7.7.x/build/assembly/console-jar.xml
Modified:
branches/7.7.x/build/assembly/jboss-container/dist.xml
branches/7.7.x/build/pom.xml
Log:
TEIID-1982 changed to repackage teiid-console.jar used in jboss kit admin console to contain the teiid-client.jar
Added: branches/7.7.x/build/assembly/console-jar.xml
===================================================================
--- branches/7.7.x/build/assembly/console-jar.xml (rev 0)
+++ branches/7.7.x/build/assembly/console-jar.xml 2012-03-24 14:27:37 UTC (rev 3953)
@@ -0,0 +1,36 @@
+<!--This script builds a JAR for the Embedded Server Installation -->
+<assembly>
+
+ <id>console</id>
+
+ <formats>
+ <format>jar</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <baseDirectory>teiid-client</baseDirectory>
+
+ <moduleSets>
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid:teiid-client</include>
+ <include>org.jboss.teiid:teiid-common-core</include>
+ <include>org.jboss.teiid:teiid-console</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>false</includeDependencies>
+ <unpack>true</unpack>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>:jar:*</include>
+ </includes>
+ </binaries>
+
+ </moduleSet>
+ </moduleSets>
+
+</assembly>
\ No newline at end of file
Modified: branches/7.7.x/build/assembly/jboss-container/dist.xml
===================================================================
--- branches/7.7.x/build/assembly/jboss-container/dist.xml 2012-03-24 14:23:27 UTC (rev 3952)
+++ branches/7.7.x/build/assembly/jboss-container/dist.xml 2012-03-24 14:27:37 UTC (rev 3953)
@@ -53,6 +53,16 @@
<directoryMode>0755</directoryMode>
</fileSet>
+ <!-- Include the JOPR plugin -->
+ <fileSet>
+ <directory>target</directory>
+ <includes>
+ <include>teiid-${version}-console.jar</include>
+ </includes>
+ <outputDirectory>deploy/admin-console.war/plugins</outputDirectory>
+ <fileMode>0644</fileMode>
+ </fileSet>
+
<!-- We may want to do this if including multiple doc types or languages
as the parent directory structure will be copied. However the parent
directory permissions still seem wrong.
@@ -206,7 +216,7 @@
</moduleSet>
<!-- Include the JOPR plugin -->
- <moduleSet>
+ <!--moduleSet>
<includeSubModules>true</includeSubModules>
<useAllReactorProjects>true</useAllReactorProjects>
@@ -221,6 +231,6 @@
<fileMode>0644</fileMode>
</binaries>
- </moduleSet>
+ </moduleSet-->
</moduleSets>
</assembly>
Modified: branches/7.7.x/build/pom.xml
===================================================================
--- branches/7.7.x/build/pom.xml 2012-03-24 14:23:27 UTC (rev 3952)
+++ branches/7.7.x/build/pom.xml 2012-03-24 14:27:37 UTC (rev 3953)
@@ -99,6 +99,7 @@
<descriptor>assembly/src.xml</descriptor>
<descriptor>assembly/docs.xml</descriptor>
<descriptor>assembly/client-jar.xml</descriptor>
+ <descriptor>assembly/console-jar.xml</descriptor>
<descriptor>assembly/jboss-container/dist.xml</descriptor>
<descriptor>assembly/adminshell/adminshell-dist.xml</descriptor>
</descriptors>
12 years, 9 months
teiid SVN: r3952 - in branches/7.4.x/build: assembly and 1 other directories.
by teiid-commits@lists.jboss.org
Author: van.halbert
Date: 2012-03-24 10:23:27 -0400 (Sat, 24 Mar 2012)
New Revision: 3952
Added:
branches/7.4.x/build/assembly/console-jar.xml
Modified:
branches/7.4.x/build/assembly/jboss-container/dist.xml
branches/7.4.x/build/pom.xml
Log:
TEIID-1982 changed to repackage teiid-console.jar used in jboss kit admin console to contain the teiid-client.jar
Added: branches/7.4.x/build/assembly/console-jar.xml
===================================================================
--- branches/7.4.x/build/assembly/console-jar.xml (rev 0)
+++ branches/7.4.x/build/assembly/console-jar.xml 2012-03-24 14:23:27 UTC (rev 3952)
@@ -0,0 +1,36 @@
+<!--This script builds a JAR for the Embedded Server Installation -->
+<assembly>
+
+ <id>console</id>
+
+ <formats>
+ <format>jar</format>
+ </formats>
+
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <baseDirectory>teiid-client</baseDirectory>
+
+ <moduleSets>
+ <moduleSet>
+ <includeSubModules>true</includeSubModules>
+ <useAllReactorProjects>true</useAllReactorProjects>
+
+ <includes>
+ <include>org.jboss.teiid:teiid-client</include>
+ <include>org.jboss.teiid:teiid-common-core</include>
+ <include>org.jboss.teiid:teiid-console</include>
+ </includes>
+
+ <binaries>
+ <includeDependencies>false</includeDependencies>
+ <unpack>true</unpack>
+ <outputDirectory></outputDirectory>
+ <includes>
+ <include>:jar:*</include>
+ </includes>
+ </binaries>
+
+ </moduleSet>
+ </moduleSets>
+
+</assembly>
\ No newline at end of file
Modified: branches/7.4.x/build/assembly/jboss-container/dist.xml
===================================================================
--- branches/7.4.x/build/assembly/jboss-container/dist.xml 2012-03-23 20:09:17 UTC (rev 3951)
+++ branches/7.4.x/build/assembly/jboss-container/dist.xml 2012-03-24 14:23:27 UTC (rev 3952)
@@ -53,6 +53,16 @@
<directoryMode>0755</directoryMode>
</fileSet>
+ <!-- Include the JOPR plugin -->
+ <fileSet>
+ <directory>target</directory>
+ <includes>
+ <include>teiid-${version}-console.jar</include>
+ </includes>
+ <outputDirectory>deploy/admin-console.war/plugins</outputDirectory>
+ <fileMode>0644</fileMode>
+ </fileSet>
+
<!-- We may want to do this if including multiple doc types or languages
as the parent directory structure will be copied. However the parent
directory permissions still seem wrong.
@@ -205,7 +215,7 @@
</moduleSet>
<!-- Include the JOPR plugin -->
- <moduleSet>
+ <!--moduleSet>
<includeSubModules>true</includeSubModules>
<useAllReactorProjects>true</useAllReactorProjects>
@@ -220,6 +230,6 @@
<fileMode>0644</fileMode>
</binaries>
- </moduleSet>
+ </moduleSet-->
</moduleSets>
</assembly>
Modified: branches/7.4.x/build/pom.xml
===================================================================
--- branches/7.4.x/build/pom.xml 2012-03-23 20:09:17 UTC (rev 3951)
+++ branches/7.4.x/build/pom.xml 2012-03-24 14:23:27 UTC (rev 3952)
@@ -99,12 +99,12 @@
<descriptor>assembly/src.xml</descriptor>
<descriptor>assembly/docs.xml</descriptor>
<descriptor>assembly/client-jar.xml</descriptor>
+ <descriptor>assembly/console-jar.xml</descriptor>
<descriptor>assembly/jboss-container/dist.xml</descriptor>
<descriptor>assembly/adminshell/adminshell-dist.xml</descriptor>
</descriptors>
</configuration>
- </plugin>
-
+ </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
12 years, 9 months
teiid SVN: r3951 - in trunk: admin/src/main/java/org/teiid/adminapi/impl and 4 other directories.
by teiid-commits@lists.jboss.org
Author: rareddy
Date: 2012-03-23 16:09:17 -0400 (Fri, 23 Mar 2012)
New Revision: 3951
Added:
trunk/admin/src/main/java/org/teiid/adminapi/DomainAware.java
Removed:
trunk/build/kits/jboss-as7/domain/configuration/host-teiid.xml
Modified:
trunk/admin/src/main/java/org/teiid/adminapi/Admin.java
trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java
trunk/admin/src/main/java/org/teiid/adminapi/CacheStatistics.java
trunk/admin/src/main/java/org/teiid/adminapi/Request.java
trunk/admin/src/main/java/org/teiid/adminapi/Session.java
trunk/admin/src/main/java/org/teiid/adminapi/Transaction.java
trunk/admin/src/main/java/org/teiid/adminapi/Translator.java
trunk/admin/src/main/java/org/teiid/adminapi/VDB.java
trunk/admin/src/main/java/org/teiid/adminapi/WorkerPoolStatistics.java
trunk/admin/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java
trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml
trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java
trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java
Log:
TEIID-1981: Admin API changes to handle the domain mode results.
Modified: trunk/admin/src/main/java/org/teiid/adminapi/Admin.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/Admin.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/admin/src/main/java/org/teiid/adminapi/Admin.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -80,7 +80,7 @@
* same name in the Collection but they will differ by VDB version.
* @throws AdminException
*/
- Set<? extends VDB> getVDBs() throws AdminException;
+ Collection<? extends VDB> getVDBs() throws AdminException;
/**
* Get the VDB
@@ -110,10 +110,10 @@
/**
* Get the Worker Pool statistics in runtime engine.
*
- * @return {@link WorkerPoolStatistics}
+ * @return Collection of {@link WorkerPoolStatistics}
* @throws AdminException
*/
- WorkerPoolStatistics getWorkerPoolStats() throws AdminException;
+ Collection<? extends WorkerPoolStatistics> getWorkerPoolStats() throws AdminException;
/**
* Get the Caches that correspond to the specified identifier pattern
@@ -182,10 +182,10 @@
/**
* Get the Cache Statistics for the given type
* @param cacheType Cache Type
- * @return {@link CacheStatistics}
+ * @return Collection of {@link CacheStatistics}
* @throws AdminException
*/
- CacheStatistics getCacheStats(String cacheType) throws AdminException;
+ Collection<? extends CacheStatistics> getCacheStats(String cacheType) throws AdminException;
/**
* Terminate the Session
Modified: trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/admin/src/main/java/org/teiid/adminapi/AdminFactory.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -59,6 +59,7 @@
import org.jboss.dmr.ModelType;
import org.teiid.adminapi.PropertyDefinition.RestartType;
import org.teiid.adminapi.VDB.ConnectionType;
+import org.teiid.adminapi.impl.AdminObjectImpl;
import org.teiid.adminapi.impl.MetadataMapper;
import org.teiid.adminapi.impl.PropertyDefinitionMetadata;
import org.teiid.adminapi.impl.VDBMetadataMapper;
@@ -296,41 +297,42 @@
public ModelNode describe(ModelNode node) {
return null;
}
- }
+ }
- public List<String> getInstalledJDBCDrivers() throws AdminException {
- DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
- final ModelNode request;
+ public Set<String> getInstalledJDBCDrivers() throws AdminException {
+ HashSet<String> driverList = new HashSet<String>();
+ driverList.addAll(getChildNodeNames("datasources", "jdbc-driver"));
+ final ModelNode request = buildRequest("datasources", "installed-drivers-list");
try {
- builder.addNode("subsystem", "datasources"); //$NON-NLS-1$ //$NON-NLS-2$
- builder.setOperationName("installed-drivers-list");
- request = builder.buildRequest();
-
- } catch (OperationFormatException e) {
- throw new IllegalStateException("Failed to build operation", e); //$NON-NLS-1$
- }
-
- try {
ModelNode outcome = this.connection.execute(request);
- if (!Util.isSuccess(outcome)) {
- throw new AdminProcessingException(AdminPlugin.Event.TEIID70001, Util.getFailureDescription(outcome));
+ if (Util.isSuccess(outcome)) {
+ List<String> drivers = getList(outcome, new AbstractMetadatMapper() {
+ @Override
+ public String unwrap(ModelNode node) {
+ if (node.hasDefined("driver-name")) {
+ return node.get("driver-name").asString();
+ }
+ return null;
+ }
+ });
+ driverList.addAll(drivers);
}
- List<String> drivers = getList(outcome, new AbstractMetadatMapper() {
- @Override
- public String unwrap(ModelNode node) {
- if (node.hasDefined("driver-name")) {
- return node.get("driver-name").asString();
- }
- return null;
- }
- });
- return drivers;
- } catch (IOException e) {
- throw new AdminProcessingException(AdminPlugin.Event.TEIID70002, e);
+ } catch (Exception e) {
+ // in domain mode this method does not exist; this is expected in some domain mode.
}
- }
+ return driverList;
+ }
+
+
+ public String getProfileName() throws AdminProcessingException {
+ if (!this.domainMode) {
+ return null;
+ }
+ return getChildNodeNames(null, "profile").get(0);
+ }
+
@Override
public void createDataSource(String deploymentName, String templateName, Properties properties) throws AdminException {
deploymentName = removeJavaContext(deploymentName);
@@ -346,7 +348,7 @@
return;
}
- List<String> drivers = getInstalledJDBCDrivers();
+ Set<String> drivers = getInstalledJDBCDrivers();
if (!drivers.contains(templateName)) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70004, AdminPlugin.Util.gs(AdminPlugin.Event.TEIID70004, templateName));
}
@@ -354,6 +356,14 @@
DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
ModelNode request;
try {
+
+ if (this.domainMode) {
+ String profile = getProfileName();
+ if (profile != null) {
+ builder.addNode("profile",profile);
+ }
+ }
+
builder.addNode("subsystem", "datasources"); //$NON-NLS-1$ //$NON-NLS-2$
builder.addNode("data-source", deploymentName); //$NON-NLS-1$
@@ -461,6 +471,13 @@
final ModelNode request;
try {
+ if (this.domainMode) {
+ String profile = getProfileName();
+ if (profile != null) {
+ builder.addNode("profile",profile);
+ }
+ }
+
builder.addNode("subsystem", subsystem[0]); //$NON-NLS-1$ //$NON-NLS-2$
builder.addNode(subsystem[1], deployedName);
if (connFactory) {
@@ -587,16 +604,12 @@
}
@Override
- public CacheStatistics getCacheStats(String cacheType) throws AdminException {
+ public Collection<? extends CacheStatistics> getCacheStats(String cacheType) throws AdminException {
final ModelNode request = buildRequest("teiid", "cache-statistics", "cache-type", cacheType);//$NON-NLS-1$ //$NON-NLS-2$
try {
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
- if (outcome.hasDefined("result")) {
- ModelNode result = outcome.get("result");
- return VDBMetadataMapper.CacheStatisticsMetadataMapper.INSTANCE.unwrap(result);
- }
-
+ return getDomainAwareList(outcome, VDBMetadataMapper.CacheStatisticsMetadataMapper.INSTANCE);
}
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70013, e);
@@ -622,7 +635,7 @@
return Collections.emptyList();
}
- private List<String> getChildNodeNames(String subsystem, String childNode) throws AdminException {
+ private List<String> getChildNodeNames(String subsystem, String childNode) throws AdminProcessingException {
final ModelNode request = buildRequest(subsystem, "read-children-names", "child-type", childNode);//$NON-NLS-1$
try {
ModelNode outcome = this.connection.execute(request);
@@ -703,43 +716,19 @@
*/
private Set<String> getDeployedResourceAdapterNames() throws AdminException {
Set<String> templates = new HashSet<String>();
- final ModelNode request = buildRequest("resource-adapters", "read-children-names", "child-type", "resource-adapter");//$NON-NLS-1$
- try {
- ModelNode outcome = this.connection.execute(request);
- if (Util.isSuccess(outcome)) {
- templates.addAll(Util.getList(outcome));
- return templates;
- }
- } catch (Exception e) {
- throw new AdminProcessingException(AdminPlugin.Event.TEIID70018, e);
- }
- return Collections.emptySet();
+ templates.addAll(getChildNodeNames("resource-adapters", "resource-adapter"));
+ return templates;
}
// :read-children-names(child-type=deployment)
private Set<String> getAvailableResourceAdapterNames() throws AdminException {
+ List<String> deployments = getChildNodeNames(null, "deployment");
Set<String> templates = new HashSet<String>();
- DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
- final ModelNode request;
- try {
- builder.setOperationName("read-children-names");
- builder.addProperty("child-type", "deployment");
- request = builder.buildRequest();
- } catch (OperationFormatException e) {
- throw new IllegalStateException("Failed to build operation", e); //$NON-NLS-1$
- }
-
- try {
- ModelNode outcome = this.connection.execute(request);
- List<String> deployments = Util.getList(outcome);
- for (String deployment:deployments) {
- if (deployment.endsWith(".rar")) {
- templates.add(deployment);
- }
- }
- } catch (IOException e) {
- throw new AdminProcessingException(AdminPlugin.Event.TEIID70019, e);
- }
+ for (String deployment:deployments) {
+ if (deployment.endsWith(".rar")) {
+ templates.add(deployment);
+ }
+ }
return templates;
}
@@ -752,16 +741,13 @@
}
@Override
- public WorkerPoolStatistics getWorkerPoolStats() throws AdminException {
+ public Collection<? extends WorkerPoolStatistics> getWorkerPoolStats() throws AdminException {
final ModelNode request = buildRequest("teiid", "workerpool-statistics");//$NON-NLS-1$
if (request != null) {
try {
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
- if (outcome.hasDefined("result")) {
- ModelNode result = outcome.get("result");
- return VDBMetadataMapper.WorkerPoolStatisticsMetadataMapper.INSTANCE.unwrap(result);
- }
+ return getDomainAwareList(outcome, VDBMetadataMapper.WorkerPoolStatisticsMetadataMapper.INSTANCE);
}
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70020, e);
@@ -794,7 +780,7 @@
try {
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
- return getList(outcome, RequestMetadataMapper.INSTANCE);
+ return getDomainAwareList(outcome, RequestMetadataMapper.INSTANCE);
}
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70023, e);
@@ -810,7 +796,7 @@
try {
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
- return getList(outcome, RequestMetadataMapper.INSTANCE);
+ return getDomainAwareList(outcome, RequestMetadataMapper.INSTANCE);
}
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70024, e);
@@ -826,7 +812,7 @@
try {
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
- return getList(outcome, SessionMetadataMapper.INSTANCE);
+ return getDomainAwareList(outcome, SessionMetadataMapper.INSTANCE);
}
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70025, e);
@@ -848,6 +834,12 @@
Set<String> resourceAdapters = getAvailableResourceAdapterNames();
if (resourceAdapters.contains(templateName)) {
DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
+ if (this.domainMode) {
+ String profile = getProfileName();
+ if (profile != null) {
+ builder.addNode("profile",profile);
+ }
+ }
builder.addNode("subsystem", "teiid"); //$NON-NLS-1$ //$NON-NLS-2$
builder.setOperationName("read-rar-description"); //$NON-NLS-1$
builder.addProperty("rar-name", templateName);
@@ -987,7 +979,7 @@
try {
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
- return getList(outcome, TransactionMetadataMapper.INSTANCE);
+ return getDomainAwareList(outcome, TransactionMetadataMapper.INSTANCE);
}
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70028, e);
@@ -1055,7 +1047,7 @@
try {
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
- return getList(outcome, VDBMetadataMapper.VDBTranslatorMetaDataMapper.INSTANCE);
+ return getDomainAwareList(outcome, VDBMetadataMapper.VDBTranslatorMetaDataMapper.INSTANCE);
}
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70034, e);
@@ -1064,11 +1056,19 @@
return Collections.emptyList();
}
- private ModelNode buildRequest(String subsystem, String operationName, String... params) {
+ private ModelNode buildRequest(String subsystem, String operationName, String... params) throws AdminProcessingException {
DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder();
final ModelNode request;
try {
- builder.addNode("subsystem", subsystem); //$NON-NLS-1$ //$NON-NLS-2$
+ if (subsystem != null) {
+ if (this.domainMode) {
+ String profile = getProfileName();
+ if (profile != null) {
+ builder.addNode("profile",profile);
+ }
+ }
+ builder.addNode("subsystem", subsystem); //$NON-NLS-1$ //$NON-NLS-2$
+ }
builder.setOperationName(operationName);
request = builder.buildRequest();
if (params != null && params.length % 2 == 0) {
@@ -1082,6 +1082,41 @@
return request;
}
+ private <T> List<T> getDomainAwareList(ModelNode operationResult, MetadataMapper<T> mapper) {
+ if (this.domainMode) {
+ List<T> returnList = new ArrayList<T>();
+
+ ModelNode serverGroups = operationResult.get("server-groups");
+ Set<String> serverGroupNames = serverGroups.keys();
+ for (String serverGroupName:serverGroupNames) {
+ ModelNode serverGroup = serverGroups.get(serverGroupName);
+ Set<String> serverNames = serverGroup.keys();
+ for (String serverName:serverNames) {
+ ModelNode server = serverGroup.get(serverName);
+ String hostName = server.get("host").asString();
+ if (server.get("response", "outcome").asString().equals(Util.SUCCESS)) {
+ ModelNode result = server.get("response", "result");
+ if (result.isDefined()) {
+ List<ModelNode> nodeList = result.asList(); //$NON-NLS-1$
+ for(ModelNode node : nodeList) {
+ T anObj = mapper.unwrap(node);
+ if (anObj instanceof DomainAware) {
+ ((AdminObjectImpl)anObj).setServerGroup(serverGroupName);
+ ((AdminObjectImpl)anObj).setServerName(serverName);
+ ((AdminObjectImpl)anObj).setHostName(hostName);
+ }
+ returnList.add(anObj);
+ }
+
+ }
+ }
+ }
+ }
+ return returnList;
+ }
+ return getList(operationResult, mapper);
+ }
+
private <T> List<T> getList(ModelNode operationResult, MetadataMapper<T> mapper) {
if(!operationResult.hasDefined("result")) //$NON-NLS-1$
return Collections.emptyList();
@@ -1097,21 +1132,8 @@
return list;
}
- private <T> Set<T> getSet(ModelNode operationResult, MetadataMapper<T> mapper) {
- if(!operationResult.hasDefined("result")) //$NON-NLS-1$
- return Collections.emptySet();
+
- List<ModelNode> nodeList = operationResult.get("result").asList(); //$NON-NLS-1$
- if(nodeList.isEmpty())
- return Collections.emptySet();
-
- Set<T> list = new HashSet<T>(nodeList.size());
- for(ModelNode node : nodeList) {
- list.add(mapper.unwrap(node));
- }
- return list;
- }
-
@Override
public VDB getVDB(String vdbName, int vdbVersion) throws AdminException {
final ModelNode request = buildRequest("teiid", "get-vdb", "vdb-name", vdbName, "vdb-version", String.valueOf(vdbVersion));//$NON-NLS-1$
@@ -1133,18 +1155,18 @@
}
@Override
- public Set<? extends VDB> getVDBs() throws AdminException {
+ public List<? extends VDB> getVDBs() throws AdminException {
final ModelNode request = buildRequest("teiid", "list-vdbs");//$NON-NLS-1$ //$NON-NLS-2$
try {
ModelNode outcome = this.connection.execute(request);
if (Util.isSuccess(outcome)) {
- return getSet(outcome, VDBMetadataMapper.INSTANCE);
+ return getDomainAwareList(outcome, VDBMetadataMapper.INSTANCE);
}
} catch (Exception e) {
throw new AdminProcessingException(AdminPlugin.Event.TEIID70036, e);
}
- return Collections.emptySet();
+ return Collections.emptyList();
}
@Override
Modified: trunk/admin/src/main/java/org/teiid/adminapi/CacheStatistics.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/CacheStatistics.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/admin/src/main/java/org/teiid/adminapi/CacheStatistics.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -21,7 +21,7 @@
*/
package org.teiid.adminapi;
-public interface CacheStatistics extends AdminObject {
+public interface CacheStatistics extends AdminObject, DomainAware {
double getHitRatio();
Added: trunk/admin/src/main/java/org/teiid/adminapi/DomainAware.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/DomainAware.java (rev 0)
+++ trunk/admin/src/main/java/org/teiid/adminapi/DomainAware.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -0,0 +1,48 @@
+/*
+ * 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.adminapi;
+
+/**
+ * The admin objects that implement this interface have domain information on them when
+ * Teiid is running in the domain mode.
+ */
+public interface DomainAware {
+
+ /**
+ * Server group that admin object belongs to
+ * @return
+ */
+ String getServerGroup();
+
+ /**
+ * Name of the Server that this admin object belongs to
+ * @return
+ */
+ String getServerName();
+
+
+ /**
+ * getHostName of the Server this admin object belongs to
+ * @return
+ */
+ String getHostName();
+}
Property changes on: trunk/admin/src/main/java/org/teiid/adminapi/DomainAware.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/admin/src/main/java/org/teiid/adminapi/Request.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/Request.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/admin/src/main/java/org/teiid/adminapi/Request.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -34,7 +34,7 @@
* <p>A request is identified by a numbers separated by '|'. usually in they are arranged
* in the pattern [session]|[request] or [session]|[request]|[source request] </p>
*/
-public interface Request extends AdminObject {
+public interface Request extends AdminObject, DomainAware {
public enum ProcessingState {
PROCESSING,
Modified: trunk/admin/src/main/java/org/teiid/adminapi/Session.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/Session.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/admin/src/main/java/org/teiid/adminapi/Session.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -28,7 +28,7 @@
*
* A user is allowed to have multiple sessions active simultaneously.
*/
-public interface Session extends AdminObject {
+public interface Session extends AdminObject, DomainAware {
/**
* Get the Last time Client has check to see if the server is still available
Modified: trunk/admin/src/main/java/org/teiid/adminapi/Transaction.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/Transaction.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/admin/src/main/java/org/teiid/adminapi/Transaction.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -23,7 +23,7 @@
package org.teiid.adminapi;
-public interface Transaction extends AdminObject {
+public interface Transaction extends AdminObject, DomainAware {
/**
* Get the session associated with the this transaction.
Modified: trunk/admin/src/main/java/org/teiid/adminapi/Translator.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/Translator.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/admin/src/main/java/org/teiid/adminapi/Translator.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -22,7 +22,7 @@
package org.teiid.adminapi;
-public interface Translator extends AdminObject{
+public interface Translator extends AdminObject, DomainAware {
public static final String EXECUTION_FACTORY_CLASS = "execution-factory-class"; //$NON-NLS-1$
public static final String TRANSLATOR_PROPERTY = "property"; //$NON-NLS-1$
Modified: trunk/admin/src/main/java/org/teiid/adminapi/VDB.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/VDB.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/admin/src/main/java/org/teiid/adminapi/VDB.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -38,7 +38,7 @@
*
* @since 4.3
*/
-public interface VDB extends AdminObject {
+public interface VDB extends AdminObject, DomainAware {
public static enum Status{INACTIVE, ACTIVE};
Modified: trunk/admin/src/main/java/org/teiid/adminapi/WorkerPoolStatistics.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/WorkerPoolStatistics.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/admin/src/main/java/org/teiid/adminapi/WorkerPoolStatistics.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -21,7 +21,7 @@
*/
package org.teiid.adminapi;
-public interface WorkerPoolStatistics extends AdminObject {
+public interface WorkerPoolStatistics extends AdminObject, DomainAware{
/**
* Current active thread count
Modified: trunk/admin/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java
===================================================================
--- trunk/admin/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/admin/src/main/java/org/teiid/adminapi/impl/AdminObjectImpl.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -39,6 +39,9 @@
private static final long serialVersionUID = -6381303538713462682L;
private String name;
+ private String serverGroup;
+ private String serverName;
+ private String hostName;
private ListOverMap<PropertyMetadata> properties = new ListOverMap<PropertyMetadata>(new KeyBuilder<PropertyMetadata>() {
private static final long serialVersionUID = 3687928367250819142L;
@@ -59,6 +62,30 @@
public void setName(String name) {
this.name = name;
}
+
+ public String getServerGroup() {
+ return this.serverGroup;
+ }
+
+ public String getServerName() {
+ return this.serverName;
+ }
+
+ public String getHostName() {
+ return this.hostName;
+ }
+
+ public void setServerGroup(String group) {
+ this.serverGroup = group;
+ }
+
+ public void setServerName(String name) {
+ this.serverName = name;
+ }
+
+ public void setHostName(String name) {
+ this.hostName = name;
+ }
@Override
public Properties getProperties() {
Modified: trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java
===================================================================
--- trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/adminshell/src/main/java/org/teiid/adminshell/AdminShell.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -218,18 +218,18 @@
}
@Doc(text = "Get all VDB instances")
- public static Set<? extends VDB> getVDBs() throws AdminException {
+ public static Collection<? extends VDB> getVDBs() throws AdminException {
return getAdmin().getVDBs();
}
@Doc(text = "Get thread pool statistics for Teiid")
- public static WorkerPoolStatistics getWorkerPoolStats()
+ public static Collection<? extends WorkerPoolStatistics> getWorkerPoolStats()
throws AdminException {
return getAdmin().getWorkerPoolStats();
}
@Doc(text = "Get cache statistics for given cache type")
- public static CacheStatistics getCacheStats(@Doc(text = "cacheType") String identifier)
+ public static Collection<? extends CacheStatistics> getCacheStats(@Doc(text = "cacheType") String identifier)
throws AdminException {
return getAdmin().getCacheStats(identifier);
}
Modified: trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/build/kits/jboss-as7/domain/configuration/domain-teiid.xml 2012-03-23 20:09:17 UTC (rev 3951)
@@ -194,647 +194,20 @@
<eviction strategy="NONE"/>
</replicated-cache>
</cache-container>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
- <subsystem xmlns="urn:jboss:domain:jca:1.1">
- <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
- <bean-validation enabled="false"/>
- <default-workmanager>
- <short-running-threads>
- <core-threads count="50"/>
- <queue-length count="50"/>
- <max-threads count="50"/>
- <keepalive-time time="10" unit="seconds"/>
- </short-running-threads>
- <long-running-threads>
- <core-threads count="50"/>
- <queue-length count="50"/>
- <max-threads count="50"/>
- <keepalive-time time="10" unit="seconds"/>
- </long-running-threads>
- </default-workmanager>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
- <subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="udp">
- <stack name="udp">
- <transport type="UDP" socket-binding="jgroups-udp" diagnostics-socket-binding="jgroups-diagnostics"/>
- <protocol type="PING"/>
- <protocol type="MERGE2"/>
- <protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
- <protocol type="FD"/>
- <protocol type="VERIFY_SUSPECT"/>
- <protocol type="BARRIER"/>
- <protocol type="pbcast.NAKACK"/>
- <protocol type="UNICAST2"/>
- <protocol type="pbcast.STABLE"/>
- <protocol type="pbcast.GMS"/>
- <protocol type="UFC"/>
- <protocol type="MFC"/>
- <protocol type="FRAG2"/>
- </stack>
- <stack name="tcp">
- <transport type="TCP" socket-binding="jgroups-tcp" diagnostics-socket-binding="jgroups-diagnostics"/>
- <protocol type="MPING" socket-binding="jgroups-mping"/>
- <protocol type="MERGE2"/>
- <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
- <protocol type="FD"/>
- <protocol type="VERIFY_SUSPECT"/>
- <protocol type="BARRIER"/>
- <protocol type="pbcast.NAKACK"/>
- <protocol type="UNICAST2"/>
- <protocol type="pbcast.STABLE"/>
- <protocol type="pbcast.GMS"/>
- <protocol type="UFC"/>
- <protocol type="MFC"/>
- <protocol type="FRAG2"/>
- </stack>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jmx:1.1">
- <show-model value="true"/>
- <remoting-connector/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jpa:1.0">
- <jpa default-datasource=""/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:mail:1.0">
- <mail-session jndi-name="java:jboss/mail/Default">
- <smtp-server outbound-socket-binding-ref="mail-smtp"/>
- </mail-session>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:modcluster:1.0">
- <mod-cluster-config advertise-socket="modcluster"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:naming:1.1"/>
- <subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy">
- <properties>
- <!-- Specifies the beginning start level of the framework -->
- <property name="org.osgi.framework.startlevel.beginning">1</property>
- </properties>
- <capabilities>
- <!-- modules registered with the OSGi layer on startup -->
- <capability name="javax.servlet.api:v25"/>
- <capability name="javax.transaction.api"/>
- <!-- bundles started in startlevel 1 -->
- <capability name="org.apache.felix.log" startlevel="1"/>
- <capability name="org.jboss.osgi.logging" startlevel="1"/>
- <capability name="org.apache.felix.configadmin" startlevel="1"/>
- <capability name="org.jboss.as.osgi.configadmin" startlevel="1"/>
- </capabilities>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
- <subsystem xmlns="urn:jboss:domain:remoting:1.1">
- <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>
- <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
- <subsystem xmlns="urn:jboss:domain:security:1.1">
- <security-domains>
- <security-domain name="other" cache-type="default">
- <authentication>
- <login-module code="Remoting" flag="optional">
- <module-option name="password-stacking" value="useFirstPass"/>
- </login-module>
- <login-module code="RealmUsersRoles" flag="required">
- <module-option name="usersProperties" value="${jboss.domain.config.dir}/application-users.properties"/>
- <module-option name="rolesProperties" value="${jboss.domain.config.dir}/application-roles.properties"/>
- <module-option name="realm" value="ApplicationRealm"/>
- <module-option name="password-stacking" value="useFirstPass"/>
- </login-module>
- </authentication>
- </security-domain>
- <security-domain name="jboss-web-policy" cache-type="default">
- <authorization>
- <policy-module code="Delegating" flag="required"/>
- </authorization>
- </security-domain>
- <security-domain name="jboss-ejb-policy" cache-type="default">
- <authorization>
- <policy-module code="Delegating" flag="required"/>
- </authorization>
- </security-domain>
- </security-domains>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:threads:1.1"/>
- <subsystem xmlns="urn:jboss:domain:transactions:1.1">
- <core-environment>
- <process-id>
- <uuid/>
- </process-id>
- </core-environment>
- <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
- <coordinator-environment default-timeout="300"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
- <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
- <virtual-server name="default-host" enable-welcome-root="true">
- <alias name="localhost"/>
- <alias name="example.com"/>
- </virtual-server>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:webservices:1.1">
- <modify-wsdl-address>true</modify-wsdl-address>
- <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
- <endpoint-config name="Standard-Endpoint-Config"/>
- <endpoint-config name="Recording-Endpoint-Config">
- <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
- <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
- </pre-handler-chain>
- </endpoint-config>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:weld:1.0"/>
- </profile>
-
- <profile name="full">
- <subsystem xmlns="urn:jboss:domain:logging:1.1">
- <console-handler name="CONSOLE">
- <level name="INFO"/>
- <formatter>
- <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
- </formatter>
- </console-handler>
- <periodic-rotating-file-handler name="FILE">
- <formatter>
- <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
- </formatter>
- <file relative-to="jboss.server.log.dir" path="server.log"/>
- <suffix value=".yyyy-MM-dd"/>
- <append value="true"/>
- </periodic-rotating-file-handler>
- <logger category="com.arjuna">
- <level name="WARN"/>
- </logger>
- <logger category="org.apache.tomcat.util.modeler">
- <level name="WARN"/>
- </logger>
- <logger category="sun.rmi">
- <level name="WARN"/>
- </logger>
- <logger category="jacorb">
- <level name="WARN"/>
- </logger>
- <logger category="jacorb.config">
- <level name="ERROR"/>
- </logger>
- <root-logger>
- <level name="INFO"/>
- <handlers>
- <handler name="CONSOLE"/>
- <handler name="FILE"/>
- </handlers>
- </root-logger>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:cmp:1.0"/>
- <subsystem xmlns="urn:jboss:domain:configadmin:1.0"/>
- <subsystem xmlns="urn:jboss:domain:datasources:1.0">
- <datasources>
- <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
- <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
- <driver>h2</driver>
- <security>
- <user-name>sa</user-name>
- <password>sa</password>
- </security>
- </datasource>
- <drivers>
- <driver name="h2" module="com.h2database.h2">
- <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
- </driver>
- </drivers>
- </datasources>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:ee:1.0"/>
- <subsystem xmlns="urn:jboss:domain:ejb3:1.2">
- <session-bean>
- <stateless>
- <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
- </stateless>
- <stateful default-access-timeout="5000" cache-ref="simple"/>
- <singleton default-access-timeout="5000"/>
- </session-bean>
- <mdb>
- <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
- <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
- </mdb>
- <pools>
- <bean-instance-pools>
- <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
- <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
- </bean-instance-pools>
- </pools>
- <caches>
- <cache name="simple" aliases="NoPassivationCache"/>
- <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>
- </caches>
- <passivation-stores>
- <file-passivation-store name="file"/>
- </passivation-stores>
- <async thread-pool-name="default"/>
- <timer-service thread-pool-name="default">
- <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
- </timer-service>
- <remote connector-ref="remoting-connector" thread-pool-name="default"/>
- <thread-pools>
- <thread-pool name="default">
- <max-threads count="10"/>
- <keepalive-time time="100" unit="milliseconds"/>
- </thread-pool>
- </thread-pools>
- <iiop enable-by-default="false" use-qualified-name="false"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:infinispan:1.1" default-cache-container="hibernate">
- <cache-container name="hibernate" default-cache="local-query">
- <local-cache name="entity">
- <transaction mode="NON_XA"/>
- <eviction strategy="LRU" max-entries="10000"/>
- <expiration max-idle="100000"/>
- </local-cache>
- <local-cache name="local-query">
- <transaction mode="NONE"/>
- <eviction strategy="LRU" max-entries="10000"/>
- <expiration max-idle="100000"/>
- </local-cache>
- <local-cache name="timestamps">
- <transaction mode="NONE"/>
- <eviction strategy="NONE"/>
- </local-cache>
- </cache-container>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jacorb:1.1">
- <orb>
- <initializers transactions="spec" security="on"/>
- </orb>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jaxr:1.0">
- <connection-factory jndi-name="java:jboss/jaxr/ConnectionFactory"/>
- <juddi-server publish-url="http://localhost:8080/juddi/publish" query-url="http://localhost:8080/juddi/query"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
- <subsystem xmlns="urn:jboss:domain:jca:1.1">
- <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
- <bean-validation enabled="true"/>
- <default-workmanager>
- <short-running-threads>
- <core-threads count="50"/>
- <queue-length count="50"/>
- <max-threads count="50"/>
- <keepalive-time time="10" unit="seconds"/>
- </short-running-threads>
- <long-running-threads>
- <core-threads count="50"/>
- <queue-length count="50"/>
- <max-threads count="50"/>
- <keepalive-time time="10" unit="seconds"/>
- </long-running-threads>
- </default-workmanager>
- <cached-connection-manager/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
- <subsystem xmlns="urn:jboss:domain:jmx:1.1">
- <show-model value="true"/>
- <remoting-connector/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jpa:1.0">
- <jpa default-datasource=""/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jsr77:1.0"/>
- <subsystem xmlns="urn:jboss:domain:mail:1.0">
- <mail-session jndi-name="java:jboss/mail/Default">
- <smtp-server outbound-socket-binding-ref="mail-smtp"/>
- </mail-session>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:messaging:1.1">
- <hornetq-server>
- <persistence-enabled>true</persistence-enabled>
- <journal-file-size>102400</journal-file-size>
- <journal-min-files>2</journal-min-files>
-
- <connectors>
- <netty-connector name="netty" socket-binding="messaging"/>
- <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
- <param key="batch-delay" value="50"/>
- </netty-connector>
- <in-vm-connector name="in-vm" server-id="0"/>
- </connectors>
-
- <acceptors>
- <netty-acceptor name="netty" socket-binding="messaging"/>
- <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
- <param key="batch-delay" value="50"/>
- <param key="direct-deliver" value="false"/>
- </netty-acceptor>
- <in-vm-acceptor name="in-vm" server-id="0"/>
- </acceptors>
-
- <security-settings>
- <security-setting match="#">
- <permission type="send" roles="guest"/>
- <permission type="consume" roles="guest"/>
- <permission type="createNonDurableQueue" roles="guest"/>
- <permission type="deleteNonDurableQueue" roles="guest"/>
- </security-setting>
- </security-settings>
-
- <address-settings>
- <!--default for catch all-->
- <address-setting match="#">
- <dead-letter-address>jms.queue.DLQ</dead-letter-address>
- <expiry-address>jms.queue.ExpiryQueue</expiry-address>
- <redelivery-delay>0</redelivery-delay>
- <max-size-bytes>10485760</max-size-bytes>
- <address-full-policy>BLOCK</address-full-policy>
- <message-counter-history-day-limit>10</message-counter-history-day-limit>
- </address-setting>
- </address-settings>
-
- <jms-connection-factories>
- <connection-factory name="InVmConnectionFactory">
- <connectors>
- <connector-ref connector-name="in-vm"/>
- </connectors>
- <entries>
- <entry name="java:/ConnectionFactory"/>
- </entries>
- </connection-factory>
- <connection-factory name="RemoteConnectionFactory">
- <connectors>
- <connector-ref connector-name="netty"/>
- </connectors>
- <entries>
- <entry name="RemoteConnectionFactory"/>
- <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
- </entries>
- </connection-factory>
- <pooled-connection-factory name="hornetq-ra">
- <transaction mode="xa"/>
- <connectors>
- <connector-ref connector-name="in-vm"/>
- </connectors>
- <entries>
- <entry name="java:/JmsXA"/>
- </entries>
- </pooled-connection-factory>
- </jms-connection-factories>
-
- <jms-destinations>
- <jms-queue name="testQueue">
- <entry name="queue/test"/>
- <entry name="java:jboss/exported/jms/queue/test"/>
- </jms-queue>
- <jms-topic name="testTopic">
- <entry name="topic/test"/>
- <entry name="java:jboss/exported/jms/topic/test"/>
- </jms-topic>
- </jms-destinations>
- </hornetq-server>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:naming:1.1"/>
- <subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy">
- <properties>
- <!-- Specifies the beginning start level of the framework -->
- <property name="org.osgi.framework.startlevel.beginning">1</property>
- </properties>
- <capabilities>
- <!-- modules registered with the OSGi layer on startup -->
- <capability name="javax.servlet.api:v25"/>
- <capability name="javax.transaction.api"/>
- <!-- bundles started in startlevel 1 -->
- <capability name="org.apache.felix.log" startlevel="1"/>
- <capability name="org.jboss.osgi.logging" startlevel="1"/>
- <capability name="org.apache.felix.configadmin" startlevel="1"/>
- <capability name="org.jboss.as.osgi.configadmin" startlevel="1"/>
- </capabilities>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:pojo:1.0"/>
- <subsystem xmlns="urn:jboss:domain:remoting:1.1">
- <connector name="remoting-connector" socket-binding="remoting" security-realm="ApplicationRealm"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0"/>
- <subsystem xmlns="urn:jboss:domain:sar:1.0"/>
- <subsystem xmlns="urn:jboss:domain:security:1.1">
- <security-domains>
- <security-domain name="other" cache-type="default">
- <authentication>
- <login-module code="Remoting" flag="optional">
- <module-option name="password-stacking" value="useFirstPass"/>
- </login-module>
- <login-module code="RealmUsersRoles" flag="required">
- <module-option name="usersProperties" value="${jboss.domain.config.dir}/application-users.properties"/>
- <module-option name="rolesProperties" value="${jboss.domain.config.dir}/application-roles.properties"/>
- <module-option name="realm" value="ApplicationRealm"/>
- <module-option name="password-stacking" value="useFirstPass"/>
- </login-module>
- </authentication>
- </security-domain>
- <security-domain name="jboss-web-policy" cache-type="default">
- <authorization>
- <policy-module code="Delegating" flag="required"/>
- </authorization>
- </security-domain>
- <security-domain name="jboss-ejb-policy" cache-type="default">
- <authorization>
- <policy-module code="Delegating" flag="required"/>
- </authorization>
- </security-domain>
- </security-domains>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:threads:1.1"/>
- <subsystem xmlns="urn:jboss:domain:transactions:1.1">
- <core-environment>
- <process-id>
- <uuid/>
- </process-id>
- </core-environment>
- <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
- <coordinator-environment default-timeout="300"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host" native="false">
- <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
- <virtual-server name="default-host" enable-welcome-root="true">
- <alias name="localhost"/>
- <alias name="example.com"/>
- </virtual-server>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:webservices:1.1">
- <modify-wsdl-address>true</modify-wsdl-address>
- <wsdl-host>${jboss.bind.address:127.0.0.1}</wsdl-host>
- <endpoint-config name="Standard-Endpoint-Config"/>
- <endpoint-config name="Recording-Endpoint-Config">
- <pre-handler-chain name="recording-handlers" protocol-bindings="##SOAP11_HTTP ##SOAP11_HTTP_MTOM ##SOAP12_HTTP ##SOAP12_HTTP_MTOM">
- <handler name="RecordingHandler" class="org.jboss.ws.common.invocation.RecordingServerHandler"/>
- </pre-handler-chain>
- </endpoint-config>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:weld:1.0"/>
- </profile>
-
- <profile name="full-ha">
- <subsystem xmlns="urn:jboss:domain:logging:1.1">
- <console-handler name="CONSOLE">
- <level name="INFO"/>
- <formatter>
- <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
- </formatter>
- </console-handler>
- <periodic-rotating-file-handler name="FILE">
- <formatter>
- <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
- </formatter>
- <file relative-to="jboss.server.log.dir" path="server.log"/>
- <suffix value=".yyyy-MM-dd"/>
- <append value="true"/>
- </periodic-rotating-file-handler>
- <logger category="com.arjuna">
- <level name="WARN"/>
- </logger>
- <logger category="org.apache.tomcat.util.modeler">
- <level name="WARN"/>
- </logger>
- <logger category="sun.rmi">
- <level name="WARN"/>
- </logger>
- <logger category="jacorb">
- <level name="WARN"/>
- </logger>
- <logger category="jacorb.config">
- <level name="ERROR"/>
- </logger>
- <root-logger>
- <level name="INFO"/>
- <handlers>
- <handler name="CONSOLE"/>
- <handler name="FILE"/>
- </handlers>
- </root-logger>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:configadmin:1.0"/>
- <subsystem xmlns="urn:jboss:domain:datasources:1.0">
- <datasources>
- <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
- <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
- <driver>h2</driver>
- <security>
- <user-name>sa</user-name>
- <password>sa</password>
- </security>
- </datasource>
- <drivers>
- <driver name="h2" module="com.h2database.h2">
- <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
- </driver>
- </drivers>
- </datasources>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:ee:1.0"/>
- <subsystem xmlns="urn:jboss:domain:ejb3:1.2">
- <session-bean>
- <stateless>
- <bean-instance-pool-ref pool-name="slsb-strict-max-pool"/>
- </stateless>
- <stateful default-access-timeout="5000" cache-ref="simple" clustered-cache-ref="clustered"/>
- <singleton default-access-timeout="5000"/>
- </session-bean>
- <mdb>
- <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
- <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
- </mdb>
- <pools>
- <bean-instance-pools>
- <strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
- <strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
- </bean-instance-pools>
- </pools>
- <caches>
- <cache name="simple" aliases="NoPassivationCache"/>
- <cache name="passivating" passivation-store-ref="file" aliases="SimpleStatefulCache"/>
- <cache name="clustered" passivation-store-ref="infinispan" aliases="StatefulTreeCache"/>
- </caches>
- <passivation-stores>
- <file-passivation-store name="file"/>
- <cluster-passivation-store name="infinispan" cache-container="ejb"/>
- </passivation-stores>
- <async thread-pool-name="default"/>
- <timer-service thread-pool-name="default">
- <data-store path="timer-service-data" relative-to="jboss.server.data.dir"/>
- </timer-service>
- <remote connector-ref="remoting-connector" thread-pool-name="default"/>
- <thread-pools>
- <thread-pool name="default">
- <max-threads count="10"/>
- <keepalive-time time="100" unit="milliseconds"/>
- </thread-pool>
- </thread-pools>
- <iiop enable-by-default="false" use-qualified-name="false"/>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:infinispan:1.1" default-cache-container="cluster">
- <cache-container name="cluster" aliases="ha-partition" default-cache="default">
- <transport lock-timeout="60000"/>
- <replicated-cache name="default" mode="SYNC" batching="true">
- <locking isolation="REPEATABLE_READ"/>
- </replicated-cache>
- </cache-container>
- <cache-container name="web" aliases="standard-session-cache" default-cache="repl">
- <transport lock-timeout="60000"/>
- <replicated-cache name="repl" mode="ASYNC" batching="true">
- <file-store/>
- </replicated-cache>
- <replicated-cache name="sso" mode="SYNC" batching="true"/>
- <distributed-cache name="dist" mode="ASYNC" batching="true">
- <file-store/>
- </distributed-cache>
- </cache-container>
- <cache-container name="ejb" aliases="sfsb sfsb-cache" default-cache="repl">
- <transport lock-timeout="60000"/>
- <replicated-cache name="repl" mode="ASYNC" batching="true">
- <eviction strategy="LRU"/>
- <file-store/>
- </replicated-cache>
- <!-- Clustered cache used internally by EJB subsytem for managing the client-mapping(s) of
- the socketbinding referenced by the EJB remoting connector -->
- <replicated-cache name="remote-connector-client-mappings" mode="SYNC" batching="true"/>
- <distributed-cache name="dist" mode="ASYNC" batching="true">
- <eviction strategy="LRU"/>
- <file-store/>
- </distributed-cache>
- </cache-container>
- <cache-container name="hibernate" default-cache="local-query">
- <transport lock-timeout="60000"/>
- <local-cache name="local-query">
- <transaction mode="NONE"/>
- <eviction strategy="LRU" max-entries="10000"/>
- <expiration max-idle="100000"/>
- </local-cache>
- <invalidation-cache name="entity" mode="SYNC">
- <transaction mode="NON_XA"/>
- <eviction strategy="LRU" max-entries="10000"/>
- <expiration max-idle="100000"/>
- </invalidation-cache>
- <replicated-cache name="timestamps" mode="ASYNC">
- <transaction mode="NONE"/>
- <eviction strategy="NONE"/>
- </replicated-cache>
- </cache-container>
<cache-container name="teiid" default-cache="resultset">
+ <transport lock-timeout="60000"/>
<replicated-cache name="resultset" mode="SYNC" batching="true">
<locking isolation="READ_COMMITTED"/>
<transaction mode="FULL_XA"/>
<expiration lifespan="7200" />
<eviction max-entries="1024" strategy="LRU"/>
</replicated-cache>
- </cache-container>
+ </cache-container>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:jacorb:1.1">
- <orb>
- <initializers transactions="spec" security="on"/>
- </orb>
- </subsystem>
- <subsystem xmlns="urn:jboss:domain:jaxr:1.0">
- <connection-factory jndi-name="java:jboss/jaxr/ConnectionFactory"/>
- <juddi-server publish-url="http://localhost:8080/juddi/publish" query-url="http://localhost:8080/juddi/query"/>
- </subsystem>
<subsystem xmlns="urn:jboss:domain:jaxrs:1.0"/>
<subsystem xmlns="urn:jboss:domain:jca:1.1">
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
- <bean-validation enabled="true"/>
+ <bean-validation enabled="false"/>
<default-workmanager>
<short-running-threads>
<core-threads count="50"/>
@@ -892,97 +265,11 @@
<subsystem xmlns="urn:jboss:domain:jpa:1.0">
<jpa default-datasource=""/>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:jsr77:1.0"/>
<subsystem xmlns="urn:jboss:domain:mail:1.0">
<mail-session jndi-name="java:jboss/mail/Default">
<smtp-server outbound-socket-binding-ref="mail-smtp"/>
</mail-session>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:messaging:1.1">
- <hornetq-server>
- <persistence-enabled>true</persistence-enabled>
- <journal-file-size>102400</journal-file-size>
- <journal-min-files>2</journal-min-files>
-
- <connectors>
- <netty-connector name="netty" socket-binding="messaging"/>
- <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
- <param key="batch-delay" value="50"/>
- </netty-connector>
- <in-vm-connector name="in-vm" server-id="0"/>
- </connectors>
-
- <acceptors>
- <netty-acceptor name="netty" socket-binding="messaging"/>
- <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
- <param key="batch-delay" value="50"/>
- <param key="direct-deliver" value="false"/>
- </netty-acceptor>
- <in-vm-acceptor name="in-vm" server-id="0"/>
- </acceptors>
-
- <security-settings>
- <security-setting match="#">
- <permission type="send" roles="guest"/>
- <permission type="consume" roles="guest"/>
- <permission type="createNonDurableQueue" roles="guest"/>
- <permission type="deleteNonDurableQueue" roles="guest"/>
- </security-setting>
- </security-settings>
-
- <address-settings>
- <!--default for catch all-->
- <address-setting match="#">
- <dead-letter-address>jms.queue.DLQ</dead-letter-address>
- <expiry-address>jms.queue.ExpiryQueue</expiry-address>
- <redelivery-delay>0</redelivery-delay>
- <max-size-bytes>10485760</max-size-bytes>
- <address-full-policy>BLOCK</address-full-policy>
- <message-counter-history-day-limit>10</message-counter-history-day-limit>
- </address-setting>
- </address-settings>
-
- <jms-connection-factories>
- <connection-factory name="InVmConnectionFactory">
- <connectors>
- <connector-ref connector-name="in-vm"/>
- </connectors>
- <entries>
- <entry name="java:/ConnectionFactory"/>
- </entries>
- </connection-factory>
- <connection-factory name="RemoteConnectionFactory">
- <connectors>
- <connector-ref connector-name="netty"/>
- </connectors>
- <entries>
- <entry name="RemoteConnectionFactory"/>
- <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
- </entries>
- </connection-factory>
- <pooled-connection-factory name="hornetq-ra">
- <transaction mode="xa"/>
- <connectors>
- <connector-ref connector-name="in-vm"/>
- </connectors>
- <entries>
- <entry name="java:/JmsXA"/>
- </entries>
- </pooled-connection-factory>
- </jms-connection-factories>
-
- <jms-destinations>
- <jms-queue name="testQueue">
- <entry name="queue/test"/>
- <entry name="java:jboss/exported/jms/queue/test"/>
- </jms-queue>
- <jms-topic name="testTopic">
- <entry name="topic/test"/>
- <entry name="java:jboss/exported/jms/topic/test"/>
- </jms-topic>
- </jms-destinations>
- </hornetq-server>
- </subsystem>
<subsystem xmlns="urn:jboss:domain:modcluster:1.0">
<mod-cluster-config advertise-socket="modcluster"/>
</subsystem>
@@ -1024,6 +311,14 @@
</login-module>
</authentication>
</security-domain>
+ <security-domain name="teiid-security" cache-type="default">
+ <authentication>
+ <login-module code="UsersRoles" flag="required">
+ <module-option name="usersProperties" value="teiid-security-users.properties"/>
+ <module-option name="rolesProperties" value="teiid-security-roles.properties"/>
+ </login-module>
+ </authentication>
+ </security-domain>
<security-domain name="jboss-web-policy" cache-type="default">
<authorization>
<policy-module code="Delegating" flag="required"/>
@@ -1034,19 +329,11 @@
<policy-module code="Delegating" flag="required"/>
</authorization>
</security-domain>
- <security-domain name="teiid-security" cache-type="default">
- <authentication>
- <login-module code="UsersRoles" flag="required">
- <module-option name="usersProperties" value="teiid-security-users.properties"/>
- <module-option name="rolesProperties" value="teiid-security-roles.properties"/>
- </login-module>
- </authentication>
- </security-domain>
</security-domains>
</subsystem>
<subsystem xmlns="urn:jboss:domain:teiid:1.0">
<async-thread-pool>teiid-async</async-thread-pool>
- <distributed-cache jgroups-stack="udp" channel="teiid-rep"/>
+ <distributed-cache jgroups-stack="udp" channel="teiid-channel"/>
<resultset-cache infinispan-container="teiid"/>
<transport name="embedded"/>
@@ -1088,12 +375,12 @@
<translator name="salesforce" module="org.jboss.teiid.translator.salesforce"/>
<translator name="hive" module="org.jboss.teiid.translator.hive"/>
</subsystem>
- <subsystem xmlns="urn:jboss:domain:threads:1.1">
- <bounded-queue-thread-pool name="teiid-async">
- <max-threads count="4"/>
- <queue-length count="100"/>
- </bounded-queue-thread-pool>
- </subsystem>
+ <subsystem xmlns="urn:jboss:domain:threads:1.1">
+ <bounded-queue-thread-pool name="teiid-async">
+ <max-threads count="4"/>
+ <queue-length count="100"/>
+ </bounded-queue-thread-pool>
+ </subsystem>
<subsystem xmlns="urn:jboss:domain:transactions:1.1">
<core-environment>
<process-id>
Deleted: trunk/build/kits/jboss-as7/domain/configuration/host-teiid.xml
===================================================================
--- trunk/build/kits/jboss-as7/domain/configuration/host-teiid.xml 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/build/kits/jboss-as7/domain/configuration/host-teiid.xml 2012-03-23 20:09:17 UTC (rev 3951)
@@ -1,81 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
-<host name="master" xmlns="urn:jboss:domain:1.1">
-
- <management>
- <security-realms>
- <security-realm name="ManagementRealm">
- <authentication>
- <properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>
- </authentication>
- </security-realm>
- <security-realm name="ApplicationRealm">
- <authentication>
- <properties path="application-users.properties" relative-to="jboss.domain.config.dir" />
- </authentication>
- </security-realm>
- </security-realms>
- <management-interfaces>
- <native-interface security-realm="ManagementRealm">
- <socket interface="management" port="${jboss.management.native.port:9999}"/>
- </native-interface>
- <http-interface security-realm="ManagementRealm">
- <socket interface="management" port="${jboss.management.http.port:9990}"/>
- </http-interface>
- </management-interfaces>
- </management>
-
- <domain-controller>
- <local/>
- <!-- Alternative remote domain controller configuration with a host and port -->
- <!-- <remote host="${jboss.domain.master.address}" port="${jboss.domain.master.port:9999}"/> -->
- </domain-controller>
-
- <interfaces>
- <interface name="management">
- <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
- </interface>
- <interface name="public">
- <inet-address value="${jboss.bind.address:127.0.0.1}"/>
- </interface>
- <interface name="unsecure">
- <!-- Used for IIOP sockets in the standarad configuration.
- To secure JacORB you need to setup SSL -->
- <inet-address value="127.0.0.1"/>
- </interface>
- </interfaces>
-
- <jvms>
- <jvm name="default">
- <heap size="64m" max-size="256m"/>
- <permgen size="256m" max-size="256m"/>
- <jvm-options>
- <option value="-server"/>
- </jvm-options>
- </jvm>
- </jvms>
-
- <servers>
- <server name="server-one" group="main-server-group">
- <!-- Remote JPDA debugging for a specific server
- <jvm name="default">
- <jvm-options>
- <option value="-Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"/>
- </jvm-options>
- </jvm>
- -->
- </server>
- <!--
- <server name="server-two" group="main-server-group" auto-start="true">
- <!-- server-two avoids port conflicts by incrementing the ports in
- the default socket-group declared in the server-group -->
- <socket-bindings port-offset="150"/>
- </server>
- <server name="server-three" group="other-server-group" auto-start="false">
- <!-- server-three avoids port conflicts by incrementing the ports in
- the default socket-group declared in the server-group -->
- <socket-bindings port-offset="250"/>
- </server>
- -->
- </servers>
-</host>
Modified: trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java
===================================================================
--- trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/jboss-integration/src/main/java/org/teiid/jboss/TeiidOperationHandler.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -470,7 +470,7 @@
ModelNode result = context.getResult();
CacheStatisticsMetadata stats = buildCacheStats(cacheType, cache);
- VDBMetadataMapper.CacheStatisticsMetadataMapper.INSTANCE.wrap(stats, result);
+ VDBMetadataMapper.CacheStatisticsMetadataMapper.INSTANCE.wrap(stats, result.add());
}
private CacheStatisticsMetadata buildCacheStats(String name, SessionAwareCache cache) {
@@ -488,7 +488,7 @@
operationNode.get(REQUEST_PROPERTIES, OperationsConstants.CACHE_TYPE, DESCRIPTION).set(getParameterDescription(bundle, OperationsConstants.CACHE_TYPE));
ModelNode reply = operationNode.get(REPLY_PROPERTIES);
- reply.get(TYPE).set(ModelType.OBJECT);
+ reply.get(TYPE).set(ModelType.LIST);
VDBMetadataMapper.CacheStatisticsMetadataMapper.INSTANCE.describe(reply.get(VALUE_TYPE));
}
}
@@ -526,11 +526,11 @@
protected void executeOperation(OperationContext context, DQPCore engine, ModelNode operation) throws OperationFailedException {
ModelNode result = context.getResult();
WorkerPoolStatisticsMetadata stats = engine.getWorkerPoolStatistics();
- VDBMetadataMapper.WorkerPoolStatisticsMetadataMapper.INSTANCE.wrap(stats, result);
+ VDBMetadataMapper.WorkerPoolStatisticsMetadataMapper.INSTANCE.wrap(stats, result.add());
}
protected void describeParameters(ModelNode operationNode, ResourceBundle bundle) {
ModelNode reply = operationNode.get(REPLY_PROPERTIES);
- reply.get(TYPE).set(ModelType.OBJECT);
+ reply.get(TYPE).set(ModelType.LIST);
VDBMetadataMapper.WorkerPoolStatisticsMetadataMapper.INSTANCE.describe(reply.get(VALUE_TYPE));
}
}
Modified: trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java
===================================================================
--- trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java 2012-03-22 20:56:53 UTC (rev 3950)
+++ trunk/test-integration/common/src/test/java/org/teiid/arquillian/IntegrationTestDeployment.java 2012-03-23 20:09:17 UTC (rev 3951)
@@ -63,7 +63,7 @@
@Test
public void testVDBDeployment() throws Exception {
try {
- Set<?> vdbs = admin.getVDBs();
+ Collection<?> vdbs = admin.getVDBs();
assertTrue(vdbs.isEmpty());
Collection<String> dsNames = admin.getDataSourceNames();
12 years, 9 months
teiid SVN: r3950 - branches/7.4.x/build/kits/jboss-container.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2012-03-22 16:56:53 -0400 (Thu, 22 Mar 2012)
New Revision: 3950
Modified:
branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
Log:
BZ-786561 update of release-notes.html
correction
Modified: branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2012-03-22 20:52:03 UTC (rev 3949)
+++ branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2012-03-22 20:56:53 UTC (rev 3950)
@@ -257,9 +257,9 @@
<ul>
<li>[<a href='https://issues.jboss.org/browse/TEIID-1920'>TEIID-1920</a>] - fixing issues with dynamic sql</li>
<li>[<a href='https://issues.jboss.org/browse/TEIID-1925'>TEIID-1925</a>] - Corrected method name to getExecutionId. Also removed getProcessingTime method since that has been removed</li>
-<li>[<a href='https://issues.jboss.org/browse/TEIID-1925'>TEIID-1950</a>] - renaming the teiid-client-settings in the client to not interfere with signed jars</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1950'>TEIID-1950</a>] - renaming the teiid-client-settings in the client to not interfere with signed jars</li>
<li>[<a href='https://issues.jboss.org/browse/TEIID-1954'>TEIID-1954</a>] - correcting associating index records from index metadata</li>
-<li>[<a href='https://issues.jboss.org/browse/TEIID-1954'>TEIID-1973</a>] - SQLFetch hangs after first batch returned when odbc.ini property UseDeclareFetch=1 is used</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1973'>TEIID-1973</a>] - SQLFetch hangs after first batch returned when odbc.ini property UseDeclareFetch=1 is used</li>
</ul>
<h4>From 7.4.2</h4>
12 years, 9 months
teiid SVN: r3949 - branches/7.4.x/build/kits/jboss-container.
by teiid-commits@lists.jboss.org
Author: jolee
Date: 2012-03-22 16:52:03 -0400 (Thu, 22 Mar 2012)
New Revision: 3949
Modified:
branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
Log:
BZ-786561 update of release-notes.html
Modified: branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html
===================================================================
--- branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2012-03-22 20:51:52 UTC (rev 3948)
+++ branches/7.4.x/build/kits/jboss-container/teiid-releasenotes.html 2012-03-22 20:52:03 UTC (rev 3949)
@@ -257,7 +257,9 @@
<ul>
<li>[<a href='https://issues.jboss.org/browse/TEIID-1920'>TEIID-1920</a>] - fixing issues with dynamic sql</li>
<li>[<a href='https://issues.jboss.org/browse/TEIID-1925'>TEIID-1925</a>] - Corrected method name to getExecutionId. Also removed getProcessingTime method since that has been removed</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1925'>TEIID-1950</a>] - renaming the teiid-client-settings in the client to not interfere with signed jars</li>
<li>[<a href='https://issues.jboss.org/browse/TEIID-1954'>TEIID-1954</a>] - correcting associating index records from index metadata</li>
+<li>[<a href='https://issues.jboss.org/browse/TEIID-1954'>TEIID-1973</a>] - SQLFetch hangs after first batch returned when odbc.ini property UseDeclareFetch=1 is used</li>
</ul>
<h4>From 7.4.2</h4>
12 years, 9 months