db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oyste...@apache.org
Subject svn commit: r618584 - in /db/derby/code/trunk/java/engine/org/apache/derby: database/ iapi/store/access/ iapi/store/raw/ impl/db/ impl/jdbc/ impl/store/access/ impl/store/raw/
Date Tue, 05 Feb 2008 09:18:19 GMT
Author: oysteing
Date: Tue Feb  5 01:18:14 2008
New Revision: 618584

URL: http://svn.apache.org/viewvc?rev=618584&view=rev
Log:
DERBY-3189: Propagate the master database name from EmbedConnection to
RawStore where the MASTER_DB property is initialized before the master
controller service is booted. Contributed by Narayanan.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/database/Database.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/AccessFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/database/Database.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/database/Database.java?rev=618584&r1=618583&r2=618584&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/database/Database.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/database/Database.java Tue Feb  5 01:18:14
2008
@@ -124,6 +124,7 @@
 
     /**
      * Start the replication master role for this database
+     * @param dbmaster The master database that is being replicated.
      * @param host The hostname for the slave
      * @param port The port the slave is listening on
      * @param replicationMode The type of replication contract.
@@ -131,7 +132,7 @@
      * 1-safe/2-safe/very-safe modes may be added later.
      * @exception SQLException Thrown on error
      */
-    public void startReplicationMaster(String host, int port, 
+    public void startReplicationMaster(String dbmaster, String host, int port, 
                                        String replicationMode)
         throws SQLException;
     

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/AccessFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/AccessFactory.java?rev=618584&r1=618583&r2=618584&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/AccessFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/AccessFactory.java
Tue Feb  5 01:18:14 2008
@@ -216,6 +216,7 @@
 
     /**
      * Start the replication master role for this database
+     * @param dbmaster The master database that is being replicated.
      * @param host The hostname for the slave
      * @param port The port the slave is listening on
      * @param replicationMode The type of replication contract.
@@ -224,7 +225,7 @@
      * @exception StandardException Standard Derby exception policy,
      * thrown on error.
      */
-    public void startReplicationMaster(String host, int port,
+    public void startReplicationMaster(String dbmaster, String host, int port,
                                        String replicationMode)
         throws StandardException;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java?rev=618584&r1=618583&r2=618584&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/raw/RawStoreFactory.java Tue
Feb  5 01:18:14 2008
@@ -683,6 +683,7 @@
 
     /**
      * Start the replication master role for this database
+     * @param dbmaster The master database that is being replicated.
      * @param host The hostname for the slave
      * @param port The port the slave is listening on
      * @param replicationMode The type of replication contract.
@@ -691,7 +692,7 @@
      * @exception StandardException Standard Derby exception policy,
      * thrown on error.
      */
-    public void startReplicationMaster(String host, int port,
+    public void startReplicationMaster(String dbmaster, String host, int port,
                                        String replicationMode)
         throws StandardException;
     

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java?rev=618584&r1=618583&r2=618584&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/db/BasicDatabase.java Tue Feb  5
01:18:14 2008
@@ -361,6 +361,7 @@
 
     /**
      * Start the replication master role for this database
+     * @param dbmaster The master database that is being replicated.
      * @param host The hostname for the slave
      * @param port The port the slave is listening on
      * @param replicationMode The type of replication contract.
@@ -368,11 +369,11 @@
      * 1-safe/2-safe/very-safe modes may be added later.
      * @exception SQLException Thrown on error
      */
-    public void startReplicationMaster(String host, int port,
+    public void startReplicationMaster(String dbmaster, String host, int port,
                                        String replicationMode)
         throws SQLException {
         try {
-            af.startReplicationMaster(host, port, replicationMode);
+            af.startReplicationMaster(dbmaster, host, port, replicationMode);
         } catch (StandardException se) {
             throw PublicAPI.wrapStandardException(se);
         }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java?rev=618584&r1=618583&r2=618584&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java Tue Feb
 5 01:18:14 2008
@@ -656,7 +656,8 @@
             slaveport = Integer.valueOf(portString).intValue();
         }
 
-        tr.getDatabase().startReplicationMaster(slavehost,
+        tr.getDatabase().startReplicationMaster(getTR().getDBName(),
+                                                slavehost,
                                                 slaveport,
                                                 MasterFactory.
                                                 ASYNCHRONOUS_MODE);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java?rev=618584&r1=618583&r2=618584&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java
Tue Feb  5 01:18:14 2008
@@ -913,7 +913,8 @@
 	}
 
     /**
-     * Start the replication master role for this database. 
+     * Start the replication master role for this database.
+     * @param dbmaster The master database that is being replicated.
      * @param host The hostname for the slave
      * @param port The port the slave is listening on
      * @param replicationMode The type of replication contract.
@@ -922,10 +923,10 @@
      * @exception StandardException Standard Derby exception policy,
      * thrown on error.
      */
-    public void startReplicationMaster(String host, int port,
+    public void startReplicationMaster(String dbmaster, String host, int port,
                                        String replicationMode)
         throws StandardException {
-        rawstore.startReplicationMaster(host, port, replicationMode);
+        rawstore.startReplicationMaster(dbmaster, host, port, replicationMode);
     }
 
     /**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java?rev=618584&r1=618583&r2=618584&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java Tue Feb
 5 01:18:14 2008
@@ -468,6 +468,7 @@
 
     /**
      * Start the replication master role for this database
+     * @param dbmaster The master database that is being replicated.
      * @param host The hostname for the slave
      * @param port The port the slave is listening on
      * @param replicationMode The type of replication contract.
@@ -476,7 +477,7 @@
      * @exception StandardException Standard Derby exception policy,
      * thrown on error.
      */
-    public void startReplicationMaster(String host, int port,
+    public void startReplicationMaster(String dbmaster, String host, int port,
                                        String replicationMode)
         throws StandardException {
 
@@ -486,6 +487,7 @@
         }
 
         Properties replicationProps = new Properties();
+        replicationProps.setProperty(MasterFactory.MASTER_DB, dbmaster);
         replicationProps.setProperty(MasterFactory.SLAVE_HOST, host);
         replicationProps.setProperty(MasterFactory.SLAVE_PORT,
                                      new Integer(port).toString());



Mime
View raw message