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 @edu.umd.cs.findbugs.annotations.SuppressWarnings(value = "MS_EXPOSE_REP", 036 justification = "singleton pattern") 037 public static NoOpRegionSizeStore getInstance() { 038 return INSTANCE; 039 } 040 041 @Override 042 public Iterator<Entry<RegionInfo, RegionSize>> iterator() { 043 return null; 044 } 045 046 @Override 047 public long heapSize() { 048 return 0; 049 } 050 051 @Override 052 public RegionSize getRegionSize(RegionInfo regionInfo) { 053 return null; 054 } 055 056 @Override 057 public void put(RegionInfo regionInfo, long size) { 058 } 059 060 @Override 061 public void incrementRegionSize(RegionInfo regionInfo, long delta) { 062 } 063 064 @Override 065 public RegionSize remove(RegionInfo regionInfo) { 066 return null; 067 } 068 069 @Override 070 public int size() { 071 return 0; 072 } 073 074 @Override 075 public boolean isEmpty() { 076 return true; 077 } 078 079 @Override 080 public void clear() { 081 } 082}