hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [29/51] [partial] hbase-site git commit: Published site at .
Date Thu, 17 Aug 2017 15:07:39 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/33bc9e06/devapidocs/src-html/org/apache/hadoop/hbase/master/LoadBalancer.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/LoadBalancer.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/LoadBalancer.html
index a72acb5..a3214af 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/LoadBalancer.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/LoadBalancer.html
@@ -26,136 +26,163 @@
 <span class="sourceLineNo">018</span> */<a name="line.18"></a>
 <span class="sourceLineNo">019</span>package org.apache.hadoop.hbase.master;<a
name="line.19"></a>
 <span class="sourceLineNo">020</span><a name="line.20"></a>
-<span class="sourceLineNo">021</span>import java.util.List;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import java.util.Map;<a name="line.22"></a>
-<span class="sourceLineNo">023</span><a name="line.23"></a>
-<span class="sourceLineNo">024</span>import org.apache.hadoop.conf.Configurable;<a
name="line.24"></a>
-<span class="sourceLineNo">025</span>import org.apache.hadoop.conf.Configuration;<a
name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.ClusterStatus;<a
name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.HBaseIOException;<a
name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.HRegionInfo;<a
name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.ServerName;<a
name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.Stoppable;<a
name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.TableName;<a
name="line.31"></a>
-<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a
name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.conf.ConfigurationObserver;<a
name="line.33"></a>
-<span class="sourceLineNo">034</span><a name="line.34"></a>
-<span class="sourceLineNo">035</span>import edu.umd.cs.findbugs.annotations.Nullable;<a
name="line.35"></a>
-<span class="sourceLineNo">036</span><a name="line.36"></a>
-<span class="sourceLineNo">037</span>/**<a name="line.37"></a>
-<span class="sourceLineNo">038</span> * Makes decisions about the placement and
movement of Regions across<a name="line.38"></a>
-<span class="sourceLineNo">039</span> * RegionServers.<a name="line.39"></a>
-<span class="sourceLineNo">040</span> *<a name="line.40"></a>
-<span class="sourceLineNo">041</span> * &lt;p&gt;Cluster-wide load balancing
will occur only when there are no regions in<a name="line.41"></a>
-<span class="sourceLineNo">042</span> * transition and according to a fixed period
of a time using {@link #balanceCluster(Map)}.<a name="line.42"></a>
-<span class="sourceLineNo">043</span> *<a name="line.43"></a>
-<span class="sourceLineNo">044</span> * &lt;p&gt;On cluster startup,
bulk assignment can be used to determine<a name="line.44"></a>
-<span class="sourceLineNo">045</span> * locations for all Regions in a cluster.<a
name="line.45"></a>
-<span class="sourceLineNo">046</span> *<a name="line.46"></a>
-<span class="sourceLineNo">047</span> * &lt;p&gt;This class produces
plans for the<a name="line.47"></a>
-<span class="sourceLineNo">048</span> * {@link org.apache.hadoop.hbase.master.assignment.AssignmentManager}<a
name="line.48"></a>
-<span class="sourceLineNo">049</span> * to execute.<a name="line.49"></a>
-<span class="sourceLineNo">050</span> */<a name="line.50"></a>
-<span class="sourceLineNo">051</span>@InterfaceAudience.Private<a name="line.51"></a>
-<span class="sourceLineNo">052</span>public interface LoadBalancer extends Configurable,
Stoppable, ConfigurationObserver {<a name="line.52"></a>
-<span class="sourceLineNo">053</span><a name="line.53"></a>
-<span class="sourceLineNo">054</span>  // Used to signal to the caller that the
region(s) cannot be assigned<a name="line.54"></a>
-<span class="sourceLineNo">055</span>  // We deliberately use 'localhost' so
the operation will fail fast<a name="line.55"></a>
-<span class="sourceLineNo">056</span>  ServerName BOGUS_SERVER_NAME = ServerName.valueOf("localhost,1,1");<a
name="line.56"></a>
-<span class="sourceLineNo">057</span><a name="line.57"></a>
-<span class="sourceLineNo">058</span>  /**<a name="line.58"></a>
-<span class="sourceLineNo">059</span>   * Set the current cluster status.  This
allows a LoadBalancer to map host name to a server<a name="line.59"></a>
-<span class="sourceLineNo">060</span>   * @param st<a name="line.60"></a>
+<span class="sourceLineNo">021</span>import java.util.*;<a name="line.21"></a>
+<span class="sourceLineNo">022</span><a name="line.22"></a>
+<span class="sourceLineNo">023</span>import com.google.common.collect.ImmutableSet;<a
name="line.23"></a>
+<span class="sourceLineNo">024</span>import com.google.common.collect.UnmodifiableIterator;<a
name="line.24"></a>
+<span class="sourceLineNo">025</span>import org.apache.hadoop.conf.Configurable;<a
name="line.25"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.conf.Configuration;<a
name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.ClusterStatus;<a
name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.hadoop.hbase.HBaseIOException;<a
name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.hadoop.hbase.HRegionInfo;<a
name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.hadoop.hbase.ServerName;<a
name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.Stoppable;<a
name="line.31"></a>
+<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.TableName;<a
name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.classification.InterfaceAudience;<a
name="line.33"></a>
+<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.conf.ConfigurationObserver;<a
name="line.34"></a>
+<span class="sourceLineNo">035</span><a name="line.35"></a>
+<span class="sourceLineNo">036</span>import edu.umd.cs.findbugs.annotations.Nullable;<a
name="line.36"></a>
+<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.security.access.AccessControlLists;<a
name="line.37"></a>
+<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting;<a
name="line.38"></a>
+<span class="sourceLineNo">039</span>import org.apache.hadoop.util.StringUtils;<a
name="line.39"></a>
+<span class="sourceLineNo">040</span><a name="line.40"></a>
+<span class="sourceLineNo">041</span>/**<a name="line.41"></a>
+<span class="sourceLineNo">042</span> * Makes decisions about the placement and
movement of Regions across<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * RegionServers.<a name="line.43"></a>
+<span class="sourceLineNo">044</span> *<a name="line.44"></a>
+<span class="sourceLineNo">045</span> * &lt;p&gt;Cluster-wide load balancing
will occur only when there are no regions in<a name="line.45"></a>
+<span class="sourceLineNo">046</span> * transition and according to a fixed period
of a time using {@link #balanceCluster(Map)}.<a name="line.46"></a>
+<span class="sourceLineNo">047</span> *<a name="line.47"></a>
+<span class="sourceLineNo">048</span> * &lt;p&gt;On cluster startup,
bulk assignment can be used to determine<a name="line.48"></a>
+<span class="sourceLineNo">049</span> * locations for all Regions in a cluster.<a
name="line.49"></a>
+<span class="sourceLineNo">050</span> *<a name="line.50"></a>
+<span class="sourceLineNo">051</span> * &lt;p&gt;This class produces
plans for the<a name="line.51"></a>
+<span class="sourceLineNo">052</span> * {@link org.apache.hadoop.hbase.master.assignment.AssignmentManager}<a
name="line.52"></a>
+<span class="sourceLineNo">053</span> * to execute.<a name="line.53"></a>
+<span class="sourceLineNo">054</span> */<a name="line.54"></a>
+<span class="sourceLineNo">055</span>@InterfaceAudience.Private<a name="line.55"></a>
+<span class="sourceLineNo">056</span>public interface LoadBalancer extends Configurable,
Stoppable, ConfigurationObserver {<a name="line.56"></a>
+<span class="sourceLineNo">057</span>  /**<a name="line.57"></a>
+<span class="sourceLineNo">058</span>   * Master can carry regions as of hbase-2.0.0.<a
name="line.58"></a>
+<span class="sourceLineNo">059</span>   * By default, it carries no tables.<a
name="line.59"></a>
+<span class="sourceLineNo">060</span>   * TODO: Add any | system as flags to
indicate what it can do.<a name="line.60"></a>
 <span class="sourceLineNo">061</span>   */<a name="line.61"></a>
-<span class="sourceLineNo">062</span>  void setClusterStatus(ClusterStatus st);<a
name="line.62"></a>
+<span class="sourceLineNo">062</span>  public static final String TABLES_ON_MASTER
= "hbase.balancer.tablesOnMaster";<a name="line.62"></a>
 <span class="sourceLineNo">063</span><a name="line.63"></a>
 <span class="sourceLineNo">064</span>  /**<a name="line.64"></a>
-<span class="sourceLineNo">065</span>   * Pass RegionStates and allow balancer
to set the current cluster load.<a name="line.65"></a>
-<span class="sourceLineNo">066</span>   * @param ClusterLoad<a name="line.66"></a>
-<span class="sourceLineNo">067</span>   */<a name="line.67"></a>
-<span class="sourceLineNo">068</span>  void setClusterLoad(Map&lt;TableName,
Map&lt;ServerName, List&lt;HRegionInfo&gt;&gt;&gt; ClusterLoad);<a
name="line.68"></a>
+<span class="sourceLineNo">065</span>   * Master carries system tables.<a
name="line.65"></a>
+<span class="sourceLineNo">066</span>   */<a name="line.66"></a>
+<span class="sourceLineNo">067</span>  public static final String SYSTEM_TABLES_ON_MASTER
=<a name="line.67"></a>
+<span class="sourceLineNo">068</span>    "hbase.balancer.tablesOnMaster.systemTablesOnly";<a
name="line.68"></a>
 <span class="sourceLineNo">069</span><a name="line.69"></a>
-<span class="sourceLineNo">070</span>  /**<a name="line.70"></a>
-<span class="sourceLineNo">071</span>   * Set the master service.<a name="line.71"></a>
-<span class="sourceLineNo">072</span>   * @param masterServices<a name="line.72"></a>
-<span class="sourceLineNo">073</span>   */<a name="line.73"></a>
-<span class="sourceLineNo">074</span>  void setMasterServices(MasterServices
masterServices);<a name="line.74"></a>
-<span class="sourceLineNo">075</span><a name="line.75"></a>
-<span class="sourceLineNo">076</span>  /**<a name="line.76"></a>
-<span class="sourceLineNo">077</span>   * Perform the major balance operation<a
name="line.77"></a>
-<span class="sourceLineNo">078</span>   * @param tableName<a name="line.78"></a>
-<span class="sourceLineNo">079</span>   * @param clusterState<a name="line.79"></a>
-<span class="sourceLineNo">080</span>   * @return List of plans<a name="line.80"></a>
-<span class="sourceLineNo">081</span>   */<a name="line.81"></a>
-<span class="sourceLineNo">082</span>  List&lt;RegionPlan&gt; balanceCluster(TableName
tableName, Map&lt;ServerName,<a name="line.82"></a>
-<span class="sourceLineNo">083</span>      List&lt;HRegionInfo&gt;&gt;
clusterState) throws HBaseIOException;<a name="line.83"></a>
-<span class="sourceLineNo">084</span><a name="line.84"></a>
-<span class="sourceLineNo">085</span>  /**<a name="line.85"></a>
-<span class="sourceLineNo">086</span>   * Perform the major balance operation<a
name="line.86"></a>
-<span class="sourceLineNo">087</span>   * @param clusterState<a name="line.87"></a>
-<span class="sourceLineNo">088</span>   * @return List of plans<a name="line.88"></a>
+<span class="sourceLineNo">070</span>  // Used to signal to the caller that the
region(s) cannot be assigned<a name="line.70"></a>
+<span class="sourceLineNo">071</span>  // We deliberately use 'localhost' so
the operation will fail fast<a name="line.71"></a>
+<span class="sourceLineNo">072</span>  ServerName BOGUS_SERVER_NAME = ServerName.valueOf("localhost,1,1");<a
name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>  /**<a name="line.74"></a>
+<span class="sourceLineNo">075</span>   * Set the current cluster status.  This
allows a LoadBalancer to map host name to a server<a name="line.75"></a>
+<span class="sourceLineNo">076</span>   * @param st<a name="line.76"></a>
+<span class="sourceLineNo">077</span>   */<a name="line.77"></a>
+<span class="sourceLineNo">078</span>  void setClusterStatus(ClusterStatus st);<a
name="line.78"></a>
+<span class="sourceLineNo">079</span><a name="line.79"></a>
+<span class="sourceLineNo">080</span>  /**<a name="line.80"></a>
+<span class="sourceLineNo">081</span>   * Pass RegionStates and allow balancer
to set the current cluster load.<a name="line.81"></a>
+<span class="sourceLineNo">082</span>   * @param ClusterLoad<a name="line.82"></a>
+<span class="sourceLineNo">083</span>   */<a name="line.83"></a>
+<span class="sourceLineNo">084</span>  void setClusterLoad(Map&lt;TableName,
Map&lt;ServerName, List&lt;HRegionInfo&gt;&gt;&gt; ClusterLoad);<a
name="line.84"></a>
+<span class="sourceLineNo">085</span><a name="line.85"></a>
+<span class="sourceLineNo">086</span>  /**<a name="line.86"></a>
+<span class="sourceLineNo">087</span>   * Set the master service.<a name="line.87"></a>
+<span class="sourceLineNo">088</span>   * @param masterServices<a name="line.88"></a>
 <span class="sourceLineNo">089</span>   */<a name="line.89"></a>
-<span class="sourceLineNo">090</span>  List&lt;RegionPlan&gt; balanceCluster(Map&lt;ServerName,<a
name="line.90"></a>
-<span class="sourceLineNo">091</span>      List&lt;HRegionInfo&gt;&gt;
clusterState) throws HBaseIOException;<a name="line.91"></a>
-<span class="sourceLineNo">092</span><a name="line.92"></a>
-<span class="sourceLineNo">093</span>  /**<a name="line.93"></a>
-<span class="sourceLineNo">094</span>   * Perform a Round Robin assignment of
regions.<a name="line.94"></a>
-<span class="sourceLineNo">095</span>   * @param regions<a name="line.95"></a>
-<span class="sourceLineNo">096</span>   * @param servers<a name="line.96"></a>
-<span class="sourceLineNo">097</span>   * @return Map of servername to regioninfos<a
name="line.97"></a>
-<span class="sourceLineNo">098</span>   */<a name="line.98"></a>
-<span class="sourceLineNo">099</span>  Map&lt;ServerName, List&lt;HRegionInfo&gt;&gt;
roundRobinAssignment(<a name="line.99"></a>
-<span class="sourceLineNo">100</span>    List&lt;HRegionInfo&gt; regions,<a
name="line.100"></a>
-<span class="sourceLineNo">101</span>    List&lt;ServerName&gt; servers<a
name="line.101"></a>
-<span class="sourceLineNo">102</span>  ) throws HBaseIOException;<a name="line.102"></a>
-<span class="sourceLineNo">103</span><a name="line.103"></a>
-<span class="sourceLineNo">104</span>  /**<a name="line.104"></a>
-<span class="sourceLineNo">105</span>   * Assign regions to the previously hosting
region server<a name="line.105"></a>
-<span class="sourceLineNo">106</span>   * @param regions<a name="line.106"></a>
-<span class="sourceLineNo">107</span>   * @param servers<a name="line.107"></a>
-<span class="sourceLineNo">108</span>   * @return List of plans<a name="line.108"></a>
-<span class="sourceLineNo">109</span>   */<a name="line.109"></a>
-<span class="sourceLineNo">110</span>  @Nullable<a name="line.110"></a>
-<span class="sourceLineNo">111</span>  Map&lt;ServerName, List&lt;HRegionInfo&gt;&gt;
retainAssignment(<a name="line.111"></a>
-<span class="sourceLineNo">112</span>    Map&lt;HRegionInfo, ServerName&gt;
regions,<a name="line.112"></a>
-<span class="sourceLineNo">113</span>    List&lt;ServerName&gt; servers<a
name="line.113"></a>
-<span class="sourceLineNo">114</span>  ) throws HBaseIOException;<a name="line.114"></a>
-<span class="sourceLineNo">115</span><a name="line.115"></a>
-<span class="sourceLineNo">116</span>  /**<a name="line.116"></a>
-<span class="sourceLineNo">117</span>   * Get a random region server from the
list<a name="line.117"></a>
-<span class="sourceLineNo">118</span>   * @param regionInfo Region for which
this selection is being done.<a name="line.118"></a>
-<span class="sourceLineNo">119</span>   * @param servers<a name="line.119"></a>
-<span class="sourceLineNo">120</span>   * @return Servername<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   */<a name="line.121"></a>
-<span class="sourceLineNo">122</span>  ServerName randomAssignment(<a name="line.122"></a>
-<span class="sourceLineNo">123</span>    HRegionInfo regionInfo, List&lt;ServerName&gt;
servers<a name="line.123"></a>
-<span class="sourceLineNo">124</span>  ) throws HBaseIOException;<a name="line.124"></a>
-<span class="sourceLineNo">125</span><a name="line.125"></a>
-<span class="sourceLineNo">126</span>  /**<a name="line.126"></a>
-<span class="sourceLineNo">127</span>   * Initialize the load balancer. Must
be called after setters.<a name="line.127"></a>
-<span class="sourceLineNo">128</span>   * @throws HBaseIOException<a name="line.128"></a>
-<span class="sourceLineNo">129</span>   */<a name="line.129"></a>
-<span class="sourceLineNo">130</span>  void initialize() throws HBaseIOException;<a
name="line.130"></a>
+<span class="sourceLineNo">090</span>  void setMasterServices(MasterServices
masterServices);<a name="line.90"></a>
+<span class="sourceLineNo">091</span><a name="line.91"></a>
+<span class="sourceLineNo">092</span>  /**<a name="line.92"></a>
+<span class="sourceLineNo">093</span>   * Perform the major balance operation<a
name="line.93"></a>
+<span class="sourceLineNo">094</span>   * @param tableName<a name="line.94"></a>
+<span class="sourceLineNo">095</span>   * @param clusterState<a name="line.95"></a>
+<span class="sourceLineNo">096</span>   * @return List of plans<a name="line.96"></a>
+<span class="sourceLineNo">097</span>   */<a name="line.97"></a>
+<span class="sourceLineNo">098</span>  List&lt;RegionPlan&gt; balanceCluster(TableName
tableName, Map&lt;ServerName,<a name="line.98"></a>
+<span class="sourceLineNo">099</span>      List&lt;HRegionInfo&gt;&gt;
clusterState) throws HBaseIOException;<a name="line.99"></a>
+<span class="sourceLineNo">100</span><a name="line.100"></a>
+<span class="sourceLineNo">101</span>  /**<a name="line.101"></a>
+<span class="sourceLineNo">102</span>   * Perform the major balance operation<a
name="line.102"></a>
+<span class="sourceLineNo">103</span>   * @param clusterState<a name="line.103"></a>
+<span class="sourceLineNo">104</span>   * @return List of plans<a name="line.104"></a>
+<span class="sourceLineNo">105</span>   */<a name="line.105"></a>
+<span class="sourceLineNo">106</span>  List&lt;RegionPlan&gt; balanceCluster(Map&lt;ServerName,<a
name="line.106"></a>
+<span class="sourceLineNo">107</span>      List&lt;HRegionInfo&gt;&gt;
clusterState) throws HBaseIOException;<a name="line.107"></a>
+<span class="sourceLineNo">108</span><a name="line.108"></a>
+<span class="sourceLineNo">109</span>  /**<a name="line.109"></a>
+<span class="sourceLineNo">110</span>   * Perform a Round Robin assignment of
regions.<a name="line.110"></a>
+<span class="sourceLineNo">111</span>   * @param regions<a name="line.111"></a>
+<span class="sourceLineNo">112</span>   * @param servers<a name="line.112"></a>
+<span class="sourceLineNo">113</span>   * @return Map of servername to regioninfos<a
name="line.113"></a>
+<span class="sourceLineNo">114</span>   */<a name="line.114"></a>
+<span class="sourceLineNo">115</span>  Map&lt;ServerName, List&lt;HRegionInfo&gt;&gt;
roundRobinAssignment(<a name="line.115"></a>
+<span class="sourceLineNo">116</span>    List&lt;HRegionInfo&gt; regions,<a
name="line.116"></a>
+<span class="sourceLineNo">117</span>    List&lt;ServerName&gt; servers<a
name="line.117"></a>
+<span class="sourceLineNo">118</span>  ) throws HBaseIOException;<a name="line.118"></a>
+<span class="sourceLineNo">119</span><a name="line.119"></a>
+<span class="sourceLineNo">120</span>  /**<a name="line.120"></a>
+<span class="sourceLineNo">121</span>   * Assign regions to the previously hosting
region server<a name="line.121"></a>
+<span class="sourceLineNo">122</span>   * @param regions<a name="line.122"></a>
+<span class="sourceLineNo">123</span>   * @param servers<a name="line.123"></a>
+<span class="sourceLineNo">124</span>   * @return List of plans<a name="line.124"></a>
+<span class="sourceLineNo">125</span>   */<a name="line.125"></a>
+<span class="sourceLineNo">126</span>  @Nullable<a name="line.126"></a>
+<span class="sourceLineNo">127</span>  Map&lt;ServerName, List&lt;HRegionInfo&gt;&gt;
retainAssignment(<a name="line.127"></a>
+<span class="sourceLineNo">128</span>    Map&lt;HRegionInfo, ServerName&gt;
regions,<a name="line.128"></a>
+<span class="sourceLineNo">129</span>    List&lt;ServerName&gt; servers<a
name="line.129"></a>
+<span class="sourceLineNo">130</span>  ) throws HBaseIOException;<a name="line.130"></a>
 <span class="sourceLineNo">131</span><a name="line.131"></a>
 <span class="sourceLineNo">132</span>  /**<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   * Marks the region as online at balancer.<a
name="line.133"></a>
-<span class="sourceLineNo">134</span>   * @param regionInfo<a name="line.134"></a>
-<span class="sourceLineNo">135</span>   * @param sn<a name="line.135"></a>
-<span class="sourceLineNo">136</span>   */<a name="line.136"></a>
-<span class="sourceLineNo">137</span>  void regionOnline(HRegionInfo regionInfo,
ServerName sn);<a name="line.137"></a>
-<span class="sourceLineNo">138</span><a name="line.138"></a>
-<span class="sourceLineNo">139</span>  /**<a name="line.139"></a>
-<span class="sourceLineNo">140</span>   * Marks the region as offline at balancer.<a
name="line.140"></a>
-<span class="sourceLineNo">141</span>   * @param regionInfo<a name="line.141"></a>
-<span class="sourceLineNo">142</span>   */<a name="line.142"></a>
-<span class="sourceLineNo">143</span>  void regionOffline(HRegionInfo regionInfo);<a
name="line.143"></a>
-<span class="sourceLineNo">144</span><a name="line.144"></a>
-<span class="sourceLineNo">145</span>  /*<a name="line.145"></a>
-<span class="sourceLineNo">146</span>   * Notification that config has changed<a
name="line.146"></a>
-<span class="sourceLineNo">147</span>   * @param conf<a name="line.147"></a>
-<span class="sourceLineNo">148</span>   */<a name="line.148"></a>
-<span class="sourceLineNo">149</span>  void onConfigurationChange(Configuration
conf);<a name="line.149"></a>
-<span class="sourceLineNo">150</span>}<a name="line.150"></a>
+<span class="sourceLineNo">133</span>   * Get a random region server from the
list<a name="line.133"></a>
+<span class="sourceLineNo">134</span>   * @param regionInfo Region for which
this selection is being done.<a name="line.134"></a>
+<span class="sourceLineNo">135</span>   * @param servers<a name="line.135"></a>
+<span class="sourceLineNo">136</span>   * @return Servername<a name="line.136"></a>
+<span class="sourceLineNo">137</span>   */<a name="line.137"></a>
+<span class="sourceLineNo">138</span>  ServerName randomAssignment(<a name="line.138"></a>
+<span class="sourceLineNo">139</span>    HRegionInfo regionInfo, List&lt;ServerName&gt;
servers<a name="line.139"></a>
+<span class="sourceLineNo">140</span>  ) throws HBaseIOException;<a name="line.140"></a>
+<span class="sourceLineNo">141</span><a name="line.141"></a>
+<span class="sourceLineNo">142</span>  /**<a name="line.142"></a>
+<span class="sourceLineNo">143</span>   * Initialize the load balancer. Must
be called after setters.<a name="line.143"></a>
+<span class="sourceLineNo">144</span>   * @throws HBaseIOException<a name="line.144"></a>
+<span class="sourceLineNo">145</span>   */<a name="line.145"></a>
+<span class="sourceLineNo">146</span>  void initialize() throws HBaseIOException;<a
name="line.146"></a>
+<span class="sourceLineNo">147</span><a name="line.147"></a>
+<span class="sourceLineNo">148</span>  /**<a name="line.148"></a>
+<span class="sourceLineNo">149</span>   * Marks the region as online at balancer.<a
name="line.149"></a>
+<span class="sourceLineNo">150</span>   * @param regionInfo<a name="line.150"></a>
+<span class="sourceLineNo">151</span>   * @param sn<a name="line.151"></a>
+<span class="sourceLineNo">152</span>   */<a name="line.152"></a>
+<span class="sourceLineNo">153</span>  void regionOnline(HRegionInfo regionInfo,
ServerName sn);<a name="line.153"></a>
+<span class="sourceLineNo">154</span><a name="line.154"></a>
+<span class="sourceLineNo">155</span>  /**<a name="line.155"></a>
+<span class="sourceLineNo">156</span>   * Marks the region as offline at balancer.<a
name="line.156"></a>
+<span class="sourceLineNo">157</span>   * @param regionInfo<a name="line.157"></a>
+<span class="sourceLineNo">158</span>   */<a name="line.158"></a>
+<span class="sourceLineNo">159</span>  void regionOffline(HRegionInfo regionInfo);<a
name="line.159"></a>
+<span class="sourceLineNo">160</span><a name="line.160"></a>
+<span class="sourceLineNo">161</span>  /*<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   * Notification that config has changed<a
name="line.162"></a>
+<span class="sourceLineNo">163</span>   * @param conf<a name="line.163"></a>
+<span class="sourceLineNo">164</span>   */<a name="line.164"></a>
+<span class="sourceLineNo">165</span>  void onConfigurationChange(Configuration
conf);<a name="line.165"></a>
+<span class="sourceLineNo">166</span><a name="line.166"></a>
+<span class="sourceLineNo">167</span>  /**<a name="line.167"></a>
+<span class="sourceLineNo">168</span>   * @return true if Master carries regions<a
name="line.168"></a>
+<span class="sourceLineNo">169</span>   */<a name="line.169"></a>
+<span class="sourceLineNo">170</span>  static boolean isTablesOnMaster(Configuration
conf) {<a name="line.170"></a>
+<span class="sourceLineNo">171</span>    return conf.getBoolean(TABLES_ON_MASTER,
false);<a name="line.171"></a>
+<span class="sourceLineNo">172</span>  }<a name="line.172"></a>
+<span class="sourceLineNo">173</span><a name="line.173"></a>
+<span class="sourceLineNo">174</span>  static boolean isSystemTablesOnlyOnMaster(Configuration
conf) {<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    return conf.getBoolean(SYSTEM_TABLES_ON_MASTER,
false);<a name="line.175"></a>
+<span class="sourceLineNo">176</span>  }<a name="line.176"></a>
+<span class="sourceLineNo">177</span>}<a name="line.177"></a>
 
 
 


Mime
View raw message