hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [26/51] [partial] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Sat, 10 Jun 2017 15:00:16 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/476c54ed/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMaster.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMaster.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMaster.html
index a9223ea..e159f19 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMaster.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMaster.html
@@ -164,7 +164,28 @@
 <span class="sourceLineNo">156</span>      }<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>}<a name="line.159"></a>
+<span class="sourceLineNo">159</span><a name="line.159"></a>
+<span class="sourceLineNo">160</span>  /**<a name="line.160"></a>
+<span class="sourceLineNo">161</span>   * Sets the execution time of a period of the {@code SnapshotQuotaObserverChore}.<a name="line.161"></a>
+<span class="sourceLineNo">162</span>   */<a name="line.162"></a>
+<span class="sourceLineNo">163</span>  public void incrementSnapshotObserverTime(final long executionTime) {<a name="line.163"></a>
+<span class="sourceLineNo">164</span>    masterQuotaSource.incrementSnapshotObserverChoreTime(executionTime);<a name="line.164"></a>
+<span class="sourceLineNo">165</span>  }<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>   * Sets the execution time to compute the size of a single snapshot.<a name="line.168"></a>
+<span class="sourceLineNo">169</span>   */<a name="line.169"></a>
+<span class="sourceLineNo">170</span>  public void incrementSnapshotSizeComputationTime(final long executionTime) {<a name="line.170"></a>
+<span class="sourceLineNo">171</span>    masterQuotaSource.incrementSnapshotObserverSnapshotComputationTime(executionTime);<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>  /**<a name="line.174"></a>
+<span class="sourceLineNo">175</span>   * Sets the execution time to fetch the mapping of snapshots to originating table.<a name="line.175"></a>
+<span class="sourceLineNo">176</span>   */<a name="line.176"></a>
+<span class="sourceLineNo">177</span>  public void incrementSnapshotFetchTime(long executionTime) {<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    masterQuotaSource.incrementSnapshotObserverSnapshotFetchTime(executionTime);<a name="line.178"></a>
+<span class="sourceLineNo">179</span>  }<a name="line.179"></a>
+<span class="sourceLineNo">180</span>}<a name="line.180"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/476c54ed/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMasterQuotaSource.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMasterQuotaSource.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMasterQuotaSource.html
index 2d63c04..54c92d7 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMasterQuotaSource.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMasterQuotaSource.html
@@ -47,51 +47,78 @@
 <span class="sourceLineNo">039</span>  String QUOTA_OBSERVER_CHORE_TIME_NAME = "quotaObserverChoreTime";<a name="line.39"></a>
 <span class="sourceLineNo">040</span>  String QUOTA_OBSERVER_CHORE_TIME_DESC =<a name="line.40"></a>
 <span class="sourceLineNo">041</span>      "Histogram for the time in millis for the QuotaObserverChore";<a name="line.41"></a>
-<span class="sourceLineNo">042</span>  String TABLE_QUOTA_USAGE_NAME = "tableSpaceQuotaOverview";<a name="line.42"></a>
-<span class="sourceLineNo">043</span>  String TABLE_QUOTA_USAGE_DESC = "A JSON summary of the usage of all tables with space quotas";<a name="line.43"></a>
-<span class="sourceLineNo">044</span>  String NS_QUOTA_USAGE_NAME = "namespaceSpaceQuotaOverview";<a name="line.44"></a>
-<span class="sourceLineNo">045</span>  String NS_QUOTA_USAGE_DESC = "A JSON summary of the usage of all namespaces with space quotas";<a name="line.45"></a>
-<span class="sourceLineNo">046</span><a name="line.46"></a>
-<span class="sourceLineNo">047</span>  /**<a name="line.47"></a>
-<span class="sourceLineNo">048</span>   * Updates the metric tracking the number of space quotas defined in the system.<a name="line.48"></a>
-<span class="sourceLineNo">049</span>   *<a name="line.49"></a>
-<span class="sourceLineNo">050</span>   * @param numSpaceQuotas The number of space quotas defined<a name="line.50"></a>
-<span class="sourceLineNo">051</span>   */<a name="line.51"></a>
-<span class="sourceLineNo">052</span>  void updateNumSpaceQuotas(long numSpaceQuotas);<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>   * Updates the metric tracking the number of tables the master has computed to be in<a name="line.55"></a>
-<span class="sourceLineNo">056</span>   * violation of their space quota.<a name="line.56"></a>
-<span class="sourceLineNo">057</span>   *<a name="line.57"></a>
-<span class="sourceLineNo">058</span>   * @param numTablesInViolation The number of tables violating a space quota<a name="line.58"></a>
-<span class="sourceLineNo">059</span>   */<a name="line.59"></a>
-<span class="sourceLineNo">060</span>  void updateNumTablesInSpaceQuotaViolation(long numTablesInViolation);<a name="line.60"></a>
-<span class="sourceLineNo">061</span><a name="line.61"></a>
-<span class="sourceLineNo">062</span>  /**<a name="line.62"></a>
-<span class="sourceLineNo">063</span>   * Updates the metric tracking the number of namespaces the master has computed to be in<a name="line.63"></a>
-<span class="sourceLineNo">064</span>   * violation of their space quota.<a name="line.64"></a>
-<span class="sourceLineNo">065</span>   *<a name="line.65"></a>
-<span class="sourceLineNo">066</span>   * @param numNamespacesInViolation The number of namespaces violating a space quota<a name="line.66"></a>
-<span class="sourceLineNo">067</span>   */<a name="line.67"></a>
-<span class="sourceLineNo">068</span>  void updateNumNamespacesInSpaceQuotaViolation(long numNamespacesInViolation);<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>   * Updates the metric tracking the number of region size reports the master is currently<a name="line.71"></a>
-<span class="sourceLineNo">072</span>   * retaining in memory.<a name="line.72"></a>
-<span class="sourceLineNo">073</span>   *<a name="line.73"></a>
-<span class="sourceLineNo">074</span>   * @param numCurrentRegionSizeReports The number of region size reports the master is holding in<a name="line.74"></a>
-<span class="sourceLineNo">075</span>   *    memory<a name="line.75"></a>
+<span class="sourceLineNo">042</span>  String SNAPSHOT_OBSERVER_CHORE_TIME_NAME = "snapshotQuotaObserverChoreTime";<a name="line.42"></a>
+<span class="sourceLineNo">043</span>  String SNAPSHOT_OBSERVER_CHORE_TIME_DESC =<a name="line.43"></a>
+<span class="sourceLineNo">044</span>      "Histogram for the time in millis for the SnapshotQuotaObserverChore";<a name="line.44"></a>
+<span class="sourceLineNo">045</span>  String SNAPSHOT_OBSERVER_SIZE_COMPUTATION_TIME_NAME = "snapshotObserverSizeComputationTime";<a name="line.45"></a>
+<span class="sourceLineNo">046</span>  String SNAPSHOT_OBSERVER_SIZE_COMPUTATION_TIME_DESC =<a name="line.46"></a>
+<span class="sourceLineNo">047</span>      "Histogram for the time in millis to compute the size of each snapshot";<a name="line.47"></a>
+<span class="sourceLineNo">048</span>  String SNAPSHOT_OBSERVER_FETCH_TIME_NAME = "snapshotObserverSnapshotFetchTime";<a name="line.48"></a>
+<span class="sourceLineNo">049</span>  String SNAPSHOT_OBSERVER_FETCH_TIME_DESC =<a name="line.49"></a>
+<span class="sourceLineNo">050</span>      "Histogram for the time in millis to fetch all snapshots from HBase";<a name="line.50"></a>
+<span class="sourceLineNo">051</span>  String TABLE_QUOTA_USAGE_NAME = "tableSpaceQuotaOverview";<a name="line.51"></a>
+<span class="sourceLineNo">052</span>  String TABLE_QUOTA_USAGE_DESC = "A JSON summary of the usage of all tables with space quotas";<a name="line.52"></a>
+<span class="sourceLineNo">053</span>  String NS_QUOTA_USAGE_NAME = "namespaceSpaceQuotaOverview";<a name="line.53"></a>
+<span class="sourceLineNo">054</span>  String NS_QUOTA_USAGE_DESC = "A JSON summary of the usage of all namespaces with space quotas";<a name="line.54"></a>
+<span class="sourceLineNo">055</span><a name="line.55"></a>
+<span class="sourceLineNo">056</span>  /**<a name="line.56"></a>
+<span class="sourceLineNo">057</span>   * Updates the metric tracking the number of space quotas defined in the system.<a name="line.57"></a>
+<span class="sourceLineNo">058</span>   *<a name="line.58"></a>
+<span class="sourceLineNo">059</span>   * @param numSpaceQuotas The number of space quotas defined<a name="line.59"></a>
+<span class="sourceLineNo">060</span>   */<a name="line.60"></a>
+<span class="sourceLineNo">061</span>  void updateNumSpaceQuotas(long numSpaceQuotas);<a name="line.61"></a>
+<span class="sourceLineNo">062</span><a name="line.62"></a>
+<span class="sourceLineNo">063</span>  /**<a name="line.63"></a>
+<span class="sourceLineNo">064</span>   * Updates the metric tracking the number of tables the master has computed to be in<a name="line.64"></a>
+<span class="sourceLineNo">065</span>   * violation of their space quota.<a name="line.65"></a>
+<span class="sourceLineNo">066</span>   *<a name="line.66"></a>
+<span class="sourceLineNo">067</span>   * @param numTablesInViolation The number of tables violating a space quota<a name="line.67"></a>
+<span class="sourceLineNo">068</span>   */<a name="line.68"></a>
+<span class="sourceLineNo">069</span>  void updateNumTablesInSpaceQuotaViolation(long numTablesInViolation);<a name="line.69"></a>
+<span class="sourceLineNo">070</span><a name="line.70"></a>
+<span class="sourceLineNo">071</span>  /**<a name="line.71"></a>
+<span class="sourceLineNo">072</span>   * Updates the metric tracking the number of namespaces the master has computed to be in<a name="line.72"></a>
+<span class="sourceLineNo">073</span>   * violation of their space quota.<a name="line.73"></a>
+<span class="sourceLineNo">074</span>   *<a name="line.74"></a>
+<span class="sourceLineNo">075</span>   * @param numNamespacesInViolation The number of namespaces violating a space quota<a name="line.75"></a>
 <span class="sourceLineNo">076</span>   */<a name="line.76"></a>
