1 /**
2 * Copyright 2010 The Apache Software Foundation
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20 package org.apache.hadoop.hbase.regionserver;
21
22 import java.io.IOException;
23 import java.util.Map;
24
25 import org.apache.hadoop.hbase.catalog.CatalogTracker;
26 import org.apache.hadoop.hbase.ipc.RpcServer;
27 import org.apache.hadoop.hbase.regionserver.wal.HLog;
28 import org.apache.zookeeper.KeeperException;
29
30 /**
31 * Services provided by {@link HRegionServer}
32 */
33 public interface RegionServerServices extends OnlineRegions {
34 /**
35 * @return True if this regionserver is stopping.
36 */
37 public boolean isStopping();
38
39 /** @return the HLog */
40 public HLog getWAL();
41
42 /**
43 * @return Implementation of {@link CompactionRequestor} or null.
44 */
45 public CompactionRequestor getCompactionRequester();
46
47 /**
48 * @return Implementation of {@link FlushRequester} or null.
49 */
50 public FlushRequester getFlushRequester();
51
52 /**
53 * @return the RegionServerAccounting for this Region Server
54 */
55 public RegionServerAccounting getRegionServerAccounting();
56
57 /**
58 * Tasks to perform after region open to complete deploy of region on
59 * regionserver
60 * @param r Region to open.
61 * @param ct Instance of {@link CatalogTracker}
62 * @param daughter True if this is daughter of a split
63 * @throws KeeperException
64 * @throws IOException
65 */
66 public void postOpenDeployTasks(final HRegion r, final CatalogTracker ct,
67 final boolean daughter)
68 throws KeeperException, IOException;
69
70 /**
71 * Returns a reference to the region server's RPC server
72 */
73 public RpcServer getRpcServer();
74
75 /**
76 * Get the regions that are currently being opened or closed in the RS
77 * @return map of regions in transition in this RS
78 */
79 public Map<byte[], Boolean> getRegionsInTransitionInRS();
80
81 }