1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.hadoop.hbase.namequeues;
21
22 import com.google.protobuf.Descriptors;
23 import com.google.protobuf.Message;
24 import org.apache.commons.lang.builder.ToStringBuilder;
25 import org.apache.hadoop.hbase.classification.InterfaceAudience;
26
27
28
29
30 @InterfaceAudience.Private
31 public class RpcLogDetails extends NamedQueuePayload {
32
33 public static final int SLOW_LOG_EVENT = 0;
34
35 private final Descriptors.MethodDescriptor methodDescriptor;
36 private final Message param;
37 private final String clientAddress;
38 private final long responseSize;
39 private final String className;
40 private final boolean isSlowLog;
41 private final boolean isLargeLog;
42 private final long receiveTime;
43 private final long startTime;
44 private final String userName;
45
46 public RpcLogDetails(Descriptors.MethodDescriptor methodDescriptor, Message param,
47 String clientAddress, long responseSize, String className, boolean isSlowLog,
48 boolean isLargeLog, long receiveTime, long startTime, String userName) {
49 super(SLOW_LOG_EVENT);
50 this.methodDescriptor = methodDescriptor;
51 this.param = param;
52 this.clientAddress = clientAddress;
53 this.responseSize = responseSize;
54 this.className = className;
55 this.isSlowLog = isSlowLog;
56 this.isLargeLog = isLargeLog;
57 this.receiveTime = receiveTime;
58 this.startTime = startTime;
59 this.userName = userName;
60 }
61
62 public Descriptors.MethodDescriptor getMethodDescriptor() {
63 return methodDescriptor;
64 }
65
66 public String getClientAddress() {
67 return clientAddress;
68 }
69
70 public long getResponseSize() {
71 return responseSize;
72 }
73
74 public String getClassName() {
75 return className;
76 }
77
78 public boolean isSlowLog() {
79 return isSlowLog;
80 }
81
82 public boolean isLargeLog() {
83 return isLargeLog;
84 }
85
86 public Message getParam() {
87 return param;
88 }
89
90 public long getReceiveTime() {
91 return receiveTime;
92 }
93
94 public long getStartTime() {
95 return startTime;
96 }
97
98 public String getUserName() {
99 return userName;
100 }
101
102 @Override
103 public String toString() {
104 return new ToStringBuilder(this)
105 .append("methodDescriptor", methodDescriptor)
106 .append("param", param)
107 .append("clientAddress", clientAddress)
108 .append("responseSize", responseSize)
109 .append("className", className)
110 .append("isSlowLog", isSlowLog)
111 .append("isLargeLog", isLargeLog)
112 .append("receiveTime", receiveTime)
113 .append("startTime", startTime)
114 .append("userName", userName)
115 .toString();
116 }
117 }