*/
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;
super(historyId, serialized);
}
- public static CloseLocalHistoryPayload create(final LocalHistoryIdentifier historyId) {
- final ByteArrayDataOutput out = ByteStreams.newDataOutput();
+ public static CloseLocalHistoryPayload 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 CloseLocalHistoryPayload(historyId, out.toByteArray());
}