activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r820032 - in /activemq/branches/activemq-5.3: ./ activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java
Date Tue, 29 Sep 2009 17:07:12 GMT
Author: chirino
Date: Tue Sep 29 17:07:12 2009
New Revision: 820032

URL: http://svn.apache.org/viewvc?rev=820032&view=rev
Log:
AMQ-2414 fixes for MySQL cluster setup

Modified:
    activemq/branches/activemq-5.3/   (props changed)
    activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java
    activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java
  (props changed)

Propchange: activemq/branches/activemq-5.3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 29 17:07:12 2009
@@ -1 +1 @@
-/activemq/trunk:816278-816279,816298,818138,818140-818147,818155,818160-818176,818209,818211,818224-818262,818480,818484,818487,818496,818502,818504-818510,818513-818516,818609,818635,818724-818762,818888,818905,818914,818923,818947-818955,818985
+/activemq/trunk:816278-816279,816298,818138,818140-818147,818155,818160-818176,818209,818211,818224-818262,818480,818484,818487,818496,818502,818504-818510,818513-818516,818609,818635,818724-818762,818888,818905,818914,818923,818947-818955,818985,820031

Modified: activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java
URL: http://svn.apache.org/viewvc/activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java?rev=820032&r1=820031&r2=820032&view=diff
==============================================================================
--- activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java
(original)
+++ activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/store/jdbc/adapter/MySqlJDBCAdapter.java
Tue Sep 29 17:07:12 2009
@@ -16,6 +16,9 @@
  */
 package org.apache.activemq.store.jdbc.adapter;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+
 import org.apache.activemq.store.jdbc.Statements;
 
 /**
@@ -47,13 +50,32 @@
 
         statements.setBinaryDataType("LONGBLOB");
         
+        
+        String typeClause = " TYPE="+type;
+        if( type.equals(NDBCLUSTER) ) {
+            // in the NDBCLUSTER case we will create as INNODB and then alter to NDBCLUSTER
+            typeClause = " TYPE="+INNODB;
+        }
+        
         // Update the create statements so they use the right type of engine 
         String[] s = statements.getCreateSchemaStatements();
         for (int i = 0; i < s.length; i++) {
             if( s[i].startsWith("CREATE TABLE")) {
-                s[i] = s[i]+" TYPE="+type;
+                s[i] = s[i]+typeClause;
             }
         }
+        
+        if( type.equals(NDBCLUSTER) ) {
+            // Add the alter statements.
+            ArrayList<String> l = new ArrayList<String>(Arrays.asList(s));
+            l.add("ALTER TABLE "+statements.getFullMessageTableName()+" ENGINE="+NDBCLUSTER);
+            l.add("ALTER TABLE "+statements.getFullAckTableName()+" ENGINE="+NDBCLUSTER);
+            l.add("ALTER TABLE "+statements.getFullLockTableName()+" ENGINE="+NDBCLUSTER);
+            l.add("FLUSH TABLES");
+            s = l.toArray(new String[l.size()]);
+            statements.setCreateSchemaStatements(s);
+        }        
+        
         super.setStatements(statements);
     }
 

Propchange: activemq/branches/activemq-5.3/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 29 17:07:12 2009
@@ -1 +1 @@
-/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java:502054-818935,818937-819035
+/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompSubscription.java:502054-818935,818937-819035,820031



Mime
View raw message