Modify config Module impls to co-exist with blueprint
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / DOMNotificationRouter.java
index 138de6b77068fc06ee9cd4e1dbe160a94f3a92fc..64c6b9e1fd1791a4e29e5868e64cf89975b9a2dd 100644 (file)
@@ -98,6 +98,8 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
     }
 
     public static DOMNotificationRouter create(final int queueDepth, final long spinTime, final long parkTime, final TimeUnit unit) {
+        Preconditions.checkArgument(Long.lowestOneBit(queueDepth) == Long.highestOneBit(queueDepth),
+                "Queue depth %s is not power-of-two", queueDepth);
         final ExecutorService executor = Executors.newCachedThreadPool();
         final WaitStrategy strategy = PhasedBackoffWaitStrategy.withLock(spinTime, parkTime, unit);