Add DOM blueprint XML
[mdsal.git] / dom / mdsal-dom-broker / src / main / java / org / opendaylight / mdsal / dom / broker / DOMNotificationRouter.java
index 78ba3cc19b6b75ac1a7a40396f49d0b2654ec904..e8a307c95841474ed3afdf7e86cd195a40981475 100644 (file)
@@ -105,6 +105,8 @@ public class DOMNotificationRouter implements AutoCloseable, DOMNotificationPubl
 
     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);