From 9c8493a28711aff83940445f42f923c587eea4f8 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 02 Sep 2013 14:57:25 +0000
Subject: [PATCH] OPENDJ-1116 Introduce abstraction for the changelog DB

---
 opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java |   48 +++++++++++++++++++++++-------------------------
 1 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java b/opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java
index 65f7e84..158ca25 100644
--- a/opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java
+++ b/opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java
@@ -27,12 +27,6 @@
  */
 package org.opends.server.replication.plugin;
 
-import static org.opends.messages.ReplicationMessages.*;
-import static org.opends.server.loggers.ErrorLogger.*;
-import static org.opends.server.replication.plugin.
-ReplicationRepairRequestControl.*;
-import static org.opends.server.util.StaticUtils.*;
-
 import java.util.*;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ConcurrentHashMap;
@@ -50,6 +44,12 @@
 import org.opends.server.types.*;
 import org.opends.server.types.operation.*;
 
+import static org.opends.messages.ReplicationMessages.*;
+import static org.opends.server.loggers.ErrorLogger.*;
+import static org.opends.server.replication.plugin.
+ReplicationRepairRequestControl.*;
+import static org.opends.server.util.StaticUtils.*;
+
 /**
  * This class is used to load the Replication code inside the JVM
  * and to trigger initialization of the replication.
@@ -119,14 +119,14 @@
           return null;
 
         /*
-         * Check if the provided operation is a repair operation and set
-         * the synchronization flags if necessary.
-         * The repair operations are tagged as synchronization operations
-         * so that the core server let the operation modify the entryuuid
-         * and ds-sync-hist attributes.
-         * They are also tagged as dontSynchronize so that the replication
-         * code running later do not generate ChangeNumber, solve conflicts
-         * and forward the operation to the replication server.
+         * Check if the provided operation is a repair operation and set the
+         * synchronization flags if necessary.
+         * The repair operations are tagged as synchronization operations so
+         * that the core server let the operation modify the entryuuid and
+         * ds-sync-hist attributes.
+         * They are also tagged as dontSynchronize so that the replication code
+         * running later do not generate CSN, solve conflicts and forward the
+         * operation to the replication server.
          */
         for (Control c : op.getRequestControls())
         {
@@ -135,10 +135,9 @@
             op.setSynchronizationOperation(true);
             op.setDontSynchronize(true);
             /*
-            remove this control from the list of controls since
-            it has now been processed and the local backend will
-            fail if it finds a control that it does not know about and
-            that is marked as critical.
+            remove this control from the list of controls since it has now been
+            processed and the local backend will fail if it finds a control that
+            it does not know about and that is marked as critical.
             */
             List<Control> controls = op.getRequestControls();
             controls.remove(c);
@@ -175,19 +174,18 @@
       ReplicationDomainCfg configuration)
       throws ConfigException
   {
-    LDAPReplicationDomain domain = null;
     try
     {
-      domain = new LDAPReplicationDomain(configuration, updateToReplayQueue);
+      LDAPReplicationDomain domain =
+          new LDAPReplicationDomain(configuration, updateToReplayQueue);
       if (domains.size() == 0)
       {
-        /*
-         * Create the threads that will process incoming update messages
-         */
+        // Create the threads that will process incoming update messages
         createReplayThreads();
       }
 
       domains.put(domain.getBaseDN(), domain);
+      return domain;
     }
     catch (ConfigException e)
     {
@@ -195,7 +193,7 @@
           configuration.dn().toString(), e.getLocalizedMessage()
           + " " + stackTraceToSingleLineString(e)));
     }
-    return domain;
+    return null;
   }
 
   /**
@@ -564,7 +562,7 @@
     if (domain == null)
       return new SynchronizationProviderResult.ContinueProcessing();
 
-    // For LOCAL op only, generate ChangeNumber and attach Context
+    // For LOCAL op only, generate CSN and attach Context
     if (!addOperation.isSynchronizationOperation())
       domain.doPreOperation(addOperation);
 

--
Gitblit v1.10.0