-<span class="sourceLineNo">077</span>  void updateNumCurrentSpaceQuotaRegionSizeReports(long numCurrentRegionSizeReports);<a name="line.77"></a>
+<span class="sourceLineNo">077</span>  void updateNumNamespacesInSpaceQuotaViolation(long numNamespacesInViolation);<a name="line.77"></a>
 <span class="sourceLineNo">078</span><a name="line.78"></a>
 <span class="sourceLineNo">079</span>  /**<a name="line.79"></a>
-<span class="sourceLineNo">080</span>   * Updates the metric tracking the amount of time taken by the {@code QuotaObserverChore}<a name="line.80"></a>
-<span class="sourceLineNo">081</span>   * which runs periodically.<a name="line.81"></a>
+<span class="sourceLineNo">080</span>   * Updates the metric tracking the number of region size reports the master is currently<a name="line.80"></a>
+<span class="sourceLineNo">081</span>   * retaining in memory.<a name="line.81"></a>
 <span class="sourceLineNo">082</span>   *<a name="line.82"></a>
-<span class="sourceLineNo">083</span>   * @param time The execution time of the chore in milliseconds<a name="line.83"></a>
-<span class="sourceLineNo">084</span>   */<a name="line.84"></a>
-<span class="sourceLineNo">085</span>  void incrementSpaceQuotaObserverChoreTime(long time);<a name="line.85"></a>
-<span class="sourceLineNo">086</span>}<a name="line.86"></a>
+<span class="sourceLineNo">083</span>   * @param numCurrentRegionSizeReports The number of region size reports the master is holding in<a name="line.83"></a>
+<span class="sourceLineNo">084</span>   *    memory<a name="line.84"></a>
+<span class="sourceLineNo">085</span>   */<a name="line.85"></a>
+<span class="sourceLineNo">086</span>  void updateNumCurrentSpaceQuotaRegionSizeReports(long numCurrentRegionSizeReports);<a name="line.86"></a>
+<span class="sourceLineNo">087</span><a name="line.87"></a>
+<span class="sourceLineNo">088</span>  /**<a name="line.88"></a>
+<span class="sourceLineNo">089</span>   * Updates the metric tracking the amount of time taken by the {@code QuotaObserverChore}<a name="line.89"></a>
+<span class="sourceLineNo">090</span>   * which runs periodically.<a name="line.90"></a>
+<span class="sourceLineNo">091</span>   *<a name="line.91"></a>
+<span class="sourceLineNo">092</span>   * @param time The execution time of the chore in milliseconds<a name="line.92"></a>
+<span class="sourceLineNo">093</span>   */<a name="line.93"></a>
+<span class="sourceLineNo">094</span>  void incrementSpaceQuotaObserverChoreTime(long time);<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>   * Updates the metric tracking the amount of time taken by the {@code SnapshotQuotaObserverChore}<a name="line.97"></a>
+<span class="sourceLineNo">098</span>   * which runs periodically.<a name="line.98"></a>
+<span class="sourceLineNo">099</span>   */<a name="line.99"></a>
+<span class="sourceLineNo">100</span>  void incrementSnapshotObserverChoreTime(long time);<a name="line.100"></a>
+<span class="sourceLineNo">101</span><a name="line.101"></a>
+<span class="sourceLineNo">102</span>  /**<a name="line.102"></a>
+<span class="sourceLineNo">103</span>   * Updates the metric tracking the amount of time taken by the {@code SnapshotQuotaObserverChore}<a name="line.103"></a>
+<span class="sourceLineNo">104</span>   * to compute the size of one snapshot, relative to the files referenced by the originating table.<a name="line.104"></a>
+<span class="sourceLineNo">105</span>   */<a name="line.105"></a>
+<span class="sourceLineNo">106</span>  void incrementSnapshotObserverSnapshotComputationTime(long time);<a name="line.106"></a>
+<span class="sourceLineNo">107</span><a name="line.107"></a>
+<span class="sourceLineNo">108</span>  /**<a name="line.108"></a>
+<span class="sourceLineNo">109</span>   * Updates the metric tracking the amount of time taken by the {@code SnapshotQuotaObserverChore}<a name="line.109"></a>
+<span class="sourceLineNo">110</span>   * to fetch all snapshots.<a name="line.110"></a>
+<span class="sourceLineNo">111</span>   */<a name="line.111"></a>
+<span class="sourceLineNo">112</span>  void incrementSnapshotObserverSnapshotFetchTime(long time);<a name="line.112"></a>
+<span class="sourceLineNo">113</span>}<a name="line.113"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/476c54ed/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.html
index 40d919b..c25efce 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/MetricsMasterQuotaSourceImpl.html
@@ -47,98 +47,123 @@
 <span class="sourceLineNo">039</span>  private final MutableGaugeLong namespacesViolatingQuotasGauge;<a name="line.39"></a>
 <span class="sourceLineNo">040</span>  private final MutableGaugeLong regionSpaceReportsGauge;<a name="line.40"></a>
 <span class="sourceLineNo">041</span>  private final MetricHistogram quotaObserverTimeHisto;<a name="line.41"></a>
