1 /** 2 * 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 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 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. 18 */ 19 package org.apache.hadoop.hbase.regionserver; 20 21 import org.apache.hadoop.classification.InterfaceAudience; 22 import org.apache.hadoop.fs.FileSystem; 23 import org.apache.hadoop.hbase.HRegionInfo; 24 import org.apache.hadoop.hbase.catalog.CatalogTracker; 25 import org.apache.hadoop.hbase.executor.ExecutorService; 26 import org.apache.hadoop.hbase.ipc.PriorityFunction; 27 import org.apache.hadoop.hbase.ipc.RpcServerInterface; 28 import org.apache.hadoop.hbase.master.TableLockManager; 29 import org.apache.hadoop.hbase.regionserver.wal.HLog; 30 import org.apache.zookeeper.KeeperException; 31 32 import java.io.IOException; 33 import java.util.Map; 34 import java.util.concurrent.ConcurrentMap; 35 36 /** 37 * Services provided by {@link HRegionServer} 38 */ 39 @InterfaceAudience.Private 40 public interface RegionServerServices 41 extends OnlineRegions, FavoredNodesForRegion, PriorityFunction { 42 /** 43 * @return True if this regionserver is stopping. 44 */ 45 boolean isStopping(); 46 47 /** @return the HLog for a particular region. Pass null for getting the 48 * default (common) WAL */ 49 HLog getWAL(HRegionInfo regionInfo) throws IOException; 50 51 /** 52 * @return Implementation of {@link CompactionRequestor} or null. 53 */ 54 CompactionRequestor getCompactionRequester(); 55 56 /** 57 * @return Implementation of {@link FlushRequester} or null. 58 */ 59 FlushRequester getFlushRequester(); 60 61 /** 62 * @return the RegionServerAccounting for this Region Server 63 */ 64 RegionServerAccounting getRegionServerAccounting(); 65 66 /** 67 * @return RegionServer's instance of {@link TableLockManager} 68 */ 69 TableLockManager getTableLockManager(); 70 71 /** 72 * Tasks to perform after region open to complete deploy of region on 73 * regionserver 74 * 75 * @param r Region to open. 76 * @param ct Instance of {@link CatalogTracker} 77 * @throws KeeperException 78 * @throws IOException 79 */ 80 void postOpenDeployTasks(final HRegion r, final CatalogTracker ct) 81 throws KeeperException, IOException; 82 83 /** 84 * Returns a reference to the region server's RPC server 85 */ 86 RpcServerInterface getRpcServer(); 87 88 /** 89 * Get the regions that are currently being opened or closed in the RS 90 * @return map of regions in transition in this RS 91 */ 92 ConcurrentMap<byte[], Boolean> getRegionsInTransitionInRS(); 93 94 /** 95 * @return Return the FileSystem object used by the regionserver 96 */ 97 FileSystem getFileSystem(); 98 99 /** 100 * @return The RegionServer's "Leases" service 101 */ 102 Leases getLeases(); 103 104 /** 105 * @return hbase executor service 106 */ 107 ExecutorService getExecutorService(); 108 109 /** 110 * @return The RegionServer's CatalogTracker 111 */ 112 CatalogTracker getCatalogTracker(); 113 114 /** 115 * @return set of recovering regions on the hosting region server 116 */ 117 Map<String, HRegion> getRecoveringRegions(); 118 119 /** 120 * Only required for "old" log replay; if it's removed, remove this. 121 * @return The RegionServer's NonceManager 122 */ 123 public ServerNonceManager getNonceManager(); 124 }