Merge "BUG 2676 : Add a diagnostic log message to detect delay in ApplyState processing"
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / base / messages / ApplyState.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.cluster.raft.base.messages;
10
11 import akka.actor.ActorRef;
12 import java.io.Serializable;
13 import org.opendaylight.controller.cluster.raft.ReplicatedLogEntry;
14
15 public class ApplyState implements Serializable {
16     private static final long serialVersionUID = 1L;
17     private final ActorRef clientActor;
18     private final String identifier;
19     private final ReplicatedLogEntry replicatedLogEntry;
20     private final long startTime;
21
22     public ApplyState(ActorRef clientActor, String identifier,
23         ReplicatedLogEntry replicatedLogEntry) {
24         this.clientActor = clientActor;
25         this.identifier = identifier;
26         this.replicatedLogEntry = replicatedLogEntry;
27         this.startTime = System.nanoTime();
28     }
29
30     public ActorRef getClientActor() {
31         return clientActor;
32     }
33
34     public String getIdentifier() {
35         return identifier;
36     }
37
38     public ReplicatedLogEntry getReplicatedLogEntry() {
39         return replicatedLogEntry;
40     }
41
42     public long getStartTime() {
43         return startTime;
44     }
45
46     @Override
47     public String toString() {
48         return "ApplyState{" +
49                 "identifier='" + identifier + '\'' +
50                 ", replicatedLogEntry.index =" + replicatedLogEntry.getIndex() +
51                 ", startTime=" + startTime +
52                 '}';
53     }
54 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.