X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fpersisted%2FCreateLocalHistoryPayload.java;h=dbf72f38d8de0f0016a4651c3ef46fcebe5e4760;hb=4653b3b0b0f0a77a3306d8978970a6bf437ab373;hp=4b824bbb4e0c4b1a4ead8ccdc6694d51dec5f478;hpb=de64c6bbf2d5aeb51f4036f9dd606a9bf6f71afb;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CreateLocalHistoryPayload.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CreateLocalHistoryPayload.java index 4b824bbb4e..dbf72f38d8 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CreateLocalHistoryPayload.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/CreateLocalHistoryPayload.java @@ -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()); }