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.master.http.hbck.model;
019
020import java.util.List;
021import org.apache.hadoop.hbase.HbckEmptyRegionInfo;
022import org.apache.hadoop.hbase.HbckInconsistentRegions;
023import org.apache.hadoop.hbase.HbckOrphanRegionsOnFS;
024import org.apache.hadoop.hbase.HbckOrphanRegionsOnRS;
025import org.apache.hadoop.hbase.HbckOverlapRegions;
026import org.apache.hadoop.hbase.HbckRegionHoles;
027import org.apache.hadoop.hbase.HbckUnknownServers;
028import org.apache.yetus.audience.InterfaceAudience;
029
030/**
031 * This class exposes hbck.jsp report as JSON Output via /hbck/hbck-metrics API.
032 */
033@InterfaceAudience.Private
034public class HbckMetrics {
035
036  private final long hbckReportStartTime;
037  private final long hbckReportEndTime;
038  private final List<HbckOrphanRegionsOnFS> hbckOrphanRegionsOnFs;
039  private final List<HbckOrphanRegionsOnRS> hbckOrphanRegionsOnRs;
040  private final List<HbckInconsistentRegions> hbckInconsistentRegions;
041  private final List<HbckRegionHoles> hbckHoles;
042  private final List<HbckOverlapRegions> hbckOverlaps;
043  private final List<HbckUnknownServers> hbckUnknownServers;
044  private final List<HbckEmptyRegionInfo> hbckEmptyRegionInfo;
045
046  public HbckMetrics(long hbckReportStartTime, long hbckReportEndTime,
047    List<HbckOrphanRegionsOnFS> hbckOrphanRegionsOnFs,
048    List<HbckOrphanRegionsOnRS> hbckOrphanRegionsOnRs,
049    List<HbckInconsistentRegions> hbckInconsistentRegions, List<HbckRegionHoles> hbckHoles,
050    List<HbckOverlapRegions> hbckOverlaps, List<HbckUnknownServers> hbckUnknownServers,
051    List<HbckEmptyRegionInfo> hbckEmptyRegionInfo) {
052    this.hbckReportStartTime = hbckReportStartTime;
053    this.hbckReportEndTime = hbckReportEndTime;
054    this.hbckOrphanRegionsOnFs = hbckOrphanRegionsOnFs;
055    this.hbckOrphanRegionsOnRs = hbckOrphanRegionsOnRs;
056    this.hbckInconsistentRegions = hbckInconsistentRegions;
057    this.hbckHoles = hbckHoles;
058    this.hbckOverlaps = hbckOverlaps;
059    this.hbckUnknownServers = hbckUnknownServers;
060    this.hbckEmptyRegionInfo = hbckEmptyRegionInfo;
061  }
062
063  public long gethbckReportStartTime() {
064    return hbckReportStartTime;
065  }
066
067  public long gethbckReportEndTime() {
068    return hbckReportEndTime;
069  }
070
071  public List<HbckOrphanRegionsOnFS> gethbckOrphanRegionsOnFs() {
072    return hbckOrphanRegionsOnFs;
073  }
074
075  public List<HbckOrphanRegionsOnRS> gethbckOrphanRegionsOnRs() {
076    return hbckOrphanRegionsOnRs;
077  }
078
079  public List<HbckInconsistentRegions> gethbckInconsistentRegions() {
080    return hbckInconsistentRegions;
081  }
082
083  public List<HbckRegionHoles> gethbckHoles() {
084    return hbckHoles;
085  }
086
087  public List<HbckOverlapRegions> gethbckOverlaps() {
088    return hbckOverlaps;
089  }
090
091  public List<HbckUnknownServers> gethbckUnknownServers() {
092    return hbckUnknownServers;
093  }
094
095  public List<HbckEmptyRegionInfo> gethbckEmptyRegionInfo() {
096    return hbckEmptyRegionInfo;
097  }
098}