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