db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oyste...@apache.org
Subject svn commit: r633451 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl: db/ services/replication/master/ services/replication/slave/
Date Tue, 04 Mar 2008 12:35:13 GMT
Author: oysteing
Date: Tue Mar  4 04:35:11 2008
New Revision: 633451

URL: http://svn.apache.org/viewvc?rev=633451&view=rev
Log:
DERBY-3437:Give all replication threads meaningfull names
Contributed by Serge Tsv.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/MasterController.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/slave/SlaveController.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java?rev=633451&r1=633450&r2=633451&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/db/SlaveDatabase.java Tue Mar  4
04:35:11 2008
@@ -126,7 +126,7 @@
         // SlaveDatabaseBootThread is an internal class
         SlaveDatabaseBootThread dbBootThread =
             new SlaveDatabaseBootThread(create, startParams);
-        new Thread(dbBootThread).start();
+        new Thread(dbBootThread, "derby.slave.boot-" + dbname).start();
 
         // Check that the database was booted successfully, or throw
         // the exception that caused the boot to fail.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java?rev=633451&r1=633450&r2=633451&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/AsynchronousLogShipper.java
Tue Mar  4 04:35:11 2008
@@ -142,6 +142,7 @@
     public AsynchronousLogShipper(ReplicationLogBuffer logBuffer,
         ReplicationMessageTransmit transmitter,
         MasterController masterController) {
+        super("derby.master.logger-" + masterController.getDbName());
         this.logBuffer = logBuffer;
         this.transmitter = transmitter;
         this.masterController = masterController;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/MasterController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/MasterController.java?rev=633451&r1=633450&r2=633451&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/MasterController.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/master/MasterController.java
Tue Mar  4 04:35:11 2008
@@ -502,4 +502,22 @@
         }
     }
 
+    /**
+     * <p>
+     * Returns a name of a database associated with this master
+     * controller.
+     * </p>
+     * 
+     * <p>
+     * Note: The only purpose of the method as of now is to give a 
+     * meaningful name to a log shipper thread. The log shipper thread 
+     * name should contain a name of a corresponding master database,
+     * and this method is used to access it.
+     * </p>
+     * 
+     * @return a master database name
+     */
+    String getDbName() {
+        return this.dbname;
+    }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/slave/SlaveController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/slave/SlaveController.java?rev=633451&r1=633450&r2=633451&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/slave/SlaveController.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/replication/slave/SlaveController.java
Tue Mar  4 04:35:11 2008
@@ -461,6 +461,15 @@
      * applies chunks of log records to the local log files.
      */
     private class SlaveLogReceiverThread extends Thread {
+        
+        /**
+         * Creates a new instance of <tt>SlaveLogReceiverThread</tt>
+         * with a debugging-friendly thread name.
+         */
+        SlaveLogReceiverThread() {
+            super("derby.slave.logger-" + dbname);
+        }
+        
         public void run() {
             try {
                 ReplicationMessage message;



Mime
View raw message