HBASE-16012 Major compaction can't work due to obsolete scanner read point in RegionS...
[hbase.git] / hbase-server / src / main / java / org / apache / hadoop / hbase / regionserver / OnlineRegions.java
blob310108c0dc72babd2884a4fa24bbfa70a56062f0
1 /**
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 package org.apache.hadoop.hbase.regionserver;
21 import java.io.IOException;
22 import java.util.List;
24 import org.apache.hadoop.hbase.classification.InterfaceAudience;
25 import org.apache.hadoop.hbase.classification.InterfaceStability;
26 import org.apache.hadoop.hbase.HBaseInterfaceAudience;
27 import org.apache.hadoop.hbase.TableName;
28 import org.apache.hadoop.hbase.Server;
29 import org.apache.hadoop.hbase.ServerName;
31 /**
32 * Interface to Map of online regions. In the Map, the key is the region's
33 * encoded name and the value is an {@link Region} instance.
35 @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
36 @InterfaceStability.Evolving
37 public interface OnlineRegions extends Server {
38 /**
39 * Add to online regions.
40 * @param r
42 void addToOnlineRegions(final Region r);
44 /**
45 * This method removes Region corresponding to hri from the Map of onlineRegions.
47 * @param r Region to remove.
48 * @param destination Destination, if any, null otherwise.
49 * @return True if we removed a region from online list.
51 boolean removeFromOnlineRegions(final Region r, ServerName destination);
53 /**
54 * Return {@link Region} instance.
55 * Only works if caller is in same context, in same JVM. Region is not
56 * serializable.
57 * @param encodedRegionName
58 * @return Region for the passed encoded <code>encodedRegionName</code> or
59 * null if named region is not member of the online regions.
61 Region getFromOnlineRegions(String encodedRegionName);
63 /**
64 * Get all online regions of a table in this RS.
65 * @param tableName
66 * @return List of Region
67 * @throws java.io.IOException
69 List<Region> getOnlineRegions(TableName tableName) throws IOException;
71 /**
72 * Get all online regions in this RS.
73 * @return List of online Region
75 List<Region> getOnlineRegions();