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  
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 data structure that has Server address and startcode.
54     * @return The HServerInfo for this RegionServer.
55     */
56    public HServerInfo getServerInfo();
57  
58    /**
59     * Tasks to perform after region open to complete deploy of region on
60     * regionserver
61     * @param r Region to open.
62     * @param ct Instance of {@link CatalogTracker}
63     * @param daughter True if this is daughter of a split
64     * @throws KeeperException
65     * @throws IOException
66     */
67    public void postOpenDeployTasks(final HRegion r, final CatalogTracker ct,
68        final boolean daughter)
69    throws KeeperException, IOException;
70  
71    /**
72     * Returns a reference to the RPC server metrics.
73     */
74    public HBaseRpcMetrics getRpcMetrics();
75  }