View Javadoc

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  
24  import org.apache.hadoop.hbase.HServerInfo;
25  import org.apache.hadoop.hbase.catalog.CatalogTracker;
26  import org.apache.hadoop.hbase.ipc.HBaseRpcMetrics;
27  import org.apache.hadoop.hbase.regionserver.wal.HLog;
28  import org.apache.zookeeper.KeeperException;
29  import java.util.Set;
30  
31  /**
32   * Services provided by {@link HRegionServer}
33   */
34  public interface RegionServerServices extends OnlineRegions {
35    /**
36     * @return True if this regionserver is stopping.
37     */
38    public boolean isStopping();
39  
40    /** @return the HLog */
41    public HLog getWAL();
42  
43    /**
44     * @return Implementation of {@link CompactionRequestor} or null.
45     */
46    public CompactionRequestor getCompactionRequester();
47    
48    /**
49     * @return Implementation of {@link FlushRequester} or null.
50     */
51    public FlushRequester getFlushRequester();
52  
53    /**
54     * Return data structure that has Server address and startcode.
55     * @return The HServerInfo for this RegionServer.
56     */
57    public HServerInfo getServerInfo();
58  
59    /**
60     * Tasks to perform after region open to complete deploy of region on
61     * regionserver
62     * @param r Region to open.
63     * @param ct Instance of {@link CatalogTracker}
64     * @param daughter True if this is daughter of a split
65     * @throws KeeperException
66     * @throws IOException
67     */
68    public void postOpenDeployTasks(final HRegion r, final CatalogTracker ct,
69        final boolean daughter)
70    throws KeeperException, IOException;
71  
72    /**
73     * Returns a reference to the RPC server metrics.
74     */
75    public HBaseRpcMetrics getRpcMetrics();
76  
77    /**
78     * Get the regions that are currently being opened or closed in the RS
79     * @return set of regions in transition in this RS
80     */
81    public Set<byte[]> getRegionsInTransitionInRS();
82  }