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.quotas;
019
020import java.util.Iterator;
021import java.util.Map.Entry;
022import org.apache.hadoop.hbase.client.RegionInfo;
023import org.apache.yetus.audience.InterfaceAudience;
024
025/**
026 * A {@link RegionSizeStore} implementation that stores nothing.
027 */
028@InterfaceAudience.Private
029public final class NoOpRegionSizeStore implements RegionSizeStore {
030  private static final NoOpRegionSizeStore INSTANCE = new NoOpRegionSizeStore();
031
032  private NoOpRegionSizeStore() {
033  }
034
035  public static NoOpRegionSizeStore getInstance() {
036    return INSTANCE;
037  }
038
039  @Override
040  public Iterator<Entry<RegionInfo, RegionSize>> iterator() {
041    return null;
042  }
043
044  @Override
045  public long heapSize() {
046    return 0;
047  }
048
049  @Override
050  public RegionSize getRegionSize(RegionInfo regionInfo) {
051    return null;
052  }
053
054  @Override
055  public void put(RegionInfo regionInfo, long size) {
056  }
057
058  @Override
059  public void incrementRegionSize(RegionInfo regionInfo, long delta) {
060  }
061
062  @Override
063  public RegionSize remove(RegionInfo regionInfo) {
064    return null;
065  }
066
067  @Override
068  public int size() {
069    return 0;
070  }
071
072  @Override
073  public boolean isEmpty() {
074    return true;
075  }
076
077  @Override
078  public void clear() {
079  }
080}