001/** 002 * Licensed to the Apache Software Foundation (ASF) under one or more contributor license 003 * agreements. See the NOTICE file distributed with this work for additional information regarding 004 * copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the 005 * "License"); you may not use this file except in compliance with the License. You may obtain a 006 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable 007 * law or agreed to in writing, software distributed under the License is distributed on an "AS IS" 008 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License 009 * for the specific language governing permissions and limitations under the License. 010 */ 011package org.apache.hadoop.hbase.replication; 012 013import org.apache.yetus.audience.InterfaceAudience; 014 015/** 016 * A HBase ReplicationLoad to present MetricsSink information 017 */ 018@InterfaceAudience.Public 019public class ReplicationLoadSink { 020 private final long ageOfLastAppliedOp; 021 private final long timestampsOfLastAppliedOp; 022 private final long timestampStarted; 023 private final long totalOpsProcessed; 024 025 // TODO: add the builder for this class 026 @InterfaceAudience.Private 027 public ReplicationLoadSink(long age, long timestamp, long timestampStarted, 028 long totalOpsProcessed) { 029 this.ageOfLastAppliedOp = age; 030 this.timestampsOfLastAppliedOp = timestamp; 031 this.timestampStarted = timestampStarted; 032 this.totalOpsProcessed = totalOpsProcessed; 033 } 034 035 public long getAgeOfLastAppliedOp() { 036 return this.ageOfLastAppliedOp; 037 } 038 039 /** 040 * @deprecated Since hbase-2.0.0. Will be removed in 3.0.0. 041 * @see #getTimestampsOfLastAppliedOp() 042 */ 043 @Deprecated 044 public long getTimeStampsOfLastAppliedOp() { 045 return getTimestampsOfLastAppliedOp(); 046 } 047 048 public long getTimestampsOfLastAppliedOp() { 049 return this.timestampsOfLastAppliedOp; 050 } 051 052 public long getTimestampStarted() { 053 return timestampStarted; 054 } 055 056 public long getTotalOpsProcessed() { 057 return totalOpsProcessed; 058 } 059}