001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to you under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.hadoop.hbase.quotas; 018 019import java.util.Iterator; 020import java.util.Map.Entry; 021 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 public static NoOpRegionSizeStore getInstance() { 035 return INSTANCE; 036 } 037 038 @Override 039 public Iterator<Entry<RegionInfo,RegionSize>> iterator() { 040 return null; 041 } 042 043 @Override 044 public long heapSize() { 045 return 0; 046 } 047 048 @Override 049 public RegionSize getRegionSize(RegionInfo regionInfo) { 050 return null; 051 } 052 053 @Override 054 public void put(RegionInfo regionInfo, long size) {} 055 056 @Override 057 public void incrementRegionSize(RegionInfo regionInfo, long delta) {} 058 059 @Override 060 public RegionSize remove(RegionInfo regionInfo) { 061 return null; 062 } 063 064 @Override 065 public int size() { 066 return 0; 067 } 068 069 @Override 070 public boolean isEmpty() { 071 return true; 072 } 073 074 @Override 075 public void clear() {} 076}