HBASE-26481 Consider rolling upgrading from old region replication framework (#3880)
[hbase.git] / hbase-client / src / main / java / org / apache / hadoop / hbase / ServerMetrics.java
blob9b2dc409acdbc06568a0cfbb60495b0288422789
1 /**
2 * Copyright The Apache Software Foundation
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
18 package org.apache.hadoop.hbase;
20 import edu.umd.cs.findbugs.annotations.Nullable;
21 import java.util.List;
22 import java.util.Map;
23 import java.util.Set;
24 import org.apache.hadoop.hbase.replication.ReplicationLoadSink;
25 import org.apache.hadoop.hbase.replication.ReplicationLoadSource;
26 import org.apache.yetus.audience.InterfaceAudience;
28 /**
29 * This class is used for exporting current state of load on a RegionServer.
31 @InterfaceAudience.Public
32 public interface ServerMetrics {
34 ServerName getServerName();
36 /**
37 * @return the version number of a regionserver.
39 default int getVersionNumber() {
40 return 0;
43 /**
44 * @return the string type version of a regionserver.
46 default String getVersion() {
47 return "0.0.0";
50 /**
51 * @return the number of requests per second.
53 long getRequestCountPerSecond();
55 /**
56 * @return total Number of requests from the start of the region server.
58 long getRequestCount();
60 /**
61 * @return total Number of read requests from the start of the region server.
63 long getReadRequestsCount();
65 /**
66 * @return total Number of write requests from the start of the region server.
68 long getWriteRequestsCount();
70 /**
71 * @return the amount of used heap
73 Size getUsedHeapSize();
75 /**
76 * @return the maximum allowable size of the heap
78 Size getMaxHeapSize();
80 int getInfoServerPort();
82 /**
83 * Call directly from client such as hbase shell
84 * @return the list of ReplicationLoadSource
86 List<ReplicationLoadSource> getReplicationLoadSourceList();
88 /**
89 * Call directly from client such as hbase shell
90 * @return a map of ReplicationLoadSource list per peer id
92 Map<String, List<ReplicationLoadSource>> getReplicationLoadSourceMap();
94 /**
95 * Call directly from client such as hbase shell
96 * @return ReplicationLoadSink
98 @Nullable
99 ReplicationLoadSink getReplicationLoadSink();
102 * @return region load metrics
104 Map<byte[], RegionMetrics> getRegionMetrics();
107 * @return metrics per user
109 Map<byte[], UserMetrics> getUserMetrics();
112 * Return the RegionServer-level and Region-level coprocessors
113 * @return string set of loaded RegionServer-level and Region-level coprocessors
115 Set<String> getCoprocessorNames();
118 * @return the timestamp (server side) of generating this metrics
120 long getReportTimestamp();
123 * @return the last timestamp (server side) of generating this metrics
125 long getLastReportTimestamp();