View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
3    * agreements. See the NOTICE file distributed with this work for additional information regarding
4    * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with the License. You may obtain a
6    * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable
7    * law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
8    * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
9    * for the specific language governing permissions and limitations under the License.
10   */
11  package org.apache.hadoop.hbase.replication;
12  
13  import org.apache.hadoop.hbase.classification.InterfaceAudience;
14  
15  /**
16   * A HBase ReplicationLoad to present MetricsSource information
17   */
18  @InterfaceAudience.Private
19  public class ReplicationLoadSource {
20    private String peerID;
21    private long ageOfLastShippedOp;
22    private int sizeOfLogQueue;
23    private long timeStampOfLastShippedOp;
24    private long replicationLag;
25  
26    public ReplicationLoadSource(String id, long age, int size, long timeStamp, long lag) {
27      this.peerID = id;
28      this.ageOfLastShippedOp = age;
29      this.sizeOfLogQueue = size;
30      this.timeStampOfLastShippedOp = timeStamp;
31      this.replicationLag = lag;
32    }
33  
34    public String getPeerID() {
35      return this.peerID;
36    }
37  
38    public long getAgeOfLastShippedOp() {
39      return this.ageOfLastShippedOp;
40    }
41  
42    public long getSizeOfLogQueue() {
43      return this.sizeOfLogQueue;
44    }
45  
46    public long getTimeStampOfLastShippedOp() {
47      return this.timeStampOfLastShippedOp;
48    }
49  
50    public long getReplicationLag() {
51      return this.replicationLag;
52    }
53  }