NormalizedNodeAggregator should also report empty
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / persisted / CreateLocalHistoryPayload.java
index 4b824bbb4e0c4b1a4ead8ccdc6694d51dec5f478..dbf72f38d8de0f0016a4651c3ef46fcebe5e4760 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.controller.cluster.datastore.persisted;
 
-import com.google.common.base.Throwables;
 import com.google.common.io.ByteArrayDataOutput;
 import com.google.common.io.ByteStreams;
 import java.io.DataInput;
@@ -55,14 +54,15 @@ public final class CreateLocalHistoryPayload extends AbstractIdentifiablePayload
         super(historyId, serialized);
     }
 
-    public static CreateLocalHistoryPayload create(final LocalHistoryIdentifier historyId) {
-        final ByteArrayDataOutput out = ByteStreams.newDataOutput();
+    public static CreateLocalHistoryPayload create(final LocalHistoryIdentifier historyId,
+            final int initialSerializedBufferCapacity) {
+        final ByteArrayDataOutput out = ByteStreams.newDataOutput(initialSerializedBufferCapacity);
         try {
             historyId.writeTo(out);
         } catch (IOException e) {
             // This should never happen
             LOG.error("Failed to serialize {}", historyId, e);
-            throw Throwables.propagate(e);
+            throw new RuntimeException("Failed to serialize " + historyId, e);
         }
         return new CreateLocalHistoryPayload(historyId, out.toByteArray());
     }