2 * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.raft.persisted;
10 import akka.dispatch.ControlMessage;
11 import java.io.Serializable;
12 import org.apache.commons.lang3.SerializationUtils;
13 import org.opendaylight.controller.cluster.raft.messages.Payload;
16 * Payload used for no-op log entries that are put into the journal by the PreLeader in order to commit
17 * entries from the prior term.
19 * @author Thomas Pantelis
21 public final class NoopPayload extends Payload implements ControlMessage {
22 public static final NoopPayload INSTANCE = new NoopPayload();
24 // There is no need for Externalizable
25 private static final class Proxy implements Serializable {
26 private static final long serialVersionUID = 1L;
28 private Object readResolve() {
33 private static final long serialVersionUID = 1L;
34 private static final Proxy PROXY = new Proxy();
35 // Estimate to how big the proxy is. Note this includes object stream overhead, so it is a bit conservative
36 private static final int PROXY_SIZE = SerializationUtils.serialize(PROXY).length;
38 private NoopPayload() {
48 public int serializedSize() {
53 protected Object writeReplace() {