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