-<span class="sourceLineNo">042</span><a name="line.42"></a>
-<span class="sourceLineNo">043</span>  public MetricsMasterQuotaSourceImpl(MetricsMasterWrapper wrapper) {<a name="line.43"></a>
-<span class="sourceLineNo">044</span>    this(METRICS_NAME, METRICS_DESCRIPTION, METRICS_CONTEXT, METRICS_JMX_CONTEXT, wrapper);<a name="line.44"></a>
-<span class="sourceLineNo">045</span>  }<a name="line.45"></a>
-<span class="sourceLineNo">046</span><a name="line.46"></a>
-<span class="sourceLineNo">047</span>  public MetricsMasterQuotaSourceImpl(<a name="line.47"></a>
-<span class="sourceLineNo">048</span>      String metricsName, String metricsDescription, String metricsContext,<a name="line.48"></a>
-<span class="sourceLineNo">049</span>      String metricsJmxContext, MetricsMasterWrapper wrapper) {<a name="line.49"></a>
-<span class="sourceLineNo">050</span>    super(metricsName, metricsDescription, metricsContext, metricsJmxContext);<a name="line.50"></a>
-<span class="sourceLineNo">051</span>    this.wrapper = wrapper;<a name="line.51"></a>
-<span class="sourceLineNo">052</span><a name="line.52"></a>
-<span class="sourceLineNo">053</span>    spaceQuotasGauge = getMetricsRegistry().newGauge(<a name="line.53"></a>
-<span class="sourceLineNo">054</span>        NUM_SPACE_QUOTAS_NAME, NUM_SPACE_QUOTAS_DESC, 0L);<a name="line.54"></a>
-<span class="sourceLineNo">055</span>    tablesViolatingQuotasGauge = getMetricsRegistry().newGauge(<a name="line.55"></a>
-<span class="sourceLineNo">056</span>        NUM_TABLES_QUOTA_VIOLATIONS_NAME, NUM_TABLES_QUOTA_VIOLATIONS_DESC, 0L);<a name="line.56"></a>
-<span class="sourceLineNo">057</span>    namespacesViolatingQuotasGauge = getMetricsRegistry().newGauge(<a name="line.57"></a>
-<span class="sourceLineNo">058</span>        NUM_NS_QUOTA_VIOLATIONS_NAME, NUM_NS_QUOTA_VIOLATIONS_DESC, 0L);<a name="line.58"></a>
-<span class="sourceLineNo">059</span>    regionSpaceReportsGauge = getMetricsRegistry().newGauge(<a name="line.59"></a>
-<span class="sourceLineNo">060</span>        NUM_REGION_SIZE_REPORTS_NAME, NUM_REGION_SIZE_REPORTS_DESC, 0L);<a name="line.60"></a>
-<span class="sourceLineNo">061</span><a name="line.61"></a>
-<span class="sourceLineNo">062</span>    quotaObserverTimeHisto = getMetricsRegistry().newTimeHistogram(<a name="line.62"></a>
-<span class="sourceLineNo">063</span>        QUOTA_OBSERVER_CHORE_TIME_NAME, QUOTA_OBSERVER_CHORE_TIME_DESC);<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>  @Override<a name="line.66"></a>
-<span class="sourceLineNo">067</span>  public void updateNumSpaceQuotas(long numSpaceQuotas) {<a name="line.67"></a>
-<span class="sourceLineNo">068</span>    spaceQuotasGauge.set(numSpaceQuotas);<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>  @Override<a name="line.71"></a>
-<span class="sourceLineNo">072</span>  public void updateNumTablesInSpaceQuotaViolation(long numTablesInViolation) {<a name="line.72"></a>
-<span class="sourceLineNo">073</span>    tablesViolatingQuotasGauge.set(numTablesInViolation);<a name="line.73"></a>
+<span class="sourceLineNo">042</span>  private final MetricHistogram snapshotObserverTimeHisto;<a name="line.42"></a>
+<span class="sourceLineNo">043</span>  private final MetricHistogram snapshotObserverSizeComputationTimeHisto;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>  private final MetricHistogram snapshotObserverSnapshotFetchTimeHisto;<a name="line.44"></a>
+<span class="sourceLineNo">045</span><a name="line.45"></a>
+<span class="sourceLineNo">046</span>  public MetricsMasterQuotaSourceImpl(MetricsMasterWrapper wrapper) {<a name="line.46"></a>
+<span class="sourceLineNo">047</span>    this(METRICS_NAME, METRICS_DESCRIPTION, METRICS_CONTEXT, METRICS_JMX_CONTEXT, wrapper);<a name="line.47"></a>
+<span class="sourceLineNo">048</span>  }<a name="line.48"></a>
+<span class="sourceLineNo">049</span><a name="line.49"></a>
+<span class="sourceLineNo">050</span>  public MetricsMasterQuotaSourceImpl(<a name="line.50"></a>
+<span class="sourceLineNo">051</span>      String metricsName, String metricsDescription, String metricsContext,<a name="line.51"></a>
+<span class="sourceLineNo">052</span>      String metricsJmxContext, MetricsMasterWrapper wrapper) {<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    super(metricsName, metricsDescription, metricsContext, metricsJmxContext);<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    this.wrapper = wrapper;<a name="line.54"></a>
+<span class="sourceLineNo">055</span><a name="line.55"></a>
+<span class="sourceLineNo">056</span>    spaceQuotasGauge = getMetricsRegistry().newGauge(<a name="line.56"></a>
+<span class="sourceLineNo">057</span>        NUM_SPACE_QUOTAS_NAME, NUM_SPACE_QUOTAS_DESC, 0L);<a name="line.57"></a>
+<span class="sourceLineNo">058</span>    tablesViolatingQuotasGauge = getMetricsRegistry().newGauge(<a name="line.58"></a>
+<span class="sourceLineNo">059</span>        NUM_TABLES_QUOTA_VIOLATIONS_NAME, NUM_TABLES_QUOTA_VIOLATIONS_DESC, 0L);<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    namespacesViolatingQuotasGauge = getMetricsRegistry().newGauge(<a name="line.60"></a>
+<span class="sourceLineNo">061</span>        NUM_NS_QUOTA_VIOLATIONS_NAME, NUM_NS_QUOTA_VIOLATIONS_DESC, 0L);<a name="line.61"></a>
+<span class="sourceLineNo">062</span>    regionSpaceReportsGauge = getMetricsRegistry().newGauge(<a name="line.62"></a>
+<span class="sourceLineNo">063</span>        NUM_REGION_SIZE_REPORTS_NAME, NUM_REGION_SIZE_REPORTS_DESC, 0L);<a name="line.63"></a>
+<span class="sourceLineNo">064</span><a name="line.64"></a>
+<span class="sourceLineNo">065</span>    quotaObserverTimeHisto = getMetricsRegistry().newTimeHistogram(<a name="line.65"></a>
+<span class="sourceLineNo">066</span>        QUOTA_OBSERVER_CHORE_TIME_NAME, QUOTA_OBSERVER_CHORE_TIME_DESC);<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    snapshotObserverTimeHisto = getMetricsRegistry().newTimeHistogram(<a name="line.67"></a>
+<span class="sourceLineNo">068</span>        SNAPSHOT_OBSERVER_CHORE_TIME_NAME, SNAPSHOT_OBSERVER_CHORE_TIME_DESC);<a name="line.68"></a>
+<span class="sourceLineNo">069</span><a name="line.69"></a>
+<span class="sourceLineNo">070</span>    snapshotObserverSizeComputationTimeHisto = getMetricsRegistry().newTimeHistogram(<a name="line.70"></a>
+<span class="sourceLineNo">071</span>        SNAPSHOT_OBSERVER_SIZE_COMPUTATION_TIME_NAME, SNAPSHOT_OBSERVER_SIZE_COMPUTATION_TIME_DESC);<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    snapshotObserverSnapshotFetchTimeHisto = getMetricsRegistry().newTimeHistogram(<a name="line.72"></a>
+<span class="sourceLineNo">073</span>        SNAPSHOT_OBSERVER_FETCH_TIME_NAME, SNAPSHOT_OBSERVER_FETCH_TIME_DESC);<a name="line.73"></a>
 <span class="sourceLineNo">074</span>  }<a name="line.74"></a>
 <span class="sourceLineNo">075</span><a name="line.75"></a>
 <span class="sourceLineNo">076</span>  @Override<a name="line.76"></a>
-<span class="sourceLineNo">077</span>  public void updateNumNamespacesInSpaceQuotaViolation(long numNamespacesInViolation) {<a name="line.77"></a>
-<span class="sourceLineNo">078</span>    namespacesViolatingQuotasGauge.set(numNamespacesInViolation);<a name="line.78"></a>
+<span class="sourceLineNo">077</span>  public void updateNumSpaceQuotas(long numSpaceQuotas) {<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    spaceQuotasGauge.set(numSpaceQuotas);<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>  @Override<a name="line.81"></a>
-<span class="sourceLineNo">082</span>  public void updateNumCurrentSpaceQuotaRegionSizeReports(long numCurrentRegionSizeReports) {<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    regionSpaceReportsGauge.set(numCurrentRegionSizeReports);<a name="line.83"></a>
+<span class="sourceLineNo">082</span>  public void updateNumTablesInSpaceQuotaViolation(long numTablesInViolation) {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    tablesViolatingQuotasGauge.set(numTablesInViolation);<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 void incrementSpaceQuotaObserverChoreTime(long time) {<a name="line.87"></a>
-<span class="sourceLineNo">088</span>    quotaObserverTimeHisto.add(time);<a name="line.88"></a>
+<span class="sourceLineNo">087</span>  public void updateNumNamespacesInSpaceQuotaViolation(long numNamespacesInViolation) {<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    namespacesViolatingQuotasGauge.set(numNamespacesInViolation);<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>  @Override<a name="line.91"></a>
-<span class="sourceLineNo">092</span>  public void getMetrics(MetricsCollector metricsCollector, boolean all) {<a name="line.92"></a>
-<span class="sourceLineNo">093</span>    MetricsRecordBuilder record = metricsCollector.addRecord(metricsRegistry.info());<a name="line.93"></a>
-<span class="sourceLineNo">094</span>    if (wrapper != null) {<a name="line.94"></a>
-<span class="sourceLineNo">095</span>      // Summarize the tables<a name="line.95"></a>
-<span class="sourceLineNo">096</span>      Map&lt;String,Entry&lt;Long,Long&gt;&gt; tableUsages = wrapper.getTableSpaceUtilization();<a name="line.96"></a>
-<span class="sourceLineNo">097</span>      String tableSummary = "[]";<a name="line.97"></a>
-<span class="sourceLineNo">098</span>      if (tableUsages != null &amp;&amp; !tableUsages.isEmpty()) {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>        tableSummary = generateJsonQuotaSummary(tableUsages.entrySet(), "table");<a name="line.99"></a>
-<span class="sourceLineNo">100</span>      }<a name="line.100"></a>
-<span class="sourceLineNo">101</span>      record.tag(Interns.info(TABLE_QUOTA_USAGE_NAME, TABLE_QUOTA_USAGE_DESC), tableSummary);<a name="line.101"></a>
-<span class="sourceLineNo">102</span><a name="line.102"></a>
-<span class="sourceLineNo">103</span>      // Summarize the namespaces<a name="line.103"></a>
-<span class="sourceLineNo">104</span>      String nsSummary = "[]";<a name="line.104"></a>
-<span class="sourceLineNo">105</span>      Map&lt;String,Entry&lt;Long,Long&gt;&gt; namespaceUsages = wrapper.getNamespaceSpaceUtilization();<a name="line.105"></a>
-<span class="sourceLineNo">106</span>      if (namespaceUsages != null &amp;&amp; !namespaceUsages.isEmpty()) {<a name="line.106"></a>
-<span class="sourceLineNo">107</span>        nsSummary = generateJsonQuotaSummary(namespaceUsages.entrySet(), "namespace");<a name="line.107"></a>
-<span class="sourceLineNo">108</span>      }<a name="line.108"></a>
-<span class="sourceLineNo">109</span>      record.tag(Interns.info(NS_QUOTA_USAGE_NAME, NS_QUOTA_USAGE_DESC), nsSummary);<a name="line.109"></a>
-<span class="sourceLineNo">110</span>    }<a name="line.110"></a>
-<span class="sourceLineNo">111</span>    metricsRegistry.snapshot(record, all);<a name="line.111"></a>
-<span class="sourceLineNo">112</span>  }<a name="line.112"></a>
-<span class="sourceLineNo">113</span><a name="line.113"></a>
-<span class="sourceLineNo">114</span>  /**<a name="line.114"></a>
-<span class="sourceLineNo">115</span>   * Summarizes the usage and limit for many targets (table or namespace) into JSON.<a name="line.115"></a>
-<span class="sourceLineNo">116</span>   */<a name="line.116"></a>
-<span class="sourceLineNo">117</span>  private String generateJsonQuotaSummary(<a name="line.117"></a>
-<span class="sourceLineNo">118</span>      Iterable&lt;Entry&lt;String,Entry&lt;Long,Long&gt;&gt;&gt; data, String target) {<a name="line.118"></a>
-<span class="sourceLineNo">119</span>    StringBuilder sb = new StringBuilder();<a name="line.119"></a>
-<span class="sourceLineNo">120</span>    for (Entry&lt;String,Entry&lt;Long,Long&gt;&gt; tableUsage : data) {<a name="line.120"></a>
-<span class="sourceLineNo">121</span>      String tableName = tableUsage.getKey();<a name="line.121"></a>
-<span class="sourceLineNo">122</span>      long usage = tableUsage.getValue().getKey();<a name="line.122"></a>
-<span class="sourceLineNo">123</span>      long limit = tableUsage.getValue().getValue();<a name="line.123"></a>
-<span class="sourceLineNo">124</span>      if (sb.length() &gt; 0) {<a name="line.124"></a>
-<span class="sourceLineNo">125</span>        sb.append(", ");<a name="line.125"></a>
-<span class="sourceLineNo">126</span>      }<a name="line.126"></a>
-<span class="sourceLineNo">127</span>      sb.append("{").append(target).append("=").append(tableName).append(", usage=").append(usage)<a name="line.127"></a>
-<span class="sourceLineNo">128</span>          .append(", limit=").append(limit).append("}");<a name="line.128"></a>
-<span class="sourceLineNo">129</span>    }<a name="line.129"></a>
-<span class="sourceLineNo">130</span>    sb.insert(0, "[").append("]");<a name="line.130"></a>
-<span class="sourceLineNo">131</span>    return sb.toString();<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">092</span>  public void updateNumCurrentSpaceQuotaRegionSizeReports(long numCurrentRegionSizeReports) {<a name="line.92"></a>
+<span class="sourceLineNo">093</span>    regionSpaceReportsGauge.set(numCurrentRegionSizeReports);<a name="line.93"></a>
+<span class="sourceLineNo">094</span>  }<a name="line.94"></a>
+<span class="sourceLineNo">095</span><a name="line.95"></a>
+<span class="sourceLineNo">096</span>  @Override<a name="line.96"></a>
+<span class="sourceLineNo">097</span>  public void incrementSpaceQuotaObserverChoreTime(long time) {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    quotaObserverTimeHisto.add(time);<a name="line.98"></a>
+<span class="sourceLineNo">099</span>  }<a name="line.99"></a>
+<span class="sourceLineNo">100</span><a name="line.100"></a>
+<span class="sourceLineNo">101</span>  @Override<a name="line.101"></a>
+<span class="sourceLineNo">102</span>  public void incrementSnapshotObserverChoreTime(long time) {<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    snapshotObserverTimeHisto.add(time);<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>  @Override<a name="line.106"></a>
+<span class="sourceLineNo">107</span>  public void getMetrics(MetricsCollector metricsCollector, boolean all) {<a name="line.107"></a>
+<span class="sourceLineNo">108</span>    MetricsRecordBuilder record = metricsCollector.addRecord(metricsRegistry.info());<a name="line.108"></a>
+<span class="sourceLineNo">109</span>    if (wrapper != null) {<a name="line.109"></a>
+<span class="sourceLineNo">110</span>      // Summarize the tables<a name="line.110"></a>
+<span class="sourceLineNo">111</span>      Map&lt;String,Entry&lt;Long,Long&gt;&gt; tableUsages = wrapper.getTableSpaceUtilization();<a name="line.111"></a>
+<span class="sourceLineNo">112</span>      String tableSummary = "[]";<a name="line.112"></a>
+<span class="sourceLineNo">113</span>      if (tableUsages != null &amp;&amp; !tableUsages.isEmpty()) {<a name="line.113"></a>
+<span class="sourceLineNo">114</span>        tableSummary = generateJsonQuotaSummary(tableUsages.entrySet(), "table");<a name="line.114"></a>
+<span class="sourceLineNo">115</span>      }<a name="line.115"></a>
+<span class="sourceLineNo">116</span>      record.tag(Interns.info(TABLE_QUOTA_USAGE_NAME, TABLE_QUOTA_USAGE_DESC), tableSummary);<a name="line.116"></a>
+<span class="sourceLineNo">117</span><a name="line.117"></a>
+<span class="sourceLineNo">118</span>      // Summarize the namespaces<a name="line.118"></a>
+<span class="sourceLineNo">119</span>      String nsSummary = "[]";<a name="line.119"></a>
+<span class="sourceLineNo">120</span>      Map&lt;String,Entry&lt;Long,Long&gt;&gt; namespaceUsages = wrapper.getNamespaceSpaceUtilization();<a name="line.120"></a>
+<span class="sourceLineNo">121</span>      if (namespaceUsages != null &amp;&amp; !namespaceUsages.isEmpty()) {<a name="line.121"></a>
+<span class="sourceLineNo">122</span>        nsSummary = generateJsonQuotaSummary(namespaceUsages.entrySet(), "namespace");<a name="line.122"></a>
+<span class="sourceLineNo">123</span>      }<a name="line.123"></a>
+<span class="sourceLineNo">124</span>      record.tag(Interns.info(NS_QUOTA_USAGE_NAME, NS_QUOTA_USAGE_DESC), nsSummary);<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    }<a name="line.125"></a>
+<span class="sourceLineNo">126</span>    metricsRegistry.snapshot(record, all);<a name="line.126"></a>
+<span class="sourceLineNo">127</span>  }<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>   * Summarizes the usage and limit for many targets (table or namespace) into JSON.<a name="line.130"></a>
+<span class="sourceLineNo">131</span>   */<a name="line.131"></a>
+<span class="sourceLineNo">132</span>  private String generateJsonQuotaSummary(<a name="line.132"></a>
+<span class="sourceLineNo">133</span>      Iterable&lt;Entry&lt;String,Entry&lt;Long,Long&gt;&gt;&gt; data, String target) {<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    StringBuilder sb = new StringBuilder();<a name="line.134"></a>
+<span class="sourceLineNo">135</span>    for (Entry&lt;String,Entry&lt;Long,Long&gt;&gt; tableUsage : data) {<a name="line.135"></a>
+<span class="sourceLineNo">136</span>      String tableName = tableUsage.getKey();<a name="line.136"></a>
+<span class="sourceLineNo">137</span>      long usage = tableUsage.getValue().getKey();<a name="line.137"></a>
+<span class="sourceLineNo">138</span>      long limit = tableUsage.getValue().getValue();<a name="line.138"></a>
+<span class="sourceLineNo">139</span>      if (sb.length() &gt; 0) {<a name="line.139"></a>
+<span class="sourceLineNo">140</span>        sb.append(", ");<a name="line.140"></a>
+<span class="sourceLineNo">141</span>      }<a name="line.141"></a>
+<span class="sourceLineNo">142</span>      sb.append("{").append(target).append("=").append(tableName).append(", usage=").append(usage)<a name="line.142"></a>
+<span class="sourceLineNo">143</span>          .append(", limit=").append(limit).append("}");<a name="line.143"></a>
+<span class="sourceLineNo">144</span>    }<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    sb.insert(0, "[").append("]");<a name="line.145"></a>
+<span class="sourceLineNo">146</span>    return sb.toString();<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>  @Override<a name="line.149"></a>
+<span class="sourceLineNo">150</span>  public void incrementSnapshotObserverSnapshotComputationTime(long time) {<a name="line.150"></a>
+<span class="sourceLineNo">151</span>    snapshotObserverSizeComputationTimeHisto.add(time);<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>  @Override<a name="line.154"></a>
+<span class="sourceLineNo">155</span>  public void incrementSnapshotObserverSnapshotFetchTime(long time) {<a name="line.155"></a>
+<span class="sourceLineNo">156</span>    snapshotObserverSnapshotFetchTimeHisto.add(time);<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>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/476c54ed/devapidocs/src-html/org/apache/hadoop/hbase/quotas/FileSystemUtilizationChore.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/quotas/FileSystemUtilizationChore.html b/devapidocs/src-html/org/apache/hadoop/hbase/quotas/FileSystemUtilizationChore.html
index 3a8d214..5c3bcd9 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/quotas/FileSystemUtilizationChore.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/quotas/FileSystemUtilizationChore.html
@@ -41,192 +41,195 @@
 <span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.regionserver.HRegionServer;<a name="line.33"></a>
 <span class="sourceLineNo">034</span>import org.apache.hadoop.hbase.regionserver.Region;<a name="line.34"></a>
 <span class="sourceLineNo">035</span>import org.apache.hadoop.hbase.regionserver.Store;<a name="line.35"></a>
-<span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.36"></a>
-<span class="sourceLineNo">037</span><a name="line.37"></a>
-<span class="sourceLineNo">038</span>/**<a name="line.38"></a>
-<span class="sourceLineNo">039</span> * A chore which computes the size of each {@link HRegion} on the FileSystem hosted by the given {@link HRegionServer}.<a name="line.39"></a>
-<span class="sourceLineNo">040</span> */<a name="line.40"></a>
-<span class="sourceLineNo">041</span>@InterfaceAudience.Private<a name="line.41"></a>
-<span class="sourceLineNo">042</span>public class FileSystemUtilizationChore extends ScheduledChore {<a name="line.42"></a>
-<span class="sourceLineNo">043</span>  private static final Log LOG = LogFactory.getLog(FileSystemUtilizationChore.class);<a name="line.43"></a>
-<span class="sourceLineNo">044</span>  static final String FS_UTILIZATION_CHORE_PERIOD_KEY = "hbase.regionserver.quotas.fs.utilization.chore.period";<a name="line.44"></a>
-<span class="sourceLineNo">045</span>  static final int FS_UTILIZATION_CHORE_PERIOD_DEFAULT = 1000 * 60 * 5; // 5 minutes in millis<a name="line.45"></a>
-<span class="sourceLineNo">046</span><a name="line.46"></a>
-<span class="sourceLineNo">047</span>  static final String FS_UTILIZATION_CHORE_DELAY_KEY = "hbase.regionserver.quotas.fs.utilization.chore.delay";<a name="line.47"></a>
-<span class="sourceLineNo">048</span>  static final long FS_UTILIZATION_CHORE_DELAY_DEFAULT = 1000L * 60L; // 1 minute<a name="line.48"></a>
-<span class="sourceLineNo">049</span><a name="line.49"></a>
-<span class="sourceLineNo">050</span>  static final String FS_UTILIZATION_CHORE_TIMEUNIT_KEY = "hbase.regionserver.quotas.fs.utilization.chore.timeunit";<a name="line.50"></a>
-<span class="sourceLineNo">051</span>  static final String FS_UTILIZATION_CHORE_TIMEUNIT_DEFAULT = TimeUnit.MILLISECONDS.name();<a name="line.51"></a>
-<span class="sourceLineNo">052</span><a name="line.52"></a>
-<span class="sourceLineNo">053</span>  static final String FS_UTILIZATION_MAX_ITERATION_DURATION_KEY = "hbase.regionserver.quotas.fs.utilization.chore.max.iteration.millis";<a name="line.53"></a>
-<span class="sourceLineNo">054</span>  static final long FS_UTILIZATION_MAX_ITERATION_DURATION_DEFAULT = 5000L;<a name="line.54"></a>
-<span class="sourceLineNo">055</span><a name="line.55"></a>
-<span class="sourceLineNo">056</span>  private int numberOfCyclesToSkip = 0, prevNumberOfCyclesToSkip = 0;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>  private static final int CYCLE_UPPER_BOUND = 32;<a name="line.57"></a>
-<span class="sourceLineNo">058</span><a name="line.58"></a>
-<span class="sourceLineNo">059</span>  private final HRegionServer rs;<a name="line.59"></a>
-<span class="sourceLineNo">060</span>  private final long maxIterationMillis;<a name="line.60"></a>
-<span class="sourceLineNo">061</span>  private Iterator&lt;Region&gt; leftoverRegions;<a name="line.61"></a>
-<span class="sourceLineNo">062</span><a name="line.62"></a>
-<span class="sourceLineNo">063</span>  public FileSystemUtilizationChore(HRegionServer rs) {<a name="line.63"></a>
-<span class="sourceLineNo">064</span>    super(FileSystemUtilizationChore.class.getSimpleName(), rs, getPeriod(rs.getConfiguration()),<a name="line.64"></a>
-<span class="sourceLineNo">065</span>        getInitialDelay(rs.getConfiguration()), getTimeUnit(rs.getConfiguration()));<a name="line.65"></a>
-<span class="sourceLineNo">066</span>    this.rs = rs;<a name="line.66"></a>
-<span class="sourceLineNo">067</span>    this.maxIterationMillis = rs.getConfiguration().getLong(<a name="line.67"></a>
-<span class="sourceLineNo">068</span>        FS_UTILIZATION_MAX_ITERATION_DURATION_KEY, FS_UTILIZATION_MAX_ITERATION_DURATION_DEFAULT);<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>  @Override<a name="line.71"></a>
-<span class="sourceLineNo">072</span>  protected void chore() {<a name="line.72"></a>
-<span class="sourceLineNo">073</span>    if (numberOfCyclesToSkip &gt; 0) {<a name="line.73"></a>
-<span class="sourceLineNo">074</span>      numberOfCyclesToSkip--;<a name="line.74"></a>
-<span class="sourceLineNo">075</span>      return;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>    }<a name="line.76"></a>
-<span class="sourceLineNo">077</span>    final Map&lt;HRegionInfo,Long&gt; onlineRegionSizes = new HashMap&lt;&gt;();<a name="line.77"></a>
-<span class="sourceLineNo">078</span>    final Set&lt;Region&gt; onlineRegions = new HashSet&lt;&gt;(rs.getOnlineRegions());<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    // Process the regions from the last run if we have any. If we are somehow having difficulty<a name="line.79"></a>
-<span class="sourceLineNo">080</span>    // processing the Regions, we want to avoid creating a backlog in memory of Region objs.<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    Iterator&lt;Region&gt; oldRegionsToProcess = getLeftoverRegions();<a name="line.81"></a>
-<span class="sourceLineNo">082</span>    final Iterator&lt;Region&gt; iterator;<a name="line.82"></a>
-<span class="sourceLineNo">083</span>    final boolean processingLeftovers;<a name="line.83"></a>
-<span class="sourceLineNo">084</span>    if (oldRegionsToProcess == null) {<a name="line.84"></a>
-<span class="sourceLineNo">085</span>      iterator = onlineRegions.iterator();<a name="line.85"></a>
-<span class="sourceLineNo">086</span>      processingLeftovers = false;<a name="line.86"></a>
-<span class="sourceLineNo">087</span>    } else {<a name="line.87"></a>
-<span class="sourceLineNo">088</span>      iterator = oldRegionsToProcess;<a name="line.88"></a>
-<span class="sourceLineNo">089</span>      processingLeftovers = true;<a name="line.89"></a>
-<span class="sourceLineNo">090</span>    }<a name="line.90"></a>
-<span class="sourceLineNo">091</span>    // Reset the leftoverRegions and let the loop re-assign if necessary.<a name="line.91"></a>
-<span class="sourceLineNo">092</span>    setLeftoverRegions(null);<a name="line.92"></a>
-<span class="sourceLineNo">093</span>    long regionSizesCalculated = 0L;<a name="line.93"></a>
-<span class="sourceLineNo">094</span>    long offlineRegionsSkipped = 0L;<a name="line.94"></a>
-<span class="sourceLineNo">095</span>    long skippedSplitParents = 0L;<a name="line.95"></a>
-<span class="sourceLineNo">096</span>    long skippedRegionReplicas = 0L;<a name="line.96"></a>
-<span class="sourceLineNo">097</span>    final long start = EnvironmentEdgeManager.currentTime();<a name="line.97"></a>
-<span class="sourceLineNo">098</span>    while (iterator.hasNext()) {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>      // Make sure this chore doesn't hog the thread.<a name="line.99"></a>
-<span class="sourceLineNo">100</span>      long timeRunning = EnvironmentEdgeManager.currentTime() - start;<a name="line.100"></a>
-<span class="sourceLineNo">101</span>      if (timeRunning &gt; maxIterationMillis) {<a name="line.101"></a>
-<span class="sourceLineNo">102</span>        LOG.debug("Preempting execution of FileSystemUtilizationChore because it exceeds the"<a name="line.102"></a>
-<span class="sourceLineNo">103</span>            + " maximum iteration configuration value. Will process remaining iterators"<a name="line.103"></a>
-<span class="sourceLineNo">104</span>            + " on a subsequent invocation.");<a name="line.104"></a>
-<span class="sourceLineNo">105</span>        setLeftoverRegions(iterator);<a name="line.105"></a>
-<span class="sourceLineNo">106</span>        break;<a name="line.106"></a>
-<span class="sourceLineNo">107</span>      }<a name="line.107"></a>
-<span class="sourceLineNo">108</span><a name="line.108"></a>
-<span class="sourceLineNo">109</span>      final Region region = iterator.next();<a name="line.109"></a>
-<span class="sourceLineNo">110</span>      // If we're processing leftover regions, the region may no-longer be online.<a name="line.110"></a>
-<span class="sourceLineNo">111</span>      // If so, we can skip it.<a name="line.111"></a>
-<span class="sourceLineNo">112</span>      if (processingLeftovers &amp;&amp; !onlineRegions.contains(region)) {<a name="line.112"></a>
-<span class="sourceLineNo">113</span>        offlineRegionsSkipped++;<a name="line.113"></a>
-<span class="sourceLineNo">114</span>        continue;<a name="line.114"></a>
-<span class="sourceLineNo">115</span>      }<a name="line.115"></a>
-<span class="sourceLineNo">116</span>      // Avoid computing the size of regions which are the parent of split.<a name="line.116"></a>
-<span class="sourceLineNo">117</span>      if (region.getRegionInfo().isSplitParent()) {<a name="line.117"></a>
-<span class="sourceLineNo">118</span>        skippedSplitParents++;<a name="line.118"></a>
-<span class="sourceLineNo">119</span>        continue;<a name="line.119"></a>
-<span class="sourceLineNo">120</span>      }<a name="line.120"></a>
-<span class="sourceLineNo">121</span>      // Avoid computing the size of region replicas.<a name="line.121"></a>
-<span class="sourceLineNo">122</span>      if (HRegionInfo.DEFAULT_REPLICA_ID != region.getRegionInfo().getReplicaId()) {<a name="line.122"></a>
-<span class="sourceLineNo">123</span>        skippedRegionReplicas++;<a name="line.123"></a>
-<span class="sourceLineNo">124</span>        continue;<a name="line.124"></a>
-<span class="sourceLineNo">125</span>      }<a name="line.125"></a>
-<span class="sourceLineNo">126</span>      final long sizeInBytes = computeSize(region);<a name="line.126"></a>
-<span class="sourceLineNo">127</span>      onlineRegionSizes.put(region.getRegionInfo(), sizeInBytes);<a name="line.127"></a>
-<span class="sourceLineNo">128</span>      regionSizesCalculated++;<a name="line.128"></a>
-<span class="sourceLineNo">129</span>    }<a name="line.129"></a>
-<span class="sourceLineNo">130</span>    if (LOG.isTraceEnabled()) {<a name="line.130"></a>
-<span class="sourceLineNo">131</span>      LOG.trace("Computed the size of " + regionSizesCalculated + " Regions. Skipped computation"<a name="line.131"></a>
-<span class="sourceLineNo">132</span>          + " of " + offlineRegionsSkipped + " regions due to not being online on this RS, "<a name="line.132"></a>
-<span class="sourceLineNo">133</span>          + skippedSplitParents + " regions due to being the parent of a split, and"<a name="line.133"></a>
-<span class="sourceLineNo">134</span>          + skippedRegionReplicas + " regions due to being region replicas.");<a name="line.134"></a>
-<span class="sourceLineNo">135</span>    }<a name="line.135"></a>
-<span class="sourceLineNo">136</span>    if (!reportRegionSizesToMaster(onlineRegionSizes)) {<a name="line.136"></a>
-<span class="sourceLineNo">137</span>      // backoff reporting<a name="line.137"></a>
-<span class="sourceLineNo">138</span>      numberOfCyclesToSkip = prevNumberOfCyclesToSkip &gt; 0 ? 2 * prevNumberOfCyclesToSkip : 1;<a name="line.138"></a>
-<span class="sourceLineNo">139</span>      if (numberOfCyclesToSkip &gt; CYCLE_UPPER_BOUND) {<a name="line.139"></a>
-<span class="sourceLineNo">140</span>        numberOfCyclesToSkip = CYCLE_UPPER_BOUND;<a name="line.140"></a>
-<span class="sourceLineNo">141</span>      }<a name="line.141"></a>
-<span class="sourceLineNo">142</span>      prevNumberOfCyclesToSkip = numberOfCyclesToSkip;<a name="line.142"></a>
-<span class="sourceLineNo">143</span>    }<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>  /**<a name="line.146"></a>
-<span class="sourceLineNo">147</span>   * Returns an {@link Iterator} over the Regions which were skipped last invocation of the chore.<a name="line.147"></a>
-<span class="sourceLineNo">148</span>   *<a name="line.148"></a>
-<span class="sourceLineNo">149</span>   * @return Regions from the previous invocation to process, or null.<a name="line.149"></a>
-<span class="sourceLineNo">150</span>   */<a name="line.150"></a>
-<span class="sourceLineNo">151</span>  Iterator&lt;Region&gt; getLeftoverRegions() {<a name="line.151"></a>
-<span class="sourceLineNo">152</span>    return leftoverRegions;<a name="line.152"></a>
-<span class="sourceLineNo">153</span>  }<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>   * Sets a new collection of Regions as leftovers.<a name="line.156"></a>
-<span class="sourceLineNo">157</span>   */<a name="line.157"></a>
-<span class="sourceLineNo">158</span>  void setLeftoverRegions(Iterator&lt;Region&gt; newLeftovers) {<a name="line.158"></a>
-<span class="sourceLineNo">159</span>    this.leftoverRegions = newLeftovers;<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>  /**<a name="line.162"></a>
-<span class="sourceLineNo">163</span>   * Computes total FileSystem size for the given {@link Region}.<a name="line.163"></a>
-<span class="sourceLineNo">164</span>   *<a name="line.164"></a>
-<span class="sourceLineNo">165</span>   * @param r The region<a name="line.165"></a>
-<span class="sourceLineNo">166</span>   * @return The size, in bytes, of the Region.<a name="line.166"></a>
-<span class="sourceLineNo">167</span>   */<a name="line.167"></a>
-<span class="sourceLineNo">168</span>  long computeSize(Region r) {<a name="line.168"></a>
-<span class="sourceLineNo">169</span>    long regionSize = 0L;<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    for (Store store : r.getStores()) {<a name="line.170"></a>
-<span class="sourceLineNo">171</span>      // StoreFile/StoreFileReaders are already instantiated with the file length cached.<a name="line.171"></a>
-<span class="sourceLineNo">172</span>      // Can avoid extra NN ops.<a name="line.172"></a>
-<span class="sourceLineNo">173</span>      regionSize += store.getStorefilesSize();<a name="line.173"></a>
+<span class="sourceLineNo">036</span>import org.apache.hadoop.hbase.regionserver.StoreFile;<a name="line.36"></a>
+<span class="sourceLineNo">037</span>import org.apache.hadoop.hbase.regionserver.StoreFileReader;<a name="line.37"></a>
+<span class="sourceLineNo">038</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a name="line.38"></a>
+<span class="sourceLineNo">039</span><a name="line.39"></a>
+<span class="sourceLineNo">040</span>/**<a name="line.40"></a>
+<span class="sourceLineNo">041</span> * A chore which computes the size of each {@link HRegion} on the FileSystem hosted by the given {@link HRegionServer}.<a name="line.41"></a>
+<span class="sourceLineNo">042</span> */<a name="line.42"></a>
+<span class="sourceLineNo">043</span>@InterfaceAudience.Private<a name="line.43"></a>
+<span class="sourceLineNo">044</span>public class FileSystemUtilizationChore extends ScheduledChore {<a name="line.44"></a>
+<span class="sourceLineNo">045</span>  private static final Log LOG = LogFactory.getLog(FileSystemUtilizationChore.class);<a name="line.45"></a>
+<span class="sourceLineNo">046</span>  static final String FS_UTILIZATION_CHORE_PERIOD_KEY = "hbase.regionserver.quotas.fs.utilization.chore.period";<a name="line.46"></a>
+<span class="sourceLineNo">047</span>  static final int FS_UTILIZATION_CHORE_PERIOD_DEFAULT = 1000 * 60 * 5; // 5 minutes in millis<a name="line.47"></a>
+<span class="sourceLineNo">048</span><a name="line.48"></a>
+<span class="sourceLineNo">049</span>  static final String FS_UTILIZATION_CHORE_DELAY_KEY = "hbase.regionserver.quotas.fs.utilization.chore.delay";<a name="line.49"></a>
+<span class="sourceLineNo">050</span>  static final long FS_UTILIZATION_CHORE_DELAY_DEFAULT = 1000L * 60L; // 1 minute<a name="line.50"></a>
+<span class="sourceLineNo">051</span><a name="line.51"></a>
+<span class="sourceLineNo">052</span>  static final String FS_UTILIZATION_CHORE_TIMEUNIT_KEY = "hbase.regionserver.quotas.fs.utilization.chore.timeunit";<a name="line.52"></a>
+<span class="sourceLineNo">053</span>  static final String FS_UTILIZATION_CHORE_TIMEUNIT_DEFAULT = TimeUnit.MILLISECONDS.name();<a name="line.53"></a>
+<span class="sourceLineNo">054</span><a name="line.54"></a>
+<span class="sourceLineNo">055</span>  static final String FS_UTILIZATION_MAX_ITERATION_DURATION_KEY = "hbase.regionserver.quotas.fs.utilization.chore.max.iteration.millis";<a name="line.55"></a>
+<span class="sourceLineNo">056</span>  static final long FS_UTILIZATION_MAX_ITERATION_DURATION_DEFAULT = 5000L;<a name="line.56"></a>
+<span class="sourceLineNo">057</span><a name="line.57"></a>
+<span class="sourceLineNo">058</span>  private int numberOfCyclesToSkip = 0, prevNumberOfCyclesToSkip = 0;<a name="line.58"></a>
+<span class="sourceLineNo">059</span>  private static final int CYCLE_UPPER_BOUND = 32;<a name="line.59"></a>
+<span class="sourceLineNo">060</span><a name="line.60"></a>
+<span class="sourceLineNo">061</span>  private final HRegionServer rs;<a name="line.61"></a>
+<span class="sourceLineNo">062</span>  private final long maxIterationMillis;<a name="line.62"></a>
+<span class="sourceLineNo">063</span>  private Iterator&lt;Region&gt; leftoverRegions;<a name="line.63"></a>
+<span class="sourceLineNo">064</span><a name="line.64"></a>
+<span class="sourceLineNo">065</span>  public FileSystemUtilizationChore(HRegionServer rs) {<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    super(FileSystemUtilizationChore.class.getSimpleName(), rs, getPeriod(rs.getConfiguration()),<a name="line.66"></a>
+<span class="sourceLineNo">067</span>        getInitialDelay(rs.getConfiguration()), getTimeUnit(rs.getConfiguration()));<a name="line.67"></a>
+<span class="sourceLineNo">068</span>    this.rs = rs;<a name="line.68"></a>
+<span class="sourceLineNo">069</span>    this.maxIterationMillis = rs.getConfiguration().getLong(<a name="line.69"></a>
+<span class="sourceLineNo">070</span>        FS_UTILIZATION_MAX_ITERATION_DURATION_KEY, FS_UTILIZATION_MAX_ITERATION_DURATION_DEFAULT);<a name="line.70"></a>
+<span class="sourceLineNo">071</span>  }<a name="line.71"></a>
+<span class="sourceLineNo">072</span><a name="line.72"></a>
+<span class="sourceLineNo">073</span>  @Override<a name="line.73"></a>
+<span class="sourceLineNo">074</span>  protected void chore() {<a name="line.74"></a>
+<span class="sourceLineNo">075</span>    if (numberOfCyclesToSkip &gt; 0) {<a name="line.75"></a>
+<span class="sourceLineNo">076</span>      numberOfCyclesToSkip--;<a name="line.76"></a>
+<span class="sourceLineNo">077</span>      return;<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    }<a name="line.78"></a>
+<span class="sourceLineNo">079</span>    final Map&lt;HRegionInfo,Long&gt; onlineRegionSizes = new HashMap&lt;&gt;();<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    final Set&lt;Region&gt; onlineRegions = new HashSet&lt;&gt;(rs.getOnlineRegions());<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    // Process the regions from the last run if we have any. If we are somehow having difficulty<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    // processing the Regions, we want to avoid creating a backlog in memory of Region objs.<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    Iterator&lt;Region&gt; oldRegionsToProcess = getLeftoverRegions();<a name="line.83"></a>
+<span class="sourceLineNo">084</span>    final Iterator&lt;Region&gt; iterator;<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    final boolean processingLeftovers;<a name="line.85"></a>
+<span class="sourceLineNo">086</span>    if (oldRegionsToProcess == null) {<a name="line.86"></a>
+<span class="sourceLineNo">087</span>      iterator = onlineRegions.iterator();<a name="line.87"></a>
+<span class="sourceLineNo">088</span>      processingLeftovers = false;<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    } else {<a name="line.89"></a>
+<span class="sourceLineNo">090</span>      iterator = oldRegionsToProcess;<a name="line.90"></a>
+<span class="sourceLineNo">091</span>      processingLeftovers = true;<a name="line.91"></a>
+<span class="sourceLineNo">092</span>    }<a name="line.92"></a>
+<span class="sourceLineNo">093</span>    // Reset the leftoverRegions and let the loop re-assign if necessary.<a name="line.93"></a>
+<span class="sourceLineNo">094</span>    setLeftoverRegions(null);<a name="line.94"></a>
+<span class="sourceLineNo">095</span>    long regionSizesCalculated = 0L;<a name="line.95"></a>
+<span class="sourceLineNo">096</span>    long offlineRegionsSkipped = 0L;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    long skippedSplitParents = 0L;<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    long skippedRegionReplicas = 0L;<a name="line.98"></a>
+<span class="sourceLineNo">099</span>    final long start = EnvironmentEdgeManager.currentTime();<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    while (iterator.hasNext()) {<a name="line.100"></a>
+<span class="sourceLineNo">101</span>      // Make sure this chore doesn't hog the thread.<a name="line.101"></a>
+<span class="sourceLineNo">102</span>      long timeRunning = EnvironmentEdgeManager.currentTime() - start;<a name="line.102"></a>
+<span class="sourceLineNo">103</span>      if (timeRunning &gt; maxIterationMillis) {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>        LOG.debug("Preempting execution of FileSystemUtilizationChore because it exceeds the"<a name="line.104"></a>
+<span class="sourceLineNo">105</span>            + " maximum iteration configuration value. Will process remaining iterators"<a name="line.105"></a>
+<span class="sourceLineNo">106</span>            + " on a subsequent invocation.");<a name="line.106"></a>
+<span class="sourceLineNo">107</span>        setLeftoverRegions(iterator);<a name="line.107"></a>
+<span class="sourceLineNo">108</span>        break;<a name="line.108"></a>
+<span class="sourceLineNo">109</span>      }<a name="line.109"></a>
+<span class="sourceLineNo">110</span><a name="line.110"></a>
+<span class="sourceLineNo">111</span>      final Region region = iterator.next();<a name="line.111"></a>
+<span class="sourceLineNo">112</span>      // If we're processing leftover regions, the region may no-longer be online.<a name="line.112"></a>
+<span class="sourceLineNo">113</span>      // If so, we can skip it.<a name="line.113"></a>
+<span class="sourceLineNo">114</span>      if (processingLeftovers &amp;&amp; !onlineRegions.contains(region)) {<a name="line.114"></a>
+<span class="sourceLineNo">115</span>        offlineRegionsSkipped++;<a name="line.115"></a>
+<span class="sourceLineNo">116</span>        continue;<a name="line.116"></a>
+<span class="sourceLineNo">117</span>      }<a name="line.117"></a>
+<span class="sourceLineNo">118</span>      // Avoid computing the size of regions which are the parent of split.<a name="line.118"></a>
+<span class="sourceLineNo">119</span>      if (region.getRegionInfo().isSplitParent()) {<a name="line.119"></a>
+<span class="sourceLineNo">120</span>        skippedSplitParents++;<a name="line.120"></a>
+<span class="sourceLineNo">121</span>        continue;<a name="line.121"></a>
+<span class="sourceLineNo">122</span>      }<a name="line.122"></a>
+<span class="sourceLineNo">123</span>      // Avoid computing the size of region replicas.<a name="line.123"></a>
+<span class="sourceLineNo">124</span>      if (HRegionInfo.DEFAULT_REPLICA_ID != region.getRegionInfo().getReplicaId()) {<a name="line.124"></a>
+<span class="sourceLineNo">125</span>        skippedRegionReplicas++;<a name="line.125"></a>
+<span class="sourceLineNo">126</span>        continue;<a name="line.126"></a>
+<span class="sourceLineNo">127</span>      }<a name="line.127"></a>
+<span class="sourceLineNo">128</span>      final long sizeInBytes = computeSize(region);<a name="line.128"></a>
+<span class="sourceLineNo">129</span>      onlineRegionSizes.put(region.getRegionInfo(), sizeInBytes);<a name="line.129"></a>
+<span class="sourceLineNo">130</span>      regionSizesCalculated++;<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    }<a name="line.131"></a>
+<span class="sourceLineNo">132</span>    if (LOG.isTraceEnabled()) {<a name="line.132"></a>
+<span class="sourceLineNo">133</span>      LOG.trace("Computed the size of " + regionSizesCalculated + " Regions. Skipped computation"<a name="line.133"></a>
+<span class="sourceLineNo">134</span>          + " of " + offlineRegionsSkipped + " regions due to not being online on this RS, "<a name="line.134"></a>
+<span class="sourceLineNo">135</span>          + skippedSplitParents + " regions due to being the parent of a split, and"<a name="line.135"></a>
+<span class="sourceLineNo">136</span>          + skippedRegionReplicas + " regions due to being region replicas.");<a name="line.136"></a>
+<span class="sourceLineNo">137</span>    }<a name="line.137"></a>
+<span class="sourceLineNo">138</span>    if (!reportRegionSizesToMaster(onlineRegionSizes)) {<a name="line.138"></a>
+<span class="sourceLineNo">139</span>      // backoff reporting<a name="line.139"></a>
+<span class="sourceLineNo">140</span>      numberOfCyclesToSkip = prevNumberOfCyclesToSkip &gt; 0 ? 2 * prevNumberOfCyclesToSkip : 1;<a name="line.140"></a>
+<span class="sourceLineNo">141</span>      if (numberOfCyclesToSkip &gt; CYCLE_UPPER_BOUND) {<a name="line.141"></a>
+<span class="sourceLineNo">142</span>        numberOfCyclesToSkip = CYCLE_UPPER_BOUND;<a name="line.142"></a>
+<span class="sourceLineNo">143</span>      }<a name="line.143"></a>
+<span class="sourceLineNo">144</span>      prevNumberOfCyclesToSkip = numberOfCyclesToSkip;<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    }<a name="line.145"></a>
+<span class="sourceLineNo">146</span>  }<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>   * Returns an {@link Iterator} over the Regions which were skipped last invocation of the chore.<a name="line.149"></a>
+<span class="sourceLineNo">150</span>   *<a name="line.150"></a>
+<span class="sourceLineNo">151</span>   * @return Regions from the previous invocation to process, or null.<a name="line.151"></a>
+<span class="sourceLineNo">152</span>   */<a name="line.152"></a>
+<span class="sourceLineNo">153</span>  Iterator&lt;Region&gt; getLeftoverRegions() {<a name="line.153"></a>
+<span class="sourceLineNo">154</span>    return leftoverRegions;<a name="line.154"></a>
+<span class="sourceLineNo">155</span>  }<a name="line.155"></a>
+<span class="sourceLineNo">156</span><a name="line.156"></a>
+<span class="sourceLineNo">157</span>  /**<a name="line.157"></a>
+<span class="sourceLineNo">158</span>   * Sets a new collection of Regions as leftovers.<a name="line.158"></a>
+<span class="sourceLineNo">159</span>   */<a name="line.159"></a>
+<span class="sourceLineNo">160</span>  void setLeftoverRegions(Iterator&lt;Region&gt; newLeftovers) {<a name="line.160"></a>
+<span class="sourceLineNo">161</span>    this.leftoverRegions = newLeftovers;<a name="line.161"></a>
+<span class="sourceLineNo">162</span>  }<a name="line.162"></a>
+<span class="sourceLineNo">163</span><a name="line.163"></a>
+<span class="sourceLineNo">164</span>  /**<a name="line.164"></a>
+<span class="sourceLineNo">165</span>   * Computes total FileSystem size for the given {@link Region}.<a name="line.165"></a>
+<span class="sourceLineNo">166</span>   *<a name="line.166"></a>
+<span class="sourceLineNo">167</span>   * @param r The region<a name="line.167"></a>
+<span class="sourceLineNo">168</span>   * @return The size, in bytes, of the Region.<a name="line.168"></a>
+<span class="sourceLineNo">169</span>   */<a name="line.169"></a>
+<span class="sourceLineNo">170</span>  long computeSize(Region r) {<a name="line.170"></a>
+<span class="sourceLineNo">171</span>    long regionSize = 0L;<a name="line.171"></a>
+<span class="sourceLineNo">172</span>    for (Store store : r.getStores()) {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>      regionSize += store.getHFilesSize();<a name="line.173"></a>
 <span class="sourceLineNo">174</span>    }<a name="line.174"></a>
-<span class="sourceLineNo">175</span>    return regionSize;<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>
-<span class="sourceLineNo">178</span>  /**<a name="line.178"></a>
-<span class="sourceLineNo">179</span>   * Reports the computed region sizes to the currently active Master.<a name="line.179"></a>
-<span class="sourceLineNo">180</span>   *<a name="line.180"></a>
-<span class="sourceLineNo">181</span>   * @param onlineRegionSizes The computed region sizes to report.<a name="line.181"></a>
-<span class="sourceLineNo">182</span>   * @return {@code false} if FileSystemUtilizationChore should pause reporting to master,<a name="line.182"></a>
-<span class="sourceLineNo">183</span>   *    {@code true} otherwise.<a name="line.183"></a>
-<span class="sourceLineNo">184</span>   */<a name="line.184"></a>
-<span class="sourceLineNo">185</span>  boolean reportRegionSizesToMaster(Map&lt;HRegionInfo,Long&gt; onlineRegionSizes) {<a name="line.185"></a>
-<span class="sourceLineNo">186</span>    return this.rs.reportRegionSizesForQuotas(onlineRegionSizes);<a name="line.186"></a>
-<span class="sourceLineNo">187</span>  }<a name="line.187"></a>
-<span class="sourceLineNo">188</span><a name="line.188"></a>
-<span class="sourceLineNo">189</span>  /**<a name="line.189"></a>
-<span class="sourceLineNo">190</span>   * Extracts the period for the chore from the configuration.<a name="line.190"></a>
-<span class="sourceLineNo">191</span>   *<a name="line.191"></a>
-<span class="sourceLineNo">192</span>   * @param conf The configuration object.<a name="line.192"></a>
-<span class="sourceLineNo">193</span>   * @return The configured chore period or the default value.<a name="line.193"></a>
-<span class="sourceLineNo">194</span>   */<a name="line.194"></a>
-<span class="sourceLineNo">195</span>  static int getPeriod(Configuration conf) {<a name="line.195"></a>
-<span class="sourceLineNo">196</span>    return conf.getInt(FS_UTILIZATION_CHORE_PERIOD_KEY, FS_UTILIZATION_CHORE_PERIOD_DEFAULT);<a name="line.196"></a>
-<span class="sourceLineNo">197</span>  }<a name="line.197"></a>
-<span class="sourceLineNo">198</span><a name="line.198"></a>
-<span class="sourceLineNo">199</span>  /**<a name="line.199"></a>
-<span class="sourceLineNo">200</span>   * Extracts the initial delay for the chore from the configuration.<a name="line.200"></a>
-<span class="sourceLineNo">201</span>   *<a name="line.201"></a>
-<span class="sourceLineNo">202</span>   * @param conf The configuration object.<a name="line.202"></a>
-<span class="sourceLineNo">203</span>   * @return The configured chore initial delay or the default value.<a name="line.203"></a>
-<span class="sourceLineNo">204</span>   */<a name="line.204"></a>
-<span class="sourceLineNo">205</span>  static long getInitialDelay(Configuration conf) {<a name="line.205"></a>
-<span class="sourceLineNo">206</span>    return conf.getLong(FS_UTILIZATION_CHORE_DELAY_KEY, FS_UTILIZATION_CHORE_DELAY_DEFAULT);<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>   * Extracts the time unit for the chore period and initial delay from the configuration. The<a name="line.210"></a>
-<span class="sourceLineNo">211</span>   * configuration value for {@link #FS_UTILIZATION_CHORE_TIMEUNIT_KEY} must correspond to a<a name="line.211"></a>
-<span class="sourceLineNo">212</span>   * {@link TimeUnit} value.<a name="line.212"></a>
-<span class="sourceLineNo">213</span>   *<a name="line.213"></a>
-<span class="sourceLineNo">214</span>   * @param conf The configuration object.<a name="line.214"></a>
-<span class="sourceLineNo">215</span>   * @return The configured time unit for the chore period and initial delay or the default value.<a name="line.215"></a>
-<span class="sourceLineNo">216</span>   */<a name="line.216"></a>
-<span class="sourceLineNo">217</span>  static TimeUnit getTimeUnit(Configuration conf) {<a name="line.217"></a>
-<span class="sourceLineNo">218</span>    return TimeUnit.valueOf(conf.get(FS_UTILIZATION_CHORE_TIMEUNIT_KEY,<a name="line.218"></a>
-<span class="sourceLineNo">219</span>        FS_UTILIZATION_CHORE_TIMEUNIT_DEFAULT));<a name="line.219"></a>
-<span class="sourceLineNo">220</span>  }<a name="line.220"></a>
-<span class="sourceLineNo">221</span>}<a name="line.221"></a>
+<span class="sourceLineNo">175</span>    if (LOG.isTraceEnabled()) {<a name="line.175"></a>
+<span class="sourceLineNo">176</span>      LOG.trace("Size of " + r + " is " + regionSize);<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    }<a name="line.177"></a>
+<span class="sourceLineNo">178</span>    return regionSize;<a name="line.178"></a>
+<span class="sourceLineNo">179</span>  }<a name="line.179"></a>
+<span class="sourceLineNo">180</span><a name="line.180"></a>
+<span class="sourceLineNo">181</span>  /**<a name="line.181"></a>
+<span class="sourceLineNo">182</span>   * Reports the computed region sizes to the currently active Master.<a name="line.182"></a>
+<span class="sourceLineNo">183</span>   *<a name="line.183"></a>
+<span class="sourceLineNo">184</span>   * @param onlineRegionSizes The computed region sizes to report.<a name="line.184"></a>
+<span class="sourceLineNo">185</span>   * @return {@code false} if FileSystemUtilizationChore should pause reporting to master,<a name="line.185"></a>
+<span class="sourceLineNo">186</span>   *    {@code true} otherwise.<a name="line.186"></a>
+<span class="sourceLineNo">187</span>   */<a name="line.187"></a>
+<span class="sourceLineNo">188</span>  boolean reportRegionSizesToMaster(Map&lt;HRegionInfo,Long&gt; onlineRegionSizes) {<a name="line.188"></a>
+<span class="sourceLineNo">189</span>    return this.rs.reportRegionSizesForQuotas(onlineRegionSizes);<a name="line.189"></a>
+<span class="sourceLineNo">190</span>  }<a name="line.190"></a>
+<span class="sourceLineNo">191</span><a name="line.191"></a>
+<span class="sourceLineNo">192</span>  /**<a name="line.192"></a>
+<span class="sourceLineNo">193</span>   * Extracts the period for the chore from the configuration.<a name="line.193"></a>
+<span class="sourceLineNo">194</span>   *<a name="line.194"></a>
+<span class="sourceLineNo">195</span>   * @param conf The configuration object.<a name="line.195"></a>
+<span class="sourceLineNo">196</span>   * @return The configured chore period or the default value.<a name="line.196"></a>
+<span class="sourceLineNo">197</span>   */<a name="line.197"></a>
+<span class="sourceLineNo">198</span>  static int getPeriod(Configuration conf) {<a name="line.198"></a>
+<span class="sourceLineNo">199</span>    return conf.getInt(FS_UTILIZATION_CHORE_PERIOD_KEY, FS_UTILIZATION_CHORE_PERIOD_DEFAULT);<a name="line.199"></a>
+<span class="sourceLineNo">200</span>  }<a name="line.200"></a>
+<span class="sourceLineNo">201</span><a name="line.201"></a>
+<span class="sourceLineNo">202</span>  /**<a name="line.202"></a>
+<span class="sourceLineNo">203</span>   * Extracts the initial delay for the chore from the configuration.<a name="line.203"></a>
+<span class="sourceLineNo">204</span>   *<a name="line.204"></a>
+<span class="sourceLineNo">205</span>   * @param conf The configuration object.<a name="line.205"></a>
+<span class="sourceLineNo">206</span>   * @return The configured chore initial delay or the default value.<a name="line.206"></a>
+<span class="sourceLineNo">207</span>   */<a name="line.207"></a>
+<span class="sourceLineNo">208</span>  static long getInitialDelay(Configuration conf) {<a name="line.208"></a>
+<span class="sourceLineNo">209</span>    return conf.getLong(FS_UTILIZATION_CHORE_DELAY_KEY, FS_UTILIZATION_CHORE_DELAY_DEFAULT);<a name="line.209"></a>
+<span class="sourceLineNo">210</span>  }<a name="line.210"></a>
+<span class="sourceLineNo">211</span><a name="line.211"></a>
+<span class="sourceLineNo">212</span>  /**<a name="line.212"></a>
+<span class="sourceLineNo">213</span>   * Extracts the time unit for the chore period and initial delay from the configuration. The<a name="line.213"></a>
+<span class="sourceLineNo">214</span>   * configuration value for {@link #FS_UTILIZATION_CHORE_TIMEUNIT_KEY} must correspond to a<a name="line.214"></a>
+<span class="sourceLineNo">215</span>   * {@link TimeUnit} value.<a name="line.215"></a>
+<span class="sourceLineNo">216</span>   *<a name="line.216"></a>
+<span class="sourceLineNo">217</span>   * @param conf The configuration object.<a name="line.217"></a>
+<span class="sourceLineNo">218</span>   * @return The configured time unit for the chore period and initial delay or the default value.<a name="line.218"></a>
+<span class="sourceLineNo">219</span>   */<a name="line.219"></a>
+<span class="sourceLineNo">220</span>  static TimeUnit getTimeUnit(Configuration conf) {<a name="line.220"></a>
+<span class="sourceLineNo">221</span>    return TimeUnit.valueOf(conf.get(FS_UTILIZATION_CHORE_TIMEUNIT_KEY,<a name="line.221"></a>
+<span class="sourceLineNo">222</span>        FS_UTILIZATION_CHORE_TIMEUNIT_DEFAULT));<a name="line.222"></a>
+<span class="sourceLineNo">223</span>  }<a name="line.223"></a>
+<span class="sourceLineNo">224</span>}<a name="line.224"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/476c54ed/devapidocs/src-html/org/apache/hadoop/hbase/quotas/NamespaceQuotaSnapshotStore.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/quotas/NamespaceQuotaSnapshotStore.html b/devapidocs/src-html/org/apache/hadoop/hbase/quotas/NamespaceQuotaSnapshotStore.html
index 584e318..6b70fcd 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/quotas/NamespaceQuotaSnapshotStore.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/quotas/NamespaceQuotaSnapshotStore.html
@@ -26,8 +26,8 @@
 <span class="sourceLineNo">018</span><a name="line.18"></a>
 <span class="sourceLineNo">019</span>import java.io.IOException;<a name="line.19"></a>
 <span class="sourceLineNo">020</span>import java.util.Map;<a name="line.20"></a>
-<span class="sourceLineNo">021</span>import java.util.Objects;<a name="line.21"></a>
-<span class="sourceLineNo">022</span>import java.util.Map.Entry;<a name="line.22"></a>
+<span class="sourceLineNo">021</span>import java.util.Map.Entry;<a name="line.21"></a>
+<span class="sourceLineNo">022</span>import java.util.Objects;<a name="line.22"></a>
 <span class="sourceLineNo">023</span>import java.util.concurrent.locks.ReentrantReadWriteLock;<a name="line.23"></a>
 <span class="sourceLineNo">024</span>import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;<a name="line.24"></a>
 <span class="sourceLineNo">025</span>import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;<a name="line.25"></a>
@@ -85,54 +85,57 @@
 <span class="sourceLineNo">077</span>  }<a name="line.77"></a>
 <span class="sourceLineNo">078</span><a name="line.78"></a>
 <span class="sourceLineNo">079</span>  @Override<a name="line.79"></a>
-<span class="sourceLineNo">080</span>  public SpaceQuotaSnapshot getTargetState(String subject, SpaceQuota spaceQuota) {<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    rlock.lock();<a name="line.81"></a>
-<span class="sourceLineNo">082</span>    try {<a name="line.82"></a>
-<span class="sourceLineNo">083</span>      final long sizeLimitInBytes = spaceQuota.getSoftLimit();<a name="line.83"></a>
-<span class="sourceLineNo">084</span>      long sum = 0L;<a name="line.84"></a>
-<span class="sourceLineNo">085</span>      for (Entry&lt;HRegionInfo,Long&gt; entry : filterBySubject(subject)) {<a name="line.85"></a>
-<span class="sourceLineNo">086</span>        sum += entry.getValue();<a name="line.86"></a>
-<span class="sourceLineNo">087</span>      }<a name="line.87"></a>
-<span class="sourceLineNo">088</span>      // Observance is defined as the size of the table being less than the limit<a name="line.88"></a>
-<span class="sourceLineNo">089</span>      SpaceQuotaStatus status = sum &lt;= sizeLimitInBytes ? SpaceQuotaStatus.notInViolation()<a name="line.89"></a>
-<span class="sourceLineNo">090</span>          : new SpaceQuotaStatus(ProtobufUtil.toViolationPolicy(spaceQuota.getViolationPolicy()));<a name="line.90"></a>
-<span class="sourceLineNo">091</span>      return new SpaceQuotaSnapshot(status, sum, sizeLimitInBytes);<a name="line.91"></a>
-<span class="sourceLineNo">092</span>    } finally {<a name="line.92"></a>
-<span class="sourceLineNo">093</span>      rlock.unlock();<a name="line.93"></a>
-<span class="sourceLineNo">094</span>    }<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>  @Override<a name="line.97"></a>
-<span class="sourceLineNo">098</span>  public Iterable&lt;Entry&lt;HRegionInfo,Long&gt;&gt; filterBySubject(String namespace) {<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    rlock.lock();<a name="line.99"></a>
-<span class="sourceLineNo">100</span>    try {<a name="line.100"></a>
-<span class="sourceLineNo">101</span>      return Iterables.filter(regionUsage.entrySet(), new Predicate&lt;Entry&lt;HRegionInfo,Long&gt;&gt;() {<a name="line.101"></a>
-<span class="sourceLineNo">102</span>        @Override<a name="line.102"></a>
-<span class="sourceLineNo">103</span>        public boolean apply(Entry&lt;HRegionInfo,Long&gt; input) {<a name="line.103"></a>
-<span class="sourceLineNo">104</span>          return namespace.equals(input.getKey().getTable().getNamespaceAsString());<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>    } finally {<a name="line.107"></a>
-<span class="sourceLineNo">108</span>      rlock.unlock();<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    }<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>  @Override<a name="line.112"></a>
-<span class="sourceLineNo">113</span>  public void setCurrentState(String namespace, SpaceQuotaSnapshot snapshot) {<a name="line.113"></a>
-<span class="sourceLineNo">114</span>    // Defer the "current state" to the chore<a name="line.114"></a>
-<span class="sourceLineNo">115</span>    this.chore.setNamespaceQuotaSnapshot(namespace, snapshot);<a name="line.115"></a>
-<span class="sourceLineNo">116</span>  }<a name="line.116"></a>
-<span class="sourceLineNo">117</span><a name="line.117"></a>
-<span class="sourceLineNo">118</span>  @Override<a name="line.118"></a>
-<span class="sourceLineNo">119</span>  public void setRegionUsage(Map&lt;HRegionInfo,Long&gt; regionUsage) {<a name="line.119"></a>
-<span class="sourceLineNo">120</span>    wlock.lock();<a name="line.120"></a>
-<span class="sourceLineNo">121</span>    try {<a name="line.121"></a>
-<span class="sourceLineNo">122</span>      this.regionUsage = Objects.requireNonNull(regionUsage);<a name="line.122"></a>
-<span class="sourceLineNo">123</span>    } finally {<a name="line.123"></a>
-<span class="sourceLineNo">124</span>      wlock.unlock();<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>}<a name="line.127"></a>
+<span class="sourceLineNo">080</span>  public SpaceQuotaSnapshot getTargetState(<a name="line.80"></a>
+<span class="sourceLineNo">081</span>      String subject, SpaceQuota spaceQuota) throws IOException {<a name="line.81"></a>
+<span class="sourceLineNo">082</span>    rlock.lock();<a name="line.82"></a>
+<span class="sourceLineNo">083</span>    try {<a name="line.83"></a>
+<span class="sourceLineNo">084</span>      final long sizeLimitInBytes = spaceQuota.getSoftLimit();<a name="line.84"></a>
+<span class="sourceLineNo">085</span>      long sum = 0L;<a name="line.85"></a>
+<span class="sourceLineNo">086</span>      for (Entry&lt;HRegionInfo,Long&gt; entry : filterBySubject(subject)) {<a name="line.86"></a>
+<span class="sourceLineNo">087</span>        sum += entry.getValue();<a name="line.87"></a>
+<span class="sourceLineNo">088</span>      }<a name="line.88"></a>
+<span class="sourceLineNo">089</span>      // Add in the size for any snapshots against this table<a name="line.89"></a>
+<span class="sourceLineNo">090</span>      sum += QuotaTableUtil.getNamespaceSnapshotSize(conn, subject);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>      // Observance is defined as the size of the table being less than the limit<a name="line.91"></a>
+<span class="sourceLineNo">092</span>      SpaceQuotaStatus status = sum &lt;= sizeLimitInBytes ? SpaceQuotaStatus.notInViolation()<a name="line.92"></a>
+<span class="sourceLineNo">093</span>          : new SpaceQuotaStatus(ProtobufUtil.toViolationPolicy(spaceQuota.getViolationPolicy()));<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      return new SpaceQuotaSnapshot(status, sum, sizeLimitInBytes);<a name="line.94"></a>
+<span class="sourceLineNo">095</span>    } finally {<a name="line.95"></a>
+<span class="sourceLineNo">096</span>      rlock.unlock();<a name="line.96"></a>
+<span class="sourceLineNo">097</span>    }<a name="line.97"></a>
+<span class="sourceLineNo">098</span>  }<a name="line.98"></a>
+<span class="sourceLineNo">099</span><a name="line.99"></a>
+<span class="sourceLineNo">100</span>  @Override<a name="line.100"></a>
+<span class="sourceLineNo">101</span>  public Iterable&lt;Entry&lt;HRegionInfo,Long&gt;&gt; filterBySubject(String namespace) {<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    rlock.lock();<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    try {<a name="line.103"></a>
+<span class="sourceLineNo">104</span>      return Iterables.filter(regionUsage.entrySet(), new Predicate&lt;Entry&lt;HRegionInfo,Long&gt;&gt;() {<a name="line.104"></a>
+<span class="sourceLineNo">105</span>        @Override<a name="line.105"></a>
+<span class="sourceLineNo">106</span>        public boolean apply(Entry&lt;HRegionInfo,Long&gt; input) {<a name="line.106"></a>
+<span class="sourceLineNo">107</span>          return namespace.equals(input.getKey().getTable().getNamespaceAsString());<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>    } finally {<a name="line.110"></a>
+<span class="sourceLineNo">111</span>      rlock.unlock();<a name="line.111"></a>
+<span class="sourceLineNo">112</span>    }<a name="line.112"></a>
+<span class="sourceLineNo">113</span>  }<a name="line.113"></a>
+<span class="sourceLineNo">114</span><a name="line.114"></a>
+<span class="sourceLineNo">115</span>  @Override<a name="line.115"></a>
+<span class="sourceLineNo">116</span>  public void setCurrentState(String namespace, SpaceQuotaSnapshot snapshot) {<a name="line.116"></a>
+<span class="sourceLineNo">117</span>    // Defer the "current state" to the chore<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    this.chore.setNamespaceQuotaSnapshot(namespace, snapshot);<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>  @Override<a name="line.121"></a>
+<span class="sourceLineNo">122</span>  public void setRegionUsage(Map&lt;HRegionInfo,Long&gt; regionUsage) {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>    wlock.lock();<a name="line.123"></a>
+<span class="sourceLineNo">124</span>    try {<a name="line.124"></a>
+<span class="sourceLineNo">125</span>      this.regionUsage = Objects.requireNonNull(regionUsage);<a name="line.125"></a>
+<span class="sourceLineNo">126</span>    } finally {<a name="line.126"></a>
+<span class="sourceLineNo">127</span>      wlock.unlock();<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>}<a name="line.130"></a>
 
 
 


Mime
View raw message