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%2FPurgeLocalHistoryPayload.java;h=8d9a8d217a67e201dda8c8f9ba9f705ac939557c;hb=1d5ca4009be6c61d7b61989799037ad8f1ab7a75;hp=91ad74d505e5494521d4d27d0d9864d47b34909d;hpb=de64c6bbf2d5aeb51f4036f9dd606a9bf6f71afb;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/PurgeLocalHistoryPayload.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/PurgeLocalHistoryPayload.java index 91ad74d505..8d9a8d217a 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/PurgeLocalHistoryPayload.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/persisted/PurgeLocalHistoryPayload.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; @@ -56,14 +55,15 @@ public final class PurgeLocalHistoryPayload extends AbstractIdentifiablePayload< super(historyId, serialized); } - public static PurgeLocalHistoryPayload create(final LocalHistoryIdentifier historyId) { - final ByteArrayDataOutput out = ByteStreams.newDataOutput(); + public static PurgeLocalHistoryPayload 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 PurgeLocalHistoryPayload(historyId, out.toByteArray()); }