You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2016/01/07 15:34:00 UTC

svn commit: r1723563 - /qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java

Author: orudyy
Date: Thu Jan  7 14:34:00 2016
New Revision: 1723563

URL: http://svn.apache.org/viewvc?rev=1723563&view=rev
Log:
QPID-6959: Report exception environment mutating operations when environment does not exist

Modified:
    qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java

Modified: qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java?rev=1723563&r1=1723562&r2=1723563&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java (original)
+++ qpid/java/trunk/bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacade.java Thu Jan  7 14:34:00 2016
@@ -742,6 +742,14 @@ public class ReplicatedEnvironmentFacade
                 throw new ConnectionScopedRuntimeException("Cannot set cache size to " + cacheSize + " on node " + _prettyGroupNodeName, e);
             }
         }
+        else
+        {
+            throw new ConnectionScopedRuntimeException("Cannot set cache size to "
+                                                       + cacheSize
+                                                       + " on node "
+                                                       + _prettyGroupNodeName
+                                                       + " as environment does not exist");
+        }
     }
 
 
@@ -878,7 +886,8 @@ public class ReplicatedEnvironmentFacade
             catch (RuntimeException e)
             {
                 RuntimeException handled = handleDatabaseException("Exception on setting designated primary", e);
-                if (handled instanceof ConnectionScopedRuntimeException || handled instanceof ServerScopedRuntimeException)
+                if (handled instanceof ConnectionScopedRuntimeException
+                    || handled instanceof ServerScopedRuntimeException)
                 {
                     throw handled;
                 }
@@ -886,7 +895,14 @@ public class ReplicatedEnvironmentFacade
                                                            isPrimary + " on node " + _prettyGroupNodeName, handled);
             }
         }
-
+        else
+        {
+            throw new ConnectionScopedRuntimeException("Cannot set designated primary to "
+                                                       + isPrimary
+                                                       + " on node "
+                                                       + _prettyGroupNodeName
+                                                       + " as environment does not exist");
+        }
     }
 
     int getPriority()
@@ -943,6 +959,14 @@ public class ReplicatedEnvironmentFacade
                                                            + _prettyGroupNodeName, e);
             }
         }
+        else
+        {
+            throw new ConnectionScopedRuntimeException("Cannot set priority to "
+                                                       + priority
+                                                       + " on node "
+                                                       + _prettyGroupNodeName
+                                                       + " as environment does not exists");
+        }
     }
 
     int getElectableGroupSizeOverride()
@@ -1002,6 +1026,14 @@ public class ReplicatedEnvironmentFacade
                                                            + _prettyGroupNodeName, e);
             }
         }
+        else
+        {
+            throw new ConnectionScopedRuntimeException("Cannot set electable group size to "
+                                                       + electableGroupOverride
+                                                       + " on node "
+                                                       + _prettyGroupNodeName
+                                                       + " as environment does not exists");
+        }
     }
 
     public Future<Void> transferMasterToSelfAsynchronously()



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org