http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/RegionLocationFinder.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/RegionLocationFinder.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/RegionLocationFinder.html index d654af2..3cec2fd 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/RegionLocationFinder.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/RegionLocationFinder.html @@ -29,312 +29,289 @@ <span class="sourceLineNo">021</span>import java.io.IOException;<a name="line.21"></a> <span class="sourceLineNo">022</span>import java.util.ArrayList;<a name="line.22"></a> <span class="sourceLineNo">023</span>import java.util.Collection;<a name="line.23"></a> -<span class="sourceLineNo">024</span>import java.util.HashMap;<a name="line.24"></a> -<span class="sourceLineNo">025</span>import java.util.List;<a name="line.25"></a> -<span class="sourceLineNo">026</span>import java.util.concurrent.Callable;<a name="line.26"></a> -<span class="sourceLineNo">027</span>import java.util.concurrent.ExecutionException;<a name="line.27"></a> -<span class="sourceLineNo">028</span>import java.util.concurrent.Executors;<a name="line.28"></a> -<span class="sourceLineNo">029</span>import java.util.concurrent.TimeUnit;<a name="line.29"></a> -<span class="sourceLineNo">030</span>import org.apache.hadoop.conf.Configuration;<a name="line.30"></a> -<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.ClusterMetrics;<a name="line.31"></a> -<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.HDFSBlocksDistribution;<a name="line.32"></a> -<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.ServerName;<a name="line.33"></a> -<span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.TableName;<a name="line.34"></a> -<span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.client.RegionInfo;<a name="line.35"></a> -<span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.client.TableDescriptor;<a name="line.36"></a> -<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.master.MasterServices;<a name="line.37"></a> -<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.master.assignment.AssignmentManager;<a name="line.38"></a> -<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.regionserver.HRegion;<a name="line.39"></a> -<span class="sourceLineNo">040</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.40"></a> -<span class="sourceLineNo">041</span>import org.apache.yetus.audience.InterfaceAudience;<a name="line.41"></a> -<span class="sourceLineNo">042</span>import org.slf4j.Logger;<a name="line.42"></a> -<span class="sourceLineNo">043</span>import org.slf4j.LoggerFactory;<a name="line.43"></a> -<span class="sourceLineNo">044</span>import org.apache.hbase.thirdparty.com.google.common.cache.CacheBuilder;<a name="line.44"></a> -<span class="sourceLineNo">045</span>import org.apache.hbase.thirdparty.com.google.common.cache.CacheLoader;<a name="line.45"></a> -<span class="sourceLineNo">046</span>import org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache;<a name="line.46"></a> -<span class="sourceLineNo">047</span>import org.apache.hbase.thirdparty.com.google.common.collect.Lists;<a name="line.47"></a> -<span class="sourceLineNo">048</span>import org.apache.hbase.thirdparty.com.google.common.util.concurrent.Futures;<a name="line.48"></a> -<span class="sourceLineNo">049</span>import org.apache.hbase.thirdparty.com.google.common.util.concurrent.ListenableFuture;<a name="line.49"></a> -<span class="sourceLineNo">050</span>import org.apache.hbase.thirdparty.com.google.common.util.concurrent.ListeningExecutorService;<a name="line.50"></a> -<span class="sourceLineNo">051</span>import org.apache.hbase.thirdparty.com.google.common.util.concurrent.MoreExecutors;<a name="line.51"></a> -<span class="sourceLineNo">052</span>import org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;<a name="line.52"></a> -<span class="sourceLineNo">053</span><a name="line.53"></a> -<span class="sourceLineNo">054</span>/**<a name="line.54"></a> -<span class="sourceLineNo">055</span> * This will find where data for a region is located in HDFS. It ranks<a name="line.55"></a> -<span class="sourceLineNo">056</span> * {@link ServerName}'s by the size of the store files they are holding for a<a name="line.56"></a> -<span class="sourceLineNo">057</span> * given region.<a name="line.57"></a> -<span class="sourceLineNo">058</span> *<a name="line.58"></a> -<span class="sourceLineNo">059</span> */<a name="line.59"></a> -<span class="sourceLineNo">060</span>@InterfaceAudience.Private<a name="line.60"></a> -<span class="sourceLineNo">061</span>class RegionLocationFinder {<a name="line.61"></a> -<span class="sourceLineNo">062</span> private static final Logger LOG = LoggerFactory.getLogger(RegionLocationFinder.class);<a name="line.62"></a> -<span class="sourceLineNo">063</span> private static final long CACHE_TIME = 240 * 60 * 1000;<a name="line.63"></a> -<span class="sourceLineNo">064</span> private static final HDFSBlocksDistribution EMPTY_BLOCK_DISTRIBUTION = new HDFSBlocksDistribution();<a name="line.64"></a> -<span class="sourceLineNo">065</span> private Configuration conf;<a name="line.65"></a> -<span class="sourceLineNo">066</span> private volatile ClusterMetrics status;<a name="line.66"></a> -<span class="sourceLineNo">067</span> private MasterServices services;<a name="line.67"></a> -<span class="sourceLineNo">068</span> private final ListeningExecutorService executor;<a name="line.68"></a> -<span class="sourceLineNo">069</span> // Do not scheduleFullRefresh at master startup<a name="line.69"></a> -<span class="sourceLineNo">070</span> private long lastFullRefresh = EnvironmentEdgeManager.currentTime();<a name="line.70"></a> -<span class="sourceLineNo">071</span><a name="line.71"></a> -<span class="sourceLineNo">072</span> private CacheLoader<RegionInfo, HDFSBlocksDistribution> loader =<a name="line.72"></a> -<span class="sourceLineNo">073</span> new CacheLoader<RegionInfo, HDFSBlocksDistribution>() {<a name="line.73"></a> -<span class="sourceLineNo">074</span><a name="line.74"></a> -<span class="sourceLineNo">075</span> @Override<a name="line.75"></a> -<span class="sourceLineNo">076</span> public ListenableFuture<HDFSBlocksDistribution> reload(final RegionInfo hri,<a name="line.76"></a> -<span class="sourceLineNo">077</span> HDFSBlocksDistribution oldValue) throws Exception {<a name="line.77"></a> -<span class="sourceLineNo">078</span> return executor.submit(new Callable<HDFSBlocksDistribution>() {<a name="line.78"></a> -<span class="sourceLineNo">079</span> @Override<a name="line.79"></a> -<span class="sourceLineNo">080</span> public HDFSBlocksDistribution call() throws Exception {<a name="line.80"></a> -<span class="sourceLineNo">081</span> return internalGetTopBlockLocation(hri);<a name="line.81"></a> -<span class="sourceLineNo">082</span> }<a name="line.82"></a> -<span class="sourceLineNo">083</span> });<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> @Override<a name="line.86"></a> -<span class="sourceLineNo">087</span> public HDFSBlocksDistribution load(RegionInfo key) throws Exception {<a name="line.87"></a> -<span class="sourceLineNo">088</span> return internalGetTopBlockLocation(key);<a name="line.88"></a> -<span class="sourceLineNo">089</span> }<a name="line.89"></a> -<span class="sourceLineNo">090</span> };<a name="line.90"></a> +<span class="sourceLineNo">024</span>import java.util.Collections;<a name="line.24"></a> +<span class="sourceLineNo">025</span>import java.util.HashMap;<a name="line.25"></a> +<span class="sourceLineNo">026</span>import java.util.List;<a name="line.26"></a> +<span class="sourceLineNo">027</span>import java.util.Map;<a name="line.27"></a> +<span class="sourceLineNo">028</span>import java.util.concurrent.Callable;<a name="line.28"></a> +<span class="sourceLineNo">029</span>import java.util.concurrent.ExecutionException;<a name="line.29"></a> +<span class="sourceLineNo">030</span>import java.util.concurrent.Executors;<a name="line.30"></a> +<span class="sourceLineNo">031</span>import java.util.concurrent.TimeUnit;<a name="line.31"></a> +<span class="sourceLineNo">032</span><a name="line.32"></a> +<span class="sourceLineNo">033</span>import org.apache.commons.collections4.CollectionUtils;<a name="line.33"></a> +<span class="sourceLineNo">034</span>import org.apache.commons.collections4.MultiValuedMap;<a name="line.34"></a> +<span class="sourceLineNo">035</span>import org.apache.commons.collections4.multimap.ArrayListValuedHashMap;<a name="line.35"></a> +<span class="sourceLineNo">036</span>import org.apache.hadoop.conf.Configuration;<a name="line.36"></a> +<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.ClusterMetrics;<a name="line.37"></a> +<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.HDFSBlocksDistribution;<a name="line.38"></a> +<span class="sourceLineNo">039</span>import org.apache.hadoop.hbase.ServerName;<a name="line.39"></a> +<span class="sourceLineNo">040</span>import org.apache.hadoop.hbase.TableName;<a name="line.40"></a> +<span class="sourceLineNo">041</span>import org.apache.hadoop.hbase.client.RegionInfo;<a name="line.41"></a> +<span class="sourceLineNo">042</span>import org.apache.hadoop.hbase.client.TableDescriptor;<a name="line.42"></a> +<span class="sourceLineNo">043</span>import org.apache.hadoop.hbase.master.MasterServices;<a name="line.43"></a> +<span class="sourceLineNo">044</span>import org.apache.hadoop.hbase.master.assignment.AssignmentManager;<a name="line.44"></a> +<span class="sourceLineNo">045</span>import org.apache.hadoop.hbase.regionserver.HRegion;<a name="line.45"></a> +<span class="sourceLineNo">046</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.46"></a> +<span class="sourceLineNo">047</span>import org.apache.yetus.audience.InterfaceAudience;<a name="line.47"></a> +<span class="sourceLineNo">048</span>import org.slf4j.Logger;<a name="line.48"></a> +<span class="sourceLineNo">049</span>import org.slf4j.LoggerFactory;<a name="line.49"></a> +<span class="sourceLineNo">050</span><a name="line.50"></a> +<span class="sourceLineNo">051</span>import org.apache.hbase.thirdparty.com.google.common.cache.CacheBuilder;<a name="line.51"></a> +<span class="sourceLineNo">052</span>import org.apache.hbase.thirdparty.com.google.common.cache.CacheLoader;<a name="line.52"></a> +<span class="sourceLineNo">053</span>import org.apache.hbase.thirdparty.com.google.common.cache.LoadingCache;<a name="line.53"></a> +<span class="sourceLineNo">054</span>import org.apache.hbase.thirdparty.com.google.common.util.concurrent.Futures;<a name="line.54"></a> +<span class="sourceLineNo">055</span>import org.apache.hbase.thirdparty.com.google.common.util.concurrent.ListenableFuture;<a name="line.55"></a> +<span class="sourceLineNo">056</span>import org.apache.hbase.thirdparty.com.google.common.util.concurrent.ListeningExecutorService;<a name="line.56"></a> +<span class="sourceLineNo">057</span>import org.apache.hbase.thirdparty.com.google.common.util.concurrent.MoreExecutors;<a name="line.57"></a> +<span class="sourceLineNo">058</span>import org.apache.hbase.thirdparty.com.google.common.util.concurrent.ThreadFactoryBuilder;<a name="line.58"></a> +<span class="sourceLineNo">059</span><a name="line.59"></a> +<span class="sourceLineNo">060</span>/**<a name="line.60"></a> +<span class="sourceLineNo">061</span> * This will find where data for a region is located in HDFS. It ranks<a name="line.61"></a> +<span class="sourceLineNo">062</span> * {@link ServerName}'s by the size of the store files they are holding for a<a name="line.62"></a> +<span class="sourceLineNo">063</span> * given region.<a name="line.63"></a> +<span class="sourceLineNo">064</span> *<a name="line.64"></a> +<span class="sourceLineNo">065</span> */<a name="line.65"></a> +<span class="sourceLineNo">066</span>@InterfaceAudience.Private<a name="line.66"></a> +<span class="sourceLineNo">067</span>class RegionLocationFinder {<a name="line.67"></a> +<span class="sourceLineNo">068</span> private static final Logger LOG = LoggerFactory.getLogger(RegionLocationFinder.class);<a name="line.68"></a> +<span class="sourceLineNo">069</span> private static final long CACHE_TIME = 240 * 60 * 1000;<a name="line.69"></a> +<span class="sourceLineNo">070</span> private static final HDFSBlocksDistribution EMPTY_BLOCK_DISTRIBUTION = new HDFSBlocksDistribution();<a name="line.70"></a> +<span class="sourceLineNo">071</span> private Configuration conf;<a name="line.71"></a> +<span class="sourceLineNo">072</span> private volatile ClusterMetrics status;<a name="line.72"></a> +<span class="sourceLineNo">073</span> private MasterServices services;<a name="line.73"></a> +<span class="sourceLineNo">074</span> private final ListeningExecutorService executor;<a name="line.74"></a> +<span class="sourceLineNo">075</span> // Do not scheduleFullRefresh at master startup<a name="line.75"></a> +<span class="sourceLineNo">076</span> private long lastFullRefresh = EnvironmentEdgeManager.currentTime();<a name="line.76"></a> +<span class="sourceLineNo">077</span><a name="line.77"></a> +<span class="sourceLineNo">078</span> private CacheLoader<RegionInfo, HDFSBlocksDistribution> loader =<a name="line.78"></a> +<span class="sourceLineNo">079</span> new CacheLoader<RegionInfo, HDFSBlocksDistribution>() {<a name="line.79"></a> +<span class="sourceLineNo">080</span><a name="line.80"></a> +<span class="sourceLineNo">081</span> @Override<a name="line.81"></a> +<span class="sourceLineNo">082</span> public ListenableFuture<HDFSBlocksDistribution> reload(final RegionInfo hri,<a name="line.82"></a> +<span class="sourceLineNo">083</span> HDFSBlocksDistribution oldValue) throws Exception {<a name="line.83"></a> +<span class="sourceLineNo">084</span> return executor.submit(new Callable<HDFSBlocksDistribution>() {<a name="line.84"></a> +<span class="sourceLineNo">085</span> @Override<a name="line.85"></a> +<span class="sourceLineNo">086</span> public HDFSBlocksDistribution call() throws Exception {<a name="line.86"></a> +<span class="sourceLineNo">087</span> return internalGetTopBlockLocation(hri);<a name="line.87"></a> +<span class="sourceLineNo">088</span> }<a name="line.88"></a> +<span class="sourceLineNo">089</span> });<a name="line.89"></a> +<span class="sourceLineNo">090</span> }<a name="line.90"></a> <span class="sourceLineNo">091</span><a name="line.91"></a> -<span class="sourceLineNo">092</span> // The cache for where regions are located.<a name="line.92"></a> -<span class="sourceLineNo">093</span> private LoadingCache<RegionInfo, HDFSBlocksDistribution> cache = null;<a name="line.93"></a> -<span class="sourceLineNo">094</span><a name="line.94"></a> -<span class="sourceLineNo">095</span> RegionLocationFinder() {<a name="line.95"></a> -<span class="sourceLineNo">096</span> this.cache = createCache();<a name="line.96"></a> -<span class="sourceLineNo">097</span> executor = MoreExecutors.listeningDecorator(<a name="line.97"></a> -<span class="sourceLineNo">098</span> Executors.newScheduledThreadPool(<a name="line.98"></a> -<span class="sourceLineNo">099</span> 5,<a name="line.99"></a> -<span class="sourceLineNo">100</span> new ThreadFactoryBuilder().<a name="line.100"></a> -<span class="sourceLineNo">101</span> setDaemon(true)<a name="line.101"></a> -<span class="sourceLineNo">102</span> .setNameFormat("region-location-%d")<a name="line.102"></a> -<span class="sourceLineNo">103</span> .build()));<a name="line.103"></a> -<span class="sourceLineNo">104</span> }<a name="line.104"></a> -<span class="sourceLineNo">105</span><a name="line.105"></a> -<span class="sourceLineNo">106</span> /**<a name="line.106"></a> -<span class="sourceLineNo">107</span> * Create a cache for region to list of servers<a name="line.107"></a> -<span class="sourceLineNo">108</span> * @return A new Cache.<a name="line.108"></a> -<span class="sourceLineNo">109</span> */<a name="line.109"></a> -<span class="sourceLineNo">110</span> private LoadingCache<RegionInfo, HDFSBlocksDistribution> createCache() {<a name="line.110"></a> -<span class="sourceLineNo">111</span> return CacheBuilder.newBuilder()<a name="line.111"></a> -<span class="sourceLineNo">112</span> .expireAfterWrite(CACHE_TIME, TimeUnit.MILLISECONDS)<a name="line.112"></a> -<span class="sourceLineNo">113</span> .build(loader);<a name="line.113"></a> -<span class="sourceLineNo">114</span> }<a name="line.114"></a> -<span class="sourceLineNo">115</span><a name="line.115"></a> -<span class="sourceLineNo">116</span> public Configuration getConf() {<a name="line.116"></a> -<span class="sourceLineNo">117</span> return conf;<a name="line.117"></a> -<span class="sourceLineNo">118</span> }<a name="line.118"></a> -<span class="sourceLineNo">119</span><a name="line.119"></a> -<span class="sourceLineNo">120</span> public void setConf(Configuration conf) {<a name="line.120"></a> -<span class="sourceLineNo">121</span> this.conf = conf;<a name="line.121"></a> -<span class="sourceLineNo">122</span> }<a name="line.122"></a> -<span class="sourceLineNo">123</span><a name="line.123"></a> -<span class="sourceLineNo">124</span> public void setServices(MasterServices services) {<a name="line.124"></a> -<span class="sourceLineNo">125</span> this.services = services;<a name="line.125"></a> -<span class="sourceLineNo">126</span> }<a name="line.126"></a> -<span class="sourceLineNo">127</span><a name="line.127"></a> -<span class="sourceLineNo">128</span> public void setClusterMetrics(ClusterMetrics status) {<a name="line.128"></a> -<span class="sourceLineNo">129</span> long currentTime = EnvironmentEdgeManager.currentTime();<a name="line.129"></a> -<span class="sourceLineNo">130</span> this.status = status;<a name="line.130"></a> -<span class="sourceLineNo">131</span> if (currentTime > lastFullRefresh + (CACHE_TIME / 2)) {<a name="line.131"></a> -<span class="sourceLineNo">132</span> // Only count the refresh if it includes user tables ( eg more than meta and namespace ).<a name="line.132"></a> -<span class="sourceLineNo">133</span> lastFullRefresh = scheduleFullRefresh()?currentTime:lastFullRefresh;<a name="line.133"></a> -<span class="sourceLineNo">134</span> }<a name="line.134"></a> -<span class="sourceLineNo">135</span><a name="line.135"></a> -<span class="sourceLineNo">136</span> }<a name="line.136"></a> -<span class="sourceLineNo">137</span><a name="line.137"></a> -<span class="sourceLineNo">138</span> /**<a name="line.138"></a> -<span class="sourceLineNo">139</span> * Refresh all the region locations.<a name="line.139"></a> -<span class="sourceLineNo">140</span> *<a name="line.140"></a> -<span class="sourceLineNo">141</span> * @return true if user created regions got refreshed.<a name="line.141"></a> -<span class="sourceLineNo">142</span> */<a name="line.142"></a> -<span class="sourceLineNo">143</span> private boolean scheduleFullRefresh() {<a name="line.143"></a> -<span class="sourceLineNo">144</span> // Protect from anything being null while starting up.<a name="line.144"></a> -<span class="sourceLineNo">145</span> if (services == null) {<a name="line.145"></a> -<span class="sourceLineNo">146</span> return false;<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> final AssignmentManager am = services.getAssignmentManager();<a name="line.149"></a> -<span class="sourceLineNo">150</span> if (am == null) {<a name="line.150"></a> +<span class="sourceLineNo">092</span> @Override<a name="line.92"></a> +<span class="sourceLineNo">093</span> public HDFSBlocksDistribution load(RegionInfo key) throws Exception {<a name="line.93"></a> +<span class="sourceLineNo">094</span> return internalGetTopBlockLocation(key);<a name="line.94"></a> +<span class="sourceLineNo">095</span> }<a name="line.95"></a> +<span class="sourceLineNo">096</span> };<a name="line.96"></a> +<span class="sourceLineNo">097</span><a name="line.97"></a> +<span class="sourceLineNo">098</span> // The cache for where regions are located.<a name="line.98"></a> +<span class="sourceLineNo">099</span> private LoadingCache<RegionInfo, HDFSBlocksDistribution> cache = null;<a name="line.99"></a> +<span class="sourceLineNo">100</span><a name="line.100"></a> +<span class="sourceLineNo">101</span> RegionLocationFinder() {<a name="line.101"></a> +<span class="sourceLineNo">102</span> this.cache = createCache();<a name="line.102"></a> +<span class="sourceLineNo">103</span> executor = MoreExecutors.listeningDecorator(<a name="line.103"></a> +<span class="sourceLineNo">104</span> Executors.newScheduledThreadPool(<a name="line.104"></a> +<span class="sourceLineNo">105</span> 5,<a name="line.105"></a> +<span class="sourceLineNo">106</span> new ThreadFactoryBuilder().<a name="line.106"></a> +<span class="sourceLineNo">107</span> setDaemon(true)<a name="line.107"></a> +<span class="sourceLineNo">108</span> .setNameFormat("region-location-%d")<a name="line.108"></a> +<span class="sourceLineNo">109</span> .build()));<a name="line.109"></a> +<span class="sourceLineNo">110</span> }<a name="line.110"></a> +<span class="sourceLineNo">111</span><a name="line.111"></a> +<span class="sourceLineNo">112</span> /**<a name="line.112"></a> +<span class="sourceLineNo">113</span> * Create a cache for region to list of servers<a name="line.113"></a> +<span class="sourceLineNo">114</span> * @return A new Cache.<a name="line.114"></a> +<span class="sourceLineNo">115</span> */<a name="line.115"></a> +<span class="sourceLineNo">116</span> private LoadingCache<RegionInfo, HDFSBlocksDistribution> createCache() {<a name="line.116"></a> +<span class="sourceLineNo">117</span> return CacheBuilder.newBuilder()<a name="line.117"></a> +<span class="sourceLineNo">118</span> .expireAfterWrite(CACHE_TIME, TimeUnit.MILLISECONDS)<a name="line.118"></a> +<span class="sourceLineNo">119</span> .build(loader);<a name="line.119"></a> +<span class="sourceLineNo">120</span> }<a name="line.120"></a> +<span class="sourceLineNo">121</span><a name="line.121"></a> +<span class="sourceLineNo">122</span> public Configuration getConf() {<a name="line.122"></a> +<span class="sourceLineNo">123</span> return conf;<a name="line.123"></a> +<span class="sourceLineNo">124</span> }<a name="line.124"></a> +<span class="sourceLineNo">125</span><a name="line.125"></a> +<span class="sourceLineNo">126</span> public void setConf(Configuration conf) {<a name="line.126"></a> +<span class="sourceLineNo">127</span> this.conf = conf;<a name="line.127"></a> +<span class="sourceLineNo">128</span> }<a name="line.128"></a> +<span class="sourceLineNo">129</span><a name="line.129"></a> +<span class="sourceLineNo">130</span> public void setServices(MasterServices services) {<a name="line.130"></a> +<span class="sourceLineNo">131</span> this.services = services;<a name="line.131"></a> +<span class="sourceLineNo">132</span> }<a name="line.132"></a> +<span class="sourceLineNo">133</span><a name="line.133"></a> +<span class="sourceLineNo">134</span> public void setClusterMetrics(ClusterMetrics status) {<a name="line.134"></a> +<span class="sourceLineNo">135</span> long currentTime = EnvironmentEdgeManager.currentTime();<a name="line.135"></a> +<span class="sourceLineNo">136</span> this.status = status;<a name="line.136"></a> +<span class="sourceLineNo">137</span> if (currentTime > lastFullRefresh + (CACHE_TIME / 2)) {<a name="line.137"></a> +<span class="sourceLineNo">138</span> // Only count the refresh if it includes user tables ( eg more than meta and namespace ).<a name="line.138"></a> +<span class="sourceLineNo">139</span> lastFullRefresh = scheduleFullRefresh()?currentTime:lastFullRefresh;<a name="line.139"></a> +<span class="sourceLineNo">140</span> }<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> /**<a name="line.143"></a> +<span class="sourceLineNo">144</span> * Refresh all the region locations.<a name="line.144"></a> +<span class="sourceLineNo">145</span> *<a name="line.145"></a> +<span class="sourceLineNo">146</span> * @return true if user created regions got refreshed.<a name="line.146"></a> +<span class="sourceLineNo">147</span> */<a name="line.147"></a> +<span class="sourceLineNo">148</span> private boolean scheduleFullRefresh() {<a name="line.148"></a> +<span class="sourceLineNo">149</span> // Protect from anything being null while starting up.<a name="line.149"></a> +<span class="sourceLineNo">150</span> if (services == null) {<a name="line.150"></a> <span class="sourceLineNo">151</span> return false;<a name="line.151"></a> <span class="sourceLineNo">152</span> }<a name="line.152"></a> <span class="sourceLineNo">153</span><a name="line.153"></a> -<span class="sourceLineNo">154</span> // TODO: Should this refresh all the regions or only the ones assigned?<a name="line.154"></a> -<span class="sourceLineNo">155</span> boolean includesUserTables = false;<a name="line.155"></a> -<span class="sourceLineNo">156</span> for (final RegionInfo hri : am.getAssignedRegions()) {<a name="line.156"></a> -<span class="sourceLineNo">157</span> cache.refresh(hri);<a name="line.157"></a> -<span class="sourceLineNo">158</span> includesUserTables = includesUserTables || !hri.getTable().isSystemTable();<a name="line.158"></a> -<span class="sourceLineNo">159</span> }<a name="line.159"></a> -<span class="sourceLineNo">160</span> return includesUserTables;<a name="line.160"></a> -<span class="sourceLineNo">161</span> }<a name="line.161"></a> -<span class="sourceLineNo">162</span><a name="line.162"></a> -<span class="sourceLineNo">163</span> protected List<ServerName> getTopBlockLocations(RegionInfo region) {<a name="line.163"></a> -<span class="sourceLineNo">164</span> List<String> topHosts = getBlockDistribution(region).getTopHosts();<a name="line.164"></a> -<span class="sourceLineNo">165</span> return mapHostNameToServerName(topHosts);<a name="line.165"></a> +<span class="sourceLineNo">154</span> final AssignmentManager am = services.getAssignmentManager();<a name="line.154"></a> +<span class="sourceLineNo">155</span> if (am == null) {<a name="line.155"></a> +<span class="sourceLineNo">156</span> return false;<a name="line.156"></a> +<span class="sourceLineNo">157</span> }<a name="line.157"></a> +<span class="sourceLineNo">158</span><a name="line.158"></a> +<span class="sourceLineNo">159</span> // TODO: Should this refresh all the regions or only the ones assigned?<a name="line.159"></a> +<span class="sourceLineNo">160</span> boolean includesUserTables = false;<a name="line.160"></a> +<span class="sourceLineNo">161</span> for (final RegionInfo hri : am.getAssignedRegions()) {<a name="line.161"></a> +<span class="sourceLineNo">162</span> cache.refresh(hri);<a name="line.162"></a> +<span class="sourceLineNo">163</span> includesUserTables = includesUserTables || !hri.getTable().isSystemTable();<a name="line.163"></a> +<span class="sourceLineNo">164</span> }<a name="line.164"></a> +<span class="sourceLineNo">165</span> return includesUserTables;<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> /**<a name="line.168"></a> -<span class="sourceLineNo">169</span> * Returns an ordered list of hosts which have better locality for this region<a name="line.169"></a> -<span class="sourceLineNo">170</span> * than the current host.<a name="line.170"></a> -<span class="sourceLineNo">171</span> */<a name="line.171"></a> -<span class="sourceLineNo">172</span> protected List<ServerName> getTopBlockLocations(RegionInfo region, String currentHost) {<a name="line.172"></a> -<span class="sourceLineNo">173</span> HDFSBlocksDistribution blocksDistribution = getBlockDistribution(region);<a name="line.173"></a> -<span class="sourceLineNo">174</span> List<String> topHosts = new ArrayList<>();<a name="line.174"></a> -<span class="sourceLineNo">175</span> for (String host : blocksDistribution.getTopHosts()) {<a name="line.175"></a> -<span class="sourceLineNo">176</span> if (host.equals(currentHost)) {<a name="line.176"></a> -<span class="sourceLineNo">177</span> break;<a name="line.177"></a> -<span class="sourceLineNo">178</span> }<a name="line.178"></a> -<span class="sourceLineNo">179</span> topHosts.add(host);<a name="line.179"></a> -<span class="sourceLineNo">180</span> }<a name="line.180"></a> -<span class="sourceLineNo">181</span> return mapHostNameToServerName(topHosts);<a name="line.181"></a> -<span class="sourceLineNo">182</span> }<a name="line.182"></a> -<span class="sourceLineNo">183</span><a name="line.183"></a> -<span class="sourceLineNo">184</span> /**<a name="line.184"></a> -<span class="sourceLineNo">185</span> * Returns an ordered list of hosts that are hosting the blocks for this<a name="line.185"></a> -<span class="sourceLineNo">186</span> * region. The weight of each host is the sum of the block lengths of all<a name="line.186"></a> -<span class="sourceLineNo">187</span> * files on that host, so the first host in the list is the server which holds<a name="line.187"></a> -<span class="sourceLineNo">188</span> * the most bytes of the given region's HFiles.<a name="line.188"></a> -<span class="sourceLineNo">189</span> *<a name="line.189"></a> -<span class="sourceLineNo">190</span> * @param region region<a name="line.190"></a> -<span class="sourceLineNo">191</span> * @return ordered list of hosts holding blocks of the specified region<a name="line.191"></a> -<span class="sourceLineNo">192</span> */<a name="line.192"></a> -<span class="sourceLineNo">193</span> protected HDFSBlocksDistribution internalGetTopBlockLocation(RegionInfo region) {<a name="line.193"></a> -<span class="sourceLineNo">194</span> try {<a name="line.194"></a> -<span class="sourceLineNo">195</span> TableDescriptor tableDescriptor = getTableDescriptor(region.getTable());<a name="line.195"></a> -<span class="sourceLineNo">196</span> if (tableDescriptor != null) {<a name="line.196"></a> -<span class="sourceLineNo">197</span> HDFSBlocksDistribution blocksDistribution =<a name="line.197"></a> -<span class="sourceLineNo">198</span> HRegion.computeHDFSBlocksDistribution(getConf(), tableDescriptor, region);<a name="line.198"></a> -<span class="sourceLineNo">199</span> return blocksDistribution;<a name="line.199"></a> -<span class="sourceLineNo">200</span> }<a name="line.200"></a> -<span class="sourceLineNo">201</span> } catch (IOException ioe) {<a name="line.201"></a> -<span class="sourceLineNo">202</span> LOG.warn("IOException during HDFSBlocksDistribution computation. for " + "region = "<a name="line.202"></a> -<span class="sourceLineNo">203</span> + region.getEncodedName(), ioe);<a name="line.203"></a> -<span class="sourceLineNo">204</span> }<a name="line.204"></a> -<span class="sourceLineNo">205</span><a name="line.205"></a> -<span class="sourceLineNo">206</span> return EMPTY_BLOCK_DISTRIBUTION;<a name="line.206"></a> -<span class="sourceLineNo">207</span> }<a name="line.207"></a> -<span class="sourceLineNo">208</span><a name="line.208"></a> -<span class="sourceLineNo">209</span> /**<a name="line.209"></a> -<span class="sourceLineNo">210</span> * return TableDescriptor for a given tableName<a name="line.210"></a> -<span class="sourceLineNo">211</span> *<a name="line.211"></a> -<span class="sourceLineNo">212</span> * @param tableName the table name<a name="line.212"></a> -<span class="sourceLineNo">213</span> * @return TableDescriptor<a name="line.213"></a> -<span class="sourceLineNo">214</span> * @throws IOException<a name="line.214"></a> -<span class="sourceLineNo">215</span> */<a name="line.215"></a> -<span class="sourceLineNo">216</span> protected TableDescriptor getTableDescriptor(TableName tableName) throws IOException {<a name="line.216"></a> -<span class="sourceLineNo">217</span> TableDescriptor tableDescriptor = null;<a name="line.217"></a> -<span class="sourceLineNo">218</span> try {<a name="line.218"></a> -<span class="sourceLineNo">219</span> if (this.services != null && this.services.getTableDescriptors() != null) {<a name="line.219"></a> -<span class="sourceLineNo">220</span> tableDescriptor = this.services.getTableDescriptors().get(tableName);<a name="line.220"></a> -<span class="sourceLineNo">221</span> }<a name="line.221"></a> -<span class="sourceLineNo">222</span> } catch (FileNotFoundException fnfe) {<a name="line.222"></a> -<span class="sourceLineNo">223</span> LOG.debug("FileNotFoundException during getTableDescriptors." + " Current table name = "<a name="line.223"></a> -<span class="sourceLineNo">224</span> + tableName, fnfe);<a name="line.224"></a> -<span class="sourceLineNo">225</span> }<a name="line.225"></a> -<span class="sourceLineNo">226</span><a name="line.226"></a> -<span class="sourceLineNo">227</span> return tableDescriptor;<a name="line.227"></a> -<span class="sourceLineNo">228</span> }<a name="line.228"></a> -<span class="sourceLineNo">229</span><a name="line.229"></a> -<span class="sourceLineNo">230</span> /**<a name="line.230"></a> -<span class="sourceLineNo">231</span> * Map hostname to ServerName, The output ServerName list will have the same<a name="line.231"></a> -<span class="sourceLineNo">232</span> * order as input hosts.<a name="line.232"></a> -<span class="sourceLineNo">233</span> *<a name="line.233"></a> -<span class="sourceLineNo">234</span> * @param hosts the list of hosts<a name="line.234"></a> -<span class="sourceLineNo">235</span> * @return ServerName list<a name="line.235"></a> -<span class="sourceLineNo">236</span> */<a name="line.236"></a> -<span class="sourceLineNo">237</span> protected List<ServerName> mapHostNameToServerName(List<String> hosts) {<a name="line.237"></a> -<span class="sourceLineNo">238</span> if (hosts == null || status == null) {<a name="line.238"></a> -<span class="sourceLineNo">239</span> if (hosts == null) {<a name="line.239"></a> -<span class="sourceLineNo">240</span> LOG.warn("RegionLocationFinder top hosts is null");<a name="line.240"></a> -<span class="sourceLineNo">241</span> }<a name="line.241"></a> -<span class="sourceLineNo">242</span> return Lists.newArrayList();<a name="line.242"></a> -<span class="sourceLineNo">243</span> }<a name="line.243"></a> -<span class="sourceLineNo">244</span><a name="line.244"></a> -<span class="sourceLineNo">245</span> List<ServerName> topServerNames = new ArrayList<>();<a name="line.245"></a> -<span class="sourceLineNo">246</span> Collection<ServerName> regionServers = status.getLiveServerMetrics().keySet();<a name="line.246"></a> -<span class="sourceLineNo">247</span><a name="line.247"></a> -<span class="sourceLineNo">248</span> // create a mapping from hostname to ServerName for fast lookup<a name="line.248"></a> -<span class="sourceLineNo">249</span> HashMap<String, List<ServerName>> hostToServerName = new HashMap<>();<a name="line.249"></a> -<span class="sourceLineNo">250</span> for (ServerName sn : regionServers) {<a name="line.250"></a> -<span class="sourceLineNo">251</span> String host = sn.getHostname();<a name="line.251"></a> -<span class="sourceLineNo">252</span> if (!hostToServerName.containsKey(host)) {<a name="line.252"></a> -<span class="sourceLineNo">253</span> hostToServerName.put(host, new ArrayList<>());<a name="line.253"></a> -<span class="sourceLineNo">254</span> }<a name="line.254"></a> -<span class="sourceLineNo">255</span> hostToServerName.get(host).add(sn);<a name="line.255"></a> -<span class="sourceLineNo">256</span> }<a name="line.256"></a> -<span class="sourceLineNo">257</span><a name="line.257"></a> -<span class="sourceLineNo">258</span> for (String host : hosts) {<a name="line.258"></a> -<span class="sourceLineNo">259</span> if (!hostToServerName.containsKey(host)) {<a name="line.259"></a> -<span class="sourceLineNo">260</span> continue;<a name="line.260"></a> -<span class="sourceLineNo">261</span> }<a name="line.261"></a> -<span class="sourceLineNo">262</span> for (ServerName sn : hostToServerName.get(host)) {<a name="line.262"></a> -<span class="sourceLineNo">263</span> // it is possible that HDFS is up ( thus host is valid ),<a name="line.263"></a> -<span class="sourceLineNo">264</span> // but RS is down ( thus sn is null )<a name="line.264"></a> -<span class="sourceLineNo">265</span> if (sn != null) {<a name="line.265"></a> -<span class="sourceLineNo">266</span> topServerNames.add(sn);<a name="line.266"></a> -<span class="sourceLineNo">267</span> }<a name="line.267"></a> -<span class="sourceLineNo">268</span> }<a name="line.268"></a> -<span class="sourceLineNo">269</span> }<a name="line.269"></a> -<span class="sourceLineNo">270</span> return topServerNames;<a name="line.270"></a> -<span class="sourceLineNo">271</span> }<a name="line.271"></a> -<span class="sourceLineNo">272</span><a name="line.272"></a> -<span class="sourceLineNo">273</span> public HDFSBlocksDistribution getBlockDistribution(RegionInfo hri) {<a name="line.273"></a> -<span class="sourceLineNo">274</span> HDFSBlocksDistribution blockDistbn = null;<a name="line.274"></a> -<span class="sourceLineNo">275</span> try {<a name="line.275"></a> -<span class="sourceLineNo">276</span> if (cache.asMap().containsKey(hri)) {<a name="line.276"></a> -<span class="sourceLineNo">277</span> blockDistbn = cache.get(hri);<a name="line.277"></a> -<span class="sourceLineNo">278</span> return blockDistbn;<a name="line.278"></a> -<span class="sourceLineNo">279</span> } else {<a name="line.279"></a> -<span class="sourceLineNo">280</span> LOG.debug("HDFSBlocksDistribution not found in cache for region "<a name="line.280"></a> -<span class="sourceLineNo">281</span> + hri.getRegionNameAsString());<a name="line.281"></a> -<span class="sourceLineNo">282</span> blockDistbn = internalGetTopBlockLocation(hri);<a name="line.282"></a> -<span class="sourceLineNo">283</span> cache.put(hri, blockDistbn);<a name="line.283"></a> -<span class="sourceLineNo">284</span> return blockDistbn;<a name="line.284"></a> -<span class="sourceLineNo">285</span> }<a name="line.285"></a> -<span class="sourceLineNo">286</span> } catch (ExecutionException e) {<a name="line.286"></a> -<span class="sourceLineNo">287</span> LOG.warn("Error while fetching cache entry ", e);<a name="line.287"></a> -<span class="sourceLineNo">288</span> blockDistbn = internalGetTopBlockLocation(hri);<a name="line.288"></a> -<span class="sourceLineNo">289</span> cache.put(hri, blockDistbn);<a name="line.289"></a> -<span class="sourceLineNo">290</span> return blockDistbn;<a name="line.290"></a> -<span class="sourceLineNo">291</span> }<a name="line.291"></a> -<span class="sourceLineNo">292</span> }<a name="line.292"></a> -<span class="sourceLineNo">293</span><a name="line.293"></a> -<span class="sourceLineNo">294</span> private ListenableFuture<HDFSBlocksDistribution> asyncGetBlockDistribution(<a name="line.294"></a> -<span class="sourceLineNo">295</span> RegionInfo hri) {<a name="line.295"></a> -<span class="sourceLineNo">296</span> try {<a name="line.296"></a> -<span class="sourceLineNo">297</span> return loader.reload(hri, EMPTY_BLOCK_DISTRIBUTION);<a name="line.297"></a> -<span class="sourceLineNo">298</span> } catch (Exception e) {<a name="line.298"></a> -<span class="sourceLineNo">299</span> return Futures.immediateFuture(EMPTY_BLOCK_DISTRIBUTION);<a name="line.299"></a> -<span class="sourceLineNo">300</span> }<a name="line.300"></a> -<span class="sourceLineNo">301</span> }<a name="line.301"></a> -<span class="sourceLineNo">302</span><a name="line.302"></a> -<span class="sourceLineNo">303</span> public void refreshAndWait(Collection<RegionInfo> hris) {<a name="line.303"></a> -<span class="sourceLineNo">304</span> ArrayList<ListenableFuture<HDFSBlocksDistribution>> regionLocationFutures = new ArrayList<>(hris.size());<a name="line.304"></a> -<span class="sourceLineNo">305</span> for (RegionInfo hregionInfo : hris) {<a name="line.305"></a> -<span class="sourceLineNo">306</span> regionLocationFutures.add(asyncGetBlockDistribution(hregionInfo));<a name="line.306"></a> -<span class="sourceLineNo">307</span> }<a name="line.307"></a> -<span class="sourceLineNo">308</span> int index = 0;<a name="line.308"></a> -<span class="sourceLineNo">309</span> for (RegionInfo hregionInfo : hris) {<a name="line.309"></a> -<span class="sourceLineNo">310</span> ListenableFuture<HDFSBlocksDistribution> future = regionLocationFutures<a name="line.310"></a> -<span class="sourceLineNo">311</span> .get(index);<a name="line.311"></a> -<span class="sourceLineNo">312</span> try {<a name="line.312"></a> -<span class="sourceLineNo">313</span> cache.put(hregionInfo, future.get());<a name="line.313"></a> -<span class="sourceLineNo">314</span> } catch (InterruptedException ite) {<a name="line.314"></a> -<span class="sourceLineNo">315</span> Thread.currentThread().interrupt();<a name="line.315"></a> -<span class="sourceLineNo">316</span> } catch (ExecutionException ee) {<a name="line.316"></a> -<span class="sourceLineNo">317</span> LOG.debug(<a name="line.317"></a> -<span class="sourceLineNo">318</span> "ExecutionException during HDFSBlocksDistribution computation. for region = "<a name="line.318"></a> -<span class="sourceLineNo">319</span> + hregionInfo.getEncodedName(), ee);<a name="line.319"></a> -<span class="sourceLineNo">320</span> }<a name="line.320"></a> -<span class="sourceLineNo">321</span> index++;<a name="line.321"></a> -<span class="sourceLineNo">322</span> }<a name="line.322"></a> -<span class="sourceLineNo">323</span> }<a name="line.323"></a> -<span class="sourceLineNo">324</span><a name="line.324"></a> -<span class="sourceLineNo">325</span> // For test<a name="line.325"></a> -<span class="sourceLineNo">326</span> LoadingCache<RegionInfo, HDFSBlocksDistribution> getCache() {<a name="line.326"></a> -<span class="sourceLineNo">327</span> return cache;<a name="line.327"></a> -<span class="sourceLineNo">328</span> }<a name="line.328"></a> -<span class="sourceLineNo">329</span>}<a name="line.329"></a> +<span class="sourceLineNo">168</span> protected List<ServerName> getTopBlockLocations(RegionInfo region) {<a name="line.168"></a> +<span class="sourceLineNo">169</span> List<String> topHosts = getBlockDistribution(region).getTopHosts();<a name="line.169"></a> +<span class="sourceLineNo">170</span> return mapHostNameToServerName(topHosts);<a name="line.170"></a> +<span class="sourceLineNo">171</span> }<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> * Returns an ordered list of hosts which have better locality for this region<a name="line.174"></a> +<span class="sourceLineNo">175</span> * than the current host.<a name="line.175"></a> +<span class="sourceLineNo">176</span> */<a name="line.176"></a> +<span class="sourceLineNo">177</span> protected List<ServerName> getTopBlockLocations(RegionInfo region, String currentHost) {<a name="line.177"></a> +<span class="sourceLineNo">178</span> HDFSBlocksDistribution blocksDistribution = getBlockDistribution(region);<a name="line.178"></a> +<span class="sourceLineNo">179</span> List<String> topHosts = blocksDistribution.getTopHosts();<a name="line.179"></a> +<span class="sourceLineNo">180</span> int toIndex = topHosts.indexOf(currentHost);<a name="line.180"></a> +<span class="sourceLineNo">181</span> List<String> subTopHosts = (toIndex < 0) ? topHosts : topHosts.subList(0, toIndex);<a name="line.181"></a> +<span class="sourceLineNo">182</span> return mapHostNameToServerName(subTopHosts);<a name="line.182"></a> +<span class="sourceLineNo">183</span> }<a name="line.183"></a> +<span class="sourceLineNo">184</span><a name="line.184"></a> +<span class="sourceLineNo">185</span> /**<a name="line.185"></a> +<span class="sourceLineNo">186</span> * Returns an ordered list of hosts that are hosting the blocks for this<a name="line.186"></a> +<span class="sourceLineNo">187</span> * region. The weight of each host is the sum of the block lengths of all<a name="line.187"></a> +<span class="sourceLineNo">188</span> * files on that host, so the first host in the list is the server which holds<a name="line.188"></a> +<span class="sourceLineNo">189</span> * the most bytes of the given region's HFiles.<a name="line.189"></a> +<span class="sourceLineNo">190</span> *<a name="line.190"></a> +<span class="sourceLineNo">191</span> * @param region region<a name="line.191"></a> +<span class="sourceLineNo">192</span> * @return ordered list of hosts holding blocks of the specified region<a name="line.192"></a> +<span class="sourceLineNo">193</span> */<a name="line.193"></a> +<span class="sourceLineNo">194</span> protected HDFSBlocksDistribution internalGetTopBlockLocation(RegionInfo region) {<a name="line.194"></a> +<span class="sourceLineNo">195</span> try {<a name="line.195"></a> +<span class="sourceLineNo">196</span> TableDescriptor tableDescriptor = getTableDescriptor(region.getTable());<a name="line.196"></a> +<span class="sourceLineNo">197</span> if (tableDescriptor != null) {<a name="line.197"></a> +<span class="sourceLineNo">198</span> HDFSBlocksDistribution blocksDistribution =<a name="line.198"></a> +<span class="sourceLineNo">199</span> HRegion.computeHDFSBlocksDistribution(getConf(), tableDescriptor, region);<a name="line.199"></a> +<span class="sourceLineNo">200</span> return blocksDistribution;<a name="line.200"></a> +<span class="sourceLineNo">201</span> }<a name="line.201"></a> +<span class="sourceLineNo">202</span> } catch (IOException ioe) {<a name="line.202"></a> +<span class="sourceLineNo">203</span> LOG.warn("IOException during HDFSBlocksDistribution computation. for " + "region = "<a name="line.203"></a> +<span class="sourceLineNo">204</span> + region.getEncodedName(), ioe);<a name="line.204"></a> +<span class="sourceLineNo">205</span> }<a name="line.205"></a> +<span class="sourceLineNo">206</span><a name="line.206"></a> +<span class="sourceLineNo">207</span> return EMPTY_BLOCK_DISTRIBUTION;<a name="line.207"></a> +<span class="sourceLineNo">208</span> }<a name="line.208"></a> +<span class="sourceLineNo">209</span><a name="line.209"></a> +<span class="sourceLineNo">210</span> /**<a name="line.210"></a> +<span class="sourceLineNo">211</span> * return TableDescriptor for a given tableName<a name="line.211"></a> +<span class="sourceLineNo">212</span> *<a name="line.212"></a> +<span class="sourceLineNo">213</span> * @param tableName the table name<a name="line.213"></a> +<span class="sourceLineNo">214</span> * @return TableDescriptor<a name="line.214"></a> +<span class="sourceLineNo">215</span> * @throws IOException if table descriptor cannot be loaded<a name="line.215"></a> +<span class="sourceLineNo">216</span> */<a name="line.216"></a> +<span class="sourceLineNo">217</span> protected TableDescriptor getTableDescriptor(TableName tableName) throws IOException {<a name="line.217"></a> +<span class="sourceLineNo">218</span> TableDescriptor tableDescriptor = null;<a name="line.218"></a> +<span class="sourceLineNo">219</span> try {<a name="line.219"></a> +<span class="sourceLineNo">220</span> if (this.services != null && this.services.getTableDescriptors() != null) {<a name="line.220"></a> +<span class="sourceLineNo">221</span> tableDescriptor = this.services.getTableDescriptors().get(tableName);<a name="line.221"></a> +<span class="sourceLineNo">222</span> }<a name="line.222"></a> +<span class="sourceLineNo">223</span> } catch (FileNotFoundException fnfe) {<a name="line.223"></a> +<span class="sourceLineNo">224</span> LOG.debug("FileNotFoundException during getTableDescriptors. Current table name = {}",<a name="line.224"></a> +<span class="sourceLineNo">225</span> tableName, fnfe);<a name="line.225"></a> +<span class="sourceLineNo">226</span> }<a name="line.226"></a> +<span class="sourceLineNo">227</span><a name="line.227"></a> +<span class="sourceLineNo">228</span> return tableDescriptor;<a name="line.228"></a> +<span class="sourceLineNo">229</span> }<a name="line.229"></a> +<span class="sourceLineNo">230</span><a name="line.230"></a> +<span class="sourceLineNo">231</span> /**<a name="line.231"></a> +<span class="sourceLineNo">232</span> * Map hostname to ServerName, The output ServerName list will have the same<a name="line.232"></a> +<span class="sourceLineNo">233</span> * order as input hosts.<a name="line.233"></a> +<span class="sourceLineNo">234</span> *<a name="line.234"></a> +<span class="sourceLineNo">235</span> * @param hosts the list of hosts<a name="line.235"></a> +<span class="sourceLineNo">236</span> * @return ServerName list<a name="line.236"></a> +<span class="sourceLineNo">237</span> */<a name="line.237"></a> +<span class="sourceLineNo">238</span> protected List<ServerName> mapHostNameToServerName(List<String> hosts) {<a name="line.238"></a> +<span class="sourceLineNo">239</span> if (hosts == null) {<a name="line.239"></a> +<span class="sourceLineNo">240</span> LOG.warn("RegionLocationFinder top hosts is null");<a name="line.240"></a> +<span class="sourceLineNo">241</span> return Collections.emptyList();<a name="line.241"></a> +<span class="sourceLineNo">242</span> }<a name="line.242"></a> +<span class="sourceLineNo">243</span> if (status == null) {<a name="line.243"></a> +<span class="sourceLineNo">244</span> return Collections.emptyList();<a name="line.244"></a> +<span class="sourceLineNo">245</span> }<a name="line.245"></a> +<span class="sourceLineNo">246</span><a name="line.246"></a> +<span class="sourceLineNo">247</span> List<ServerName> topServerNames = new ArrayList<>();<a name="line.247"></a> +<span class="sourceLineNo">248</span> Collection<ServerName> regionServers = status.getLiveServerMetrics().keySet();<a name="line.248"></a> +<span class="sourceLineNo">249</span><a name="line.249"></a> +<span class="sourceLineNo">250</span> // create a mapping from hostname to ServerName for fast lookup<a name="line.250"></a> +<span class="sourceLineNo">251</span> MultiValuedMap<String, ServerName> hostToServerName = new ArrayListValuedHashMap<>();<a name="line.251"></a> +<span class="sourceLineNo">252</span> for (ServerName sn : regionServers) {<a name="line.252"></a> +<span class="sourceLineNo">253</span> String hostName = sn.getHostname();<a name="line.253"></a> +<span class="sourceLineNo">254</span> hostToServerName.put(hostName, sn);<a name="line.254"></a> +<span class="sourceLineNo">255</span> }<a name="line.255"></a> +<span class="sourceLineNo">256</span><a name="line.256"></a> +<span class="sourceLineNo">257</span> for (String host : hosts) {<a name="line.257"></a> +<span class="sourceLineNo">258</span> for (ServerName sn : hostToServerName.get(host)) {<a name="line.258"></a> +<span class="sourceLineNo">259</span> // it is possible that HDFS is up ( thus host is valid ),<a name="line.259"></a> +<span class="sourceLineNo">260</span> // but RS is down ( thus sn is null )<a name="line.260"></a> +<span class="sourceLineNo">261</span> CollectionUtils.addIgnoreNull(topServerNames, sn);<a name="line.261"></a> +<span class="sourceLineNo">262</span> }<a name="line.262"></a> +<span class="sourceLineNo">263</span> }<a name="line.263"></a> +<span class="sourceLineNo">264</span> return topServerNames;<a name="line.264"></a> +<span class="sourceLineNo">265</span> }<a name="line.265"></a> +<span class="sourceLineNo">266</span><a name="line.266"></a> +<span class="sourceLineNo">267</span> public HDFSBlocksDistribution getBlockDistribution(RegionInfo hri) {<a name="line.267"></a> +<span class="sourceLineNo">268</span> return cache.getUnchecked(hri);<a name="line.268"></a> +<span class="sourceLineNo">269</span> }<a name="line.269"></a> +<span class="sourceLineNo">270</span><a name="line.270"></a> +<span class="sourceLineNo">271</span> private ListenableFuture<HDFSBlocksDistribution> asyncGetBlockDistribution(<a name="line.271"></a> +<span class="sourceLineNo">272</span> RegionInfo hri) {<a name="line.272"></a> +<span class="sourceLineNo">273</span> try {<a name="line.273"></a> +<span class="sourceLineNo">274</span> return loader.reload(hri, EMPTY_BLOCK_DISTRIBUTION);<a name="line.274"></a> +<span class="sourceLineNo">275</span> } catch (Exception e) {<a name="line.275"></a> +<span class="sourceLineNo">276</span> return Futures.immediateFuture(EMPTY_BLOCK_DISTRIBUTION);<a name="line.276"></a> +<span class="sourceLineNo">277</span> }<a name="line.277"></a> +<span class="sourceLineNo">278</span> }<a name="line.278"></a> +<span class="sourceLineNo">279</span><a name="line.279"></a> +<span class="sourceLineNo">280</span> public void refreshAndWait(Collection<RegionInfo> hris) {<a name="line.280"></a> +<span class="sourceLineNo">281</span> Map<RegionInfo, ListenableFuture<HDFSBlocksDistribution>> regionLocationFutures =<a name="line.281"></a> +<span class="sourceLineNo">282</span> new HashMap<>(hris.size() * 2);<a name="line.282"></a> +<span class="sourceLineNo">283</span><a name="line.283"></a> +<span class="sourceLineNo">284</span> for (RegionInfo hregionInfo : hris) {<a name="line.284"></a> +<span class="sourceLineNo">285</span> regionLocationFutures.put(hregionInfo, asyncGetBlockDistribution(hregionInfo));<a name="line.285"></a> +<span class="sourceLineNo">286</span> }<a name="line.286"></a> +<span class="sourceLineNo">287</span> for (RegionInfo hregionInfo : hris) {<a name="line.287"></a> +<span class="sourceLineNo">288</span> ListenableFuture<HDFSBlocksDistribution> future = regionLocationFutures<a name="line.288"></a> +<span class="sourceLineNo">289</span> .get(hregionInfo);<a name="line.289"></a> +<span class="sourceLineNo">290</span> try {<a name="line.290"></a> +<span class="sourceLineNo">291</span> cache.put(hregionInfo, future.get());<a name="line.291"></a> +<span class="sourceLineNo">292</span> } catch (InterruptedException ite) {<a name="line.292"></a> +<span class="sourceLineNo">293</span> Thread.currentThread().interrupt();<a name="line.293"></a> +<span class="sourceLineNo">294</span> } catch (ExecutionException ee) {<a name="line.294"></a> +<span class="sourceLineNo">295</span> LOG.debug(<a name="line.295"></a> +<span class="sourceLineNo">296</span> "ExecutionException during HDFSBlocksDistribution computation. for region = {}",<a name="line.296"></a> +<span class="sourceLineNo">297</span> hregionInfo.getEncodedName(), ee);<a name="line.297"></a> +<span class="sourceLineNo">298</span> }<a name="line.298"></a> +<span class="sourceLineNo">299</span> }<a name="line.299"></a> +<span class="sourceLineNo">300</span> }<a name="line.300"></a> +<span class="sourceLineNo">301</span><a name="line.301"></a> +<span class="sourceLineNo">302</span> // For test<a name="line.302"></a> +<span class="sourceLineNo">303</span> LoadingCache<RegionInfo, HDFSBlocksDistribution> getCache() {<a name="line.303"></a> +<span class="sourceLineNo">304</span> return cache;<a name="line.304"></a> +<span class="sourceLineNo">305</span> }<a name="line.305"></a> +<span class="sourceLineNo">306</span>}<a name="line.306"></a>
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CandidateGenerator.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CandidateGenerator.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CandidateGenerator.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CandidateGenerator.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CandidateGenerator.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFromRegionLoadAsRateFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFromRegionLoadAsRateFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFromRegionLoadAsRateFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFromRegionLoadAsRateFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFromRegionLoadAsRateFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFromRegionLoadFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFromRegionLoadFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFromRegionLoadFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFromRegionLoadFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFromRegionLoadFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.CostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LoadCandidateGenerator.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LoadCandidateGenerator.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LoadCandidateGenerator.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LoadCandidateGenerator.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LoadCandidateGenerator.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LocalityBasedCandidateGenerator.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LocalityBasedCandidateGenerator.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LocalityBasedCandidateGenerator.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LocalityBasedCandidateGenerator.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LocalityBasedCandidateGenerator.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LocalityBasedCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LocalityBasedCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LocalityBasedCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LocalityBasedCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.LocalityBasedCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.MemStoreSizeCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.MemStoreSizeCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.MemStoreSizeCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.MemStoreSizeCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.MemStoreSizeCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.MoveCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.MoveCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.MoveCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.MoveCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.MoveCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.PrimaryRegionCountSkewCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.PrimaryRegionCountSkewCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.PrimaryRegionCountSkewCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.PrimaryRegionCountSkewCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.PrimaryRegionCountSkewCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RackLocalityCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RackLocalityCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RackLocalityCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RackLocalityCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RackLocalityCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RandomCandidateGenerator.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RandomCandidateGenerator.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RandomCandidateGenerator.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RandomCandidateGenerator.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RandomCandidateGenerator.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.ReadRequestCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.ReadRequestCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.ReadRequestCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.ReadRequestCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.ReadRequestCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionCountSkewCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionCountSkewCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionCountSkewCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionCountSkewCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionCountSkewCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaCandidateGenerator.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaCandidateGenerator.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaCandidateGenerator.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaCandidateGenerator.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaCandidateGenerator.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaHostCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaHostCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaHostCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaHostCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaHostCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaRackCandidateGenerator.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaRackCandidateGenerator.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaRackCandidateGenerator.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaRackCandidateGenerator.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaRackCandidateGenerator.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaRackCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaRackCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaRackCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaRackCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.RegionReplicaRackCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.ServerLocalityCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.ServerLocalityCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.ServerLocalityCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.ServerLocalityCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.ServerLocalityCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a> http://git-wip-us.apache.org/repos/asf/hbase-site/blob/bd675fa3/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.StoreFileCostFunction.html ---------------------------------------------------------------------- diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.StoreFileCostFunction.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.StoreFileCostFunction.html index 1bdfb9a..22bebe1 100644 --- a/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.StoreFileCostFunction.html +++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.StoreFileCostFunction.html @@ -300,7 +300,7 @@ <span class="sourceLineNo">292</span> continue;<a name="line.292"></a> <span class="sourceLineNo">293</span> }<a name="line.293"></a> <span class="sourceLineNo">294</span> if (!c.isNeeded()) {<a name="line.294"></a> -<span class="sourceLineNo">295</span> LOG.debug(c.getClass().getName() + " indicated that its cost should not be considered");<a name="line.295"></a> +<span class="sourceLineNo">295</span> LOG.debug("{} not needed", c.getClass().getSimpleName());<a name="line.295"></a> <span class="sourceLineNo">296</span> continue;<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> <span class="sourceLineNo">298</span> sumMultiplier += multiplier;<a name="line.298"></a>