hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [09/51] [partial] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Fri, 11 Aug 2017 15:06:10 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/346adc37/devapidocs/src-html/org/apache/hadoop/hbase/client/TableBuilder.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/client/TableBuilder.html b/devapidocs/src-html/org/apache/hadoop/hbase/client/TableBuilder.html
index 8c639fc..5188ab8 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/client/TableBuilder.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/client/TableBuilder.html
@@ -65,16 +65,10 @@
 <span class="sourceLineNo">057</span>  TableBuilder setWriteRpcTimeout(int timeout);<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>   * Set the write buffer size which by default is specified by the<a name="line.60"></a>
-<span class="sourceLineNo">061</span>   * {@code hbase.client.write.buffer} setting.<a name="line.61"></a>
-<span class="sourceLineNo">062</span>   */<a name="line.62"></a>
-<span class="sourceLineNo">063</span>  TableBuilder setWriteBufferSize(long writeBufferSize);<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>   * Create the {@link Table} instance.<a name="line.66"></a>
-<span class="sourceLineNo">067</span>   */<a name="line.67"></a>
-<span class="sourceLineNo">068</span>  Table build();<a name="line.68"></a>
-<span class="sourceLineNo">069</span>}<a name="line.69"></a>
+<span class="sourceLineNo">060</span>   * Create the {@link Table} instance.<a name="line.60"></a>
+<span class="sourceLineNo">061</span>   */<a name="line.61"></a>
+<span class="sourceLineNo">062</span>  Table build();<a name="line.62"></a>
+<span class="sourceLineNo">063</span>}<a name="line.63"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/346adc37/devapidocs/src-html/org/apache/hadoop/hbase/client/TableBuilderBase.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/client/TableBuilderBase.html b/devapidocs/src-html/org/apache/hadoop/hbase/client/TableBuilderBase.html
index 0487e60..c9e2c98 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/client/TableBuilderBase.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/client/TableBuilderBase.html
@@ -44,51 +44,42 @@
 <span class="sourceLineNo">036</span><a name="line.36"></a>
 <span class="sourceLineNo">037</span>  protected int writeRpcTimeout;<a name="line.37"></a>
 <span class="sourceLineNo">038</span><a name="line.38"></a>
-<span class="sourceLineNo">039</span>  protected long writeBufferSize;<a name="line.39"></a>
-<span class="sourceLineNo">040</span><a name="line.40"></a>
-<span class="sourceLineNo">041</span>  TableBuilderBase(TableName tableName, ConnectionConfiguration connConf) {<a name="line.41"></a>
-<span class="sourceLineNo">042</span>    if (tableName == null) {<a name="line.42"></a>
-<span class="sourceLineNo">043</span>      throw new IllegalArgumentException("Given table name is null");<a name="line.43"></a>
-<span class="sourceLineNo">044</span>    }<a name="line.44"></a>
-<span class="sourceLineNo">045</span>    this.tableName = tableName;<a name="line.45"></a>
-<span class="sourceLineNo">046</span>    this.operationTimeout = tableName.isSystemTable() ? connConf.getMetaOperationTimeout()<a name="line.46"></a>
-<span class="sourceLineNo">047</span>        : connConf.getOperationTimeout();<a name="line.47"></a>
-<span class="sourceLineNo">048</span>    this.rpcTimeout = connConf.getRpcTimeout();<a name="line.48"></a>
-<span class="sourceLineNo">049</span>    this.readRpcTimeout = connConf.getReadRpcTimeout();<a name="line.49"></a>
-<span class="sourceLineNo">050</span>    this.writeRpcTimeout = connConf.getWriteRpcTimeout();<a name="line.50"></a>
-<span class="sourceLineNo">051</span>    this.writeBufferSize = connConf.getWriteBufferSize();<a name="line.51"></a>
-<span class="sourceLineNo">052</span>  }<a name="line.52"></a>
-<span class="sourceLineNo">053</span><a name="line.53"></a>
-<span class="sourceLineNo">054</span>  @Override<a name="line.54"></a>
-<span class="sourceLineNo">055</span>  public TableBuilderBase setOperationTimeout(int timeout) {<a name="line.55"></a>
-<span class="sourceLineNo">056</span>    this.operationTimeout = timeout;<a name="line.56"></a>
-<span class="sourceLineNo">057</span>    return this;<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>  @Override<a name="line.60"></a>
-<span class="sourceLineNo">061</span>  public TableBuilderBase setRpcTimeout(int timeout) {<a name="line.61"></a>
-<span class="sourceLineNo">062</span>    this.rpcTimeout = timeout;<a name="line.62"></a>
-<span class="sourceLineNo">063</span>    return this;<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 TableBuilderBase setReadRpcTimeout(int timeout) {<a name="line.67"></a>
-<span class="sourceLineNo">068</span>    this.readRpcTimeout = timeout;<a name="line.68"></a>
-<span class="sourceLineNo">069</span>    return this;<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>  @Override<a name="line.72"></a>
-<span class="sourceLineNo">073</span>  public TableBuilderBase setWriteRpcTimeout(int timeout) {<a name="line.73"></a>
-<span class="sourceLineNo">074</span>    this.writeRpcTimeout = timeout;<a name="line.74"></a>
-<span class="sourceLineNo">075</span>    return this;<a name="line.75"></a>
-<span class="sourceLineNo">076</span>  }<a name="line.76"></a>
-<span class="sourceLineNo">077</span><a name="line.77"></a>
-<span class="sourceLineNo">078</span>  @Override<a name="line.78"></a>
-<span class="sourceLineNo">079</span>  public TableBuilder setWriteBufferSize(long writeBufferSize) {<a name="line.79"></a>
-<span class="sourceLineNo">080</span>    this.writeBufferSize = writeBufferSize;<a name="line.80"></a>
-<span class="sourceLineNo">081</span>    return this;<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">039</span>  TableBuilderBase(TableName tableName, ConnectionConfiguration connConf) {<a name="line.39"></a>
+<span class="sourceLineNo">040</span>    if (tableName == null) {<a name="line.40"></a>
+<span class="sourceLineNo">041</span>      throw new IllegalArgumentException("Given table name is null");<a name="line.41"></a>
+<span class="sourceLineNo">042</span>    }<a name="line.42"></a>
+<span class="sourceLineNo">043</span>    this.tableName = tableName;<a name="line.43"></a>
+<span class="sourceLineNo">044</span>    this.operationTimeout = tableName.isSystemTable() ? connConf.getMetaOperationTimeout()<a name="line.44"></a>
+<span class="sourceLineNo">045</span>        : connConf.getOperationTimeout();<a name="line.45"></a>
+<span class="sourceLineNo">046</span>    this.rpcTimeout = connConf.getRpcTimeout();<a name="line.46"></a>
+<span class="sourceLineNo">047</span>    this.readRpcTimeout = connConf.getReadRpcTimeout();<a name="line.47"></a>
+<span class="sourceLineNo">048</span>    this.writeRpcTimeout = connConf.getWriteRpcTimeout();<a name="line.48"></a>
+<span class="sourceLineNo">049</span>  }<a name="line.49"></a>
+<span class="sourceLineNo">050</span><a name="line.50"></a>
+<span class="sourceLineNo">051</span>  @Override<a name="line.51"></a>
+<span class="sourceLineNo">052</span>  public TableBuilderBase setOperationTimeout(int timeout) {<a name="line.52"></a>
+<span class="sourceLineNo">053</span>    this.operationTimeout = timeout;<a name="line.53"></a>
+<span class="sourceLineNo">054</span>    return this;<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>  @Override<a name="line.57"></a>
+<span class="sourceLineNo">058</span>  public TableBuilderBase setRpcTimeout(int timeout) {<a name="line.58"></a>
+<span class="sourceLineNo">059</span>    this.rpcTimeout = timeout;<a name="line.59"></a>
+<span class="sourceLineNo">060</span>    return this;<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>  @Override<a name="line.63"></a>
+<span class="sourceLineNo">064</span>  public TableBuilderBase setReadRpcTimeout(int timeout) {<a name="line.64"></a>
+<span class="sourceLineNo">065</span>    this.readRpcTimeout = timeout;<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    return this;<a name="line.66"></a>
+<span class="sourceLineNo">067</span>  }<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>  @Override<a name="line.69"></a>
+<span class="sourceLineNo">070</span>  public TableBuilderBase setWriteRpcTimeout(int timeout) {<a name="line.70"></a>
+<span class="sourceLineNo">071</span>    this.writeRpcTimeout = timeout;<a name="line.71"></a>
+<span class="sourceLineNo">072</span>    return this;<a name="line.72"></a>
+<span class="sourceLineNo">073</span>  }<a name="line.73"></a>
+<span class="sourceLineNo">074</span>}<a name="line.74"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/346adc37/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterRpcServices.BalanceSwitchMode.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterRpcServices.BalanceSwitchMode.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterRpcServices.BalanceSwitchMode.html
index d7f2ea1..128ae24 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterRpcServices.BalanceSwitchMode.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterRpcServices.BalanceSwitchMode.html
@@ -1015,7 +1015,7 @@
 <span class="sourceLineNo">1007</span>  @Override<a name="line.1007"></a>
 <span class="sourceLineNo">1008</span>  public GetProcedureResultResponse getProcedureResult(RpcController controller,<a name="line.1008"></a>
 <span class="sourceLineNo">1009</span>      GetProcedureResultRequest request) throws ServiceException {<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>    LOG.debug("Checking to see if procedure is done procId=" + request.getProcId());<a name="line.1010"></a>
+<span class="sourceLineNo">1010</span>    LOG.debug("Checking to see if procedure is done pid=" + request.getProcId());<a name="line.1010"></a>
 <span class="sourceLineNo">1011</span>    try {<a name="line.1011"></a>
 <span class="sourceLineNo">1012</span>      master.checkInitialized();<a name="line.1012"></a>
 <span class="sourceLineNo">1013</span>      GetProcedureResultResponse.Builder builder = GetProcedureResultResponse.newBuilder();<a name="line.1013"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/346adc37/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterRpcServices.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterRpcServices.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterRpcServices.html
index d7f2ea1..128ae24 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterRpcServices.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/MasterRpcServices.html
@@ -1015,7 +1015,7 @@
 <span class="sourceLineNo">1007</span>  @Override<a name="line.1007"></a>
 <span class="sourceLineNo">1008</span>  public GetProcedureResultResponse getProcedureResult(RpcController controller,<a name="line.1008"></a>
 <span class="sourceLineNo">1009</span>      GetProcedureResultRequest request) throws ServiceException {<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>    LOG.debug("Checking to see if procedure is done procId=" + request.getProcId());<a name="line.1010"></a>
+<span class="sourceLineNo">1010</span>    LOG.debug("Checking to see if procedure is done pid=" + request.getProcId());<a name="line.1010"></a>
 <span class="sourceLineNo">1011</span>    try {<a name="line.1011"></a>
 <span class="sourceLineNo">1012</span>      master.checkInitialized();<a name="line.1012"></a>
 <span class="sourceLineNo">1013</span>      GetProcedureResultResponse.Builder builder = GetProcedureResultResponse.newBuilder();<a name="line.1013"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/346adc37/devapidocs/src-html/org/apache/hadoop/hbase/master/TableNamespaceManager.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/TableNamespaceManager.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/TableNamespaceManager.html
index 35f7e54..3285e4b 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/TableNamespaceManager.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/TableNamespaceManager.html
@@ -248,7 +248,7 @@
 <span class="sourceLineNo">240</span>      // Sleep some<a name="line.240"></a>
 <span class="sourceLineNo">241</span>      Threads.sleep(10);<a name="line.241"></a>
 <span class="sourceLineNo">242</span>    }<a name="line.242"></a>
-<span class="sourceLineNo">243</span>    throw new TimeoutIOException("Procedure " + procId + " is still running");<a name="line.243"></a>
+<span class="sourceLineNo">243</span>    throw new TimeoutIOException("Procedure pid=" + procId + " is still running");<a name="line.243"></a>
 <span class="sourceLineNo">244</span>  }<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>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/346adc37/devapidocs/src-html/org/apache/hadoop/hbase/master/TableStateManager.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/TableStateManager.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/TableStateManager.html
index 2894a0c..764d9aa 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/TableStateManager.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/TableStateManager.html
@@ -50,185 +50,186 @@
 <span class="sourceLineNo">042</span>/**<a name="line.42"></a>
 <span class="sourceLineNo">043</span> * This is a helper class used to manage table states.<a name="line.43"></a>
 <span class="sourceLineNo">044</span> * States persisted in tableinfo and cached internally.<a name="line.44"></a>
-<span class="sourceLineNo">045</span> */<a name="line.45"></a>
-<span class="sourceLineNo">046</span>@InterfaceAudience.Private<a name="line.46"></a>
-<span class="sourceLineNo">047</span>public class TableStateManager {<a name="line.47"></a>
-<span class="sourceLineNo">048</span>  private static final Log LOG = LogFactory.getLog(TableStateManager.class);<a name="line.48"></a>
-<span class="sourceLineNo">049</span><a name="line.49"></a>
-<span class="sourceLineNo">050</span>  private final ReadWriteLock lock = new ReentrantReadWriteLock();<a name="line.50"></a>
-<span class="sourceLineNo">051</span>  private final MasterServices master;<a name="line.51"></a>
-<span class="sourceLineNo">052</span><a name="line.52"></a>
-<span class="sourceLineNo">053</span>  public TableStateManager(MasterServices master) {<a name="line.53"></a>
-<span class="sourceLineNo">054</span>    this.master = master;<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>  /**<a name="line.57"></a>
-<span class="sourceLineNo">058</span>   * Set table state to provided.<a name="line.58"></a>
-<span class="sourceLineNo">059</span>   * Caller should lock table on write.<a name="line.59"></a>
-<span class="sourceLineNo">060</span>   * @param tableName table to change state for<a name="line.60"></a>
-<span class="sourceLineNo">061</span>   * @param newState new state<a name="line.61"></a>
-<span class="sourceLineNo">062</span>   * @throws IOException<a name="line.62"></a>
-<span class="sourceLineNo">063</span>   */<a name="line.63"></a>
-<span class="sourceLineNo">064</span>  public void setTableState(TableName tableName, TableState.State newState) throws IOException {<a name="line.64"></a>
-<span class="sourceLineNo">065</span>    lock.writeLock().lock();<a name="line.65"></a>
-<span class="sourceLineNo">066</span>    try {<a name="line.66"></a>
-<span class="sourceLineNo">067</span>      udpateMetaState(tableName, newState);<a name="line.67"></a>
-<span class="sourceLineNo">068</span>    } finally {<a name="line.68"></a>
-<span class="sourceLineNo">069</span>      lock.writeLock().unlock();<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>  }<a name="line.72"></a>
-<span class="sourceLineNo">073</span><a name="line.73"></a>
-<span class="sourceLineNo">074</span>  /**<a name="line.74"></a>
-<span class="sourceLineNo">075</span>   * Set table state to provided but only if table in specified states<a name="line.75"></a>
-<span class="sourceLineNo">076</span>   * Caller should lock table on write.<a name="line.76"></a>
-<span class="sourceLineNo">077</span>   * @param tableName table to change state for<a name="line.77"></a>
-<span class="sourceLineNo">078</span>   * @param newState new state<a name="line.78"></a>
-<span class="sourceLineNo">079</span>   * @param states states to check against<a name="line.79"></a>
-<span class="sourceLineNo">080</span>   * @return null if succeed or table state if failed<a name="line.80"></a>
-<span class="sourceLineNo">081</span>   * @throws IOException<a name="line.81"></a>
-<span class="sourceLineNo">082</span>   */<a name="line.82"></a>
-<span class="sourceLineNo">083</span>  public TableState.State setTableStateIfInStates(TableName tableName,<a name="line.83"></a>
-<span class="sourceLineNo">084</span>                                         TableState.State newState,<a name="line.84"></a>
-<span class="sourceLineNo">085</span>                                         TableState.State... states)<a name="line.85"></a>
-<span class="sourceLineNo">086</span>          throws IOException {<a name="line.86"></a>
-<span class="sourceLineNo">087</span>    lock.writeLock().lock();<a name="line.87"></a>
-<span class="sourceLineNo">088</span>    try {<a name="line.88"></a>
-<span class="sourceLineNo">089</span>      TableState currentState = readMetaState(tableName);<a name="line.89"></a>
-<span class="sourceLineNo">090</span>      if (currentState == null) {<a name="line.90"></a>
-<span class="sourceLineNo">091</span>        throw new TableNotFoundException(tableName);<a name="line.91"></a>
-<span class="sourceLineNo">092</span>      }<a name="line.92"></a>
-<span class="sourceLineNo">093</span>      if (currentState.inStates(states)) {<a name="line.93"></a>
-<span class="sourceLineNo">094</span>        udpateMetaState(tableName, newState);<a name="line.94"></a>
-<span class="sourceLineNo">095</span>        return null;<a name="line.95"></a>
-<span class="sourceLineNo">096</span>      } else {<a name="line.96"></a>
-<span class="sourceLineNo">097</span>        return currentState.getState();<a name="line.97"></a>
-<span class="sourceLineNo">098</span>      }<a name="line.98"></a>
-<span class="sourceLineNo">099</span>    } finally {<a name="line.99"></a>
-<span class="sourceLineNo">100</span>      lock.writeLock().unlock();<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>  }<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>   * Set table state to provided but only if table not in specified states<a name="line.106"></a>
-<span class="sourceLineNo">107</span>   * Caller should lock table on write.<a name="line.107"></a>
-<span class="sourceLineNo">108</span>   * @param tableName table to change state for<a name="line.108"></a>
-<span class="sourceLineNo">109</span>   * @param newState new state<a name="line.109"></a>
-<span class="sourceLineNo">110</span>   * @param states states to check against<a name="line.110"></a>
-<span class="sourceLineNo">111</span>   * @throws IOException<a name="line.111"></a>
-<span class="sourceLineNo">112</span>   */<a name="line.112"></a>
-<span class="sourceLineNo">113</span>  public boolean setTableStateIfNotInStates(TableName tableName,<a name="line.113"></a>
-<span class="sourceLineNo">114</span>                                            TableState.State newState,<a name="line.114"></a>
-<span class="sourceLineNo">115</span>                                            TableState.State... states)<a name="line.115"></a>
-<span class="sourceLineNo">116</span>          throws IOException {<a name="line.116"></a>
-<span class="sourceLineNo">117</span>    TableState currentState = readMetaState(tableName);<a name="line.117"></a>
-<span class="sourceLineNo">118</span>    if (currentState == null) {<a name="line.118"></a>
-<span class="sourceLineNo">119</span>      throw new TableNotFoundException(tableName);<a name="line.119"></a>
-<span class="sourceLineNo">120</span>    }<a name="line.120"></a>
-<span class="sourceLineNo">121</span>    if (!currentState.inStates(states)) {<a name="line.121"></a>
-<span class="sourceLineNo">122</span>      udpateMetaState(tableName, newState);<a name="line.122"></a>
-<span class="sourceLineNo">123</span>      return true;<a name="line.123"></a>
-<span class="sourceLineNo">124</span>    } else {<a name="line.124"></a>
-<span class="sourceLineNo">125</span>      return false;<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><a name="line.128"></a>
-<span class="sourceLineNo">129</span>  public boolean isTableState(TableName tableName, TableState.State... states) {<a name="line.129"></a>
-<span class="sourceLineNo">130</span>    try {<a name="line.130"></a>
-<span class="sourceLineNo">131</span>      TableState.State tableState = getTableState(tableName);<a name="line.131"></a>
-<span class="sourceLineNo">132</span>      return TableState.isInStates(tableState, states);<a name="line.132"></a>
-<span class="sourceLineNo">133</span>    } catch (IOException e) {<a name="line.133"></a>
-<span class="sourceLineNo">134</span>      LOG.error("Unable to get table " + tableName + " state", e);<a name="line.134"></a>
-<span class="sourceLineNo">135</span>      return false;<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>  public void setDeletedTable(TableName tableName) throws IOException {<a name="line.139"></a>
-<span class="sourceLineNo">140</span>    if (tableName.equals(TableName.META_TABLE_NAME))<a name="line.140"></a>
-<span class="sourceLineNo">141</span>      return;<a name="line.141"></a>
-<span class="sourceLineNo">142</span>    MetaTableAccessor.deleteTableState(master.getConnection(), tableName);<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>  public boolean isTablePresent(TableName tableName) throws IOException {<a name="line.145"></a>
-<span class="sourceLineNo">146</span>    return readMetaState(tableName) != null;<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>  /**<a name="line.149"></a>
-<span class="sourceLineNo">150</span>   * Return all tables in given states.<a name="line.150"></a>
-<span class="sourceLineNo">151</span>   *<a name="line.151"></a>
-<span class="sourceLineNo">152</span>   * @param states filter by states<a name="line.152"></a>
-<span class="sourceLineNo">153</span>   * @return tables in given states<a name="line.153"></a>
-<span class="sourceLineNo">154</span>   * @throws IOException<a name="line.154"></a>
-<span class="sourceLineNo">155</span>   */<a name="line.155"></a>
-<span class="sourceLineNo">156</span>  public Set&lt;TableName&gt; getTablesInStates(final TableState.State... states) throws IOException {<a name="line.156"></a>
-<span class="sourceLineNo">157</span>    final Set&lt;TableName&gt; rv = Sets.newHashSet();<a name="line.157"></a>
-<span class="sourceLineNo">158</span>    MetaTableAccessor.fullScanTables(master.getConnection(), new MetaTableAccessor.Visitor() {<a name="line.158"></a>
-<span class="sourceLineNo">159</span>      @Override<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      public boolean visit(Result r) throws IOException {<a name="line.160"></a>
-<span class="sourceLineNo">161</span>        TableState tableState = MetaTableAccessor.getTableState(r);<a name="line.161"></a>
-<span class="sourceLineNo">162</span>        if (tableState != null &amp;&amp; tableState.inStates(states))<a name="line.162"></a>
-<span class="sourceLineNo">163</span>          rv.add(tableState.getTableName());<a name="line.163"></a>
-<span class="sourceLineNo">164</span>        return true;<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>    return rv;<a name="line.167"></a>
-<span class="sourceLineNo">168</span>  }<a name="line.168"></a>
-<span class="sourceLineNo">169</span><a name="line.169"></a>
-<span class="sourceLineNo">170</span>  @NonNull<a name="line.170"></a>
-<span class="sourceLineNo">171</span>  public TableState.State getTableState(TableName tableName) throws IOException {<a name="line.171"></a>
-<span class="sourceLineNo">172</span>    TableState currentState = readMetaState(tableName);<a name="line.172"></a>
-<span class="sourceLineNo">173</span>    if (currentState == null) {<a name="line.173"></a>
-<span class="sourceLineNo">174</span>      throw new TableNotFoundException(tableName);<a name="line.174"></a>
-<span class="sourceLineNo">175</span>    }<a name="line.175"></a>
-<span class="sourceLineNo">176</span>    return currentState.getState();<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>  protected void udpateMetaState(TableName tableName, TableState.State newState)<a name="line.179"></a>
-<span class="sourceLineNo">180</span>      throws IOException {<a name="line.180"></a>
-<span class="sourceLineNo">181</span>    MetaTableAccessor.updateTableState(master.getConnection(), tableName, newState);<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>  @Nullable<a name="line.184"></a>
-<span class="sourceLineNo">185</span>  protected TableState readMetaState(TableName tableName) throws IOException {<a name="line.185"></a>
-<span class="sourceLineNo">186</span>    if (tableName.equals(TableName.META_TABLE_NAME)) {<a name="line.186"></a>
-<span class="sourceLineNo">187</span>      return new TableState(tableName, TableState.State.ENABLED);<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    }<a name="line.188"></a>
-<span class="sourceLineNo">189</span>    return MetaTableAccessor.getTableState(master.getConnection(), tableName);<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>  public void start() throws IOException {<a name="line.192"></a>
-<span class="sourceLineNo">193</span>    TableDescriptors tableDescriptors = master.getTableDescriptors();<a name="line.193"></a>
-<span class="sourceLineNo">194</span>    Connection connection = master.getConnection();<a name="line.194"></a>
-<span class="sourceLineNo">195</span>    fixTableStates(tableDescriptors, connection);<a name="line.195"></a>
-<span class="sourceLineNo">196</span>  }<a name="line.196"></a>
-<span class="sourceLineNo">197</span><a name="line.197"></a>
-<span class="sourceLineNo">198</span>  public static void fixTableStates(TableDescriptors tableDescriptors, Connection connection)<a name="line.198"></a>
-<span class="sourceLineNo">199</span>      throws IOException {<a name="line.199"></a>
-<span class="sourceLineNo">200</span>    final Map&lt;String, HTableDescriptor&gt; allDescriptors =<a name="line.200"></a>
-<span class="sourceLineNo">201</span>        tableDescriptors.getAllDescriptors();<a name="line.201"></a>
-<span class="sourceLineNo">202</span>    final Map&lt;String, TableState&gt; states = new HashMap&lt;&gt;();<a name="line.202"></a>
-<span class="sourceLineNo">203</span>    MetaTableAccessor.fullScanTables(connection, new MetaTableAccessor.Visitor() {<a name="line.203"></a>
-<span class="sourceLineNo">204</span>      @Override<a name="line.204"></a>
-<span class="sourceLineNo">205</span>      public boolean visit(Result r) throws IOException {<a name="line.205"></a>
-<span class="sourceLineNo">206</span>        TableState state = MetaTableAccessor.getTableState(r);<a name="line.206"></a>
-<span class="sourceLineNo">207</span>        if (state != null)<a name="line.207"></a>
-<span class="sourceLineNo">208</span>          states.put(state.getTableName().getNameAsString(), state);<a name="line.208"></a>
-<span class="sourceLineNo">209</span>        return true;<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>    for (Map.Entry&lt;String, HTableDescriptor&gt; entry : allDescriptors.entrySet()) {<a name="line.212"></a>
-<span class="sourceLineNo">213</span>      String table = entry.getKey();<a name="line.213"></a>
-<span class="sourceLineNo">214</span>      if (table.equals(TableName.META_TABLE_NAME.getNameAsString()))<a name="line.214"></a>
-<span class="sourceLineNo">215</span>        continue;<a name="line.215"></a>
-<span class="sourceLineNo">216</span>      if (!states.containsKey(table)) {<a name="line.216"></a>
-<span class="sourceLineNo">217</span>        LOG.warn("Found table with no state, assuming ENABLED");<a name="line.217"></a>
-<span class="sourceLineNo">218</span>        MetaTableAccessor.updateTableState(connection, TableName.valueOf(table),<a name="line.218"></a>
-<span class="sourceLineNo">219</span>            TableState.State.ENABLED);<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">222</span>  }<a name="line.222"></a>
-<span class="sourceLineNo">223</span>}<a name="line.223"></a>
+<span class="sourceLineNo">045</span> * TODO: Cache state. Cut down on meta looksups.<a name="line.45"></a>
+<span class="sourceLineNo">046</span> */<a name="line.46"></a>
+<span class="sourceLineNo">047</span>@InterfaceAudience.Private<a name="line.47"></a>
+<span class="sourceLineNo">048</span>public class TableStateManager {<a name="line.48"></a>
+<span class="sourceLineNo">049</span>  private static final Log LOG = LogFactory.getLog(TableStateManager.class);<a name="line.49"></a>
+<span class="sourceLineNo">050</span><a name="line.50"></a>
+<span class="sourceLineNo">051</span>  private final ReadWriteLock lock = new ReentrantReadWriteLock();<a name="line.51"></a>
+<span class="sourceLineNo">052</span>  private final MasterServices master;<a name="line.52"></a>
+<span class="sourceLineNo">053</span><a name="line.53"></a>
+<span class="sourceLineNo">054</span>  public TableStateManager(MasterServices master) {<a name="line.54"></a>
+<span class="sourceLineNo">055</span>    this.master = master;<a name="line.55"></a>
+<span class="sourceLineNo">056</span>  }<a name="line.56"></a>
+<span class="sourceLineNo">057</span><a name="line.57"></a>
+<span class="sourceLineNo">058</span>  /**<a name="line.58"></a>
+<span class="sourceLineNo">059</span>   * Set table state to provided.<a name="line.59"></a>
+<span class="sourceLineNo">060</span>   * Caller should lock table on write.<a name="line.60"></a>
+<span class="sourceLineNo">061</span>   * @param tableName table to change state for<a name="line.61"></a>
+<span class="sourceLineNo">062</span>   * @param newState new state<a name="line.62"></a>
+<span class="sourceLineNo">063</span>   * @throws IOException<a name="line.63"></a>
+<span class="sourceLineNo">064</span>   */<a name="line.64"></a>
+<span class="sourceLineNo">065</span>  public void setTableState(TableName tableName, TableState.State newState) throws IOException {<a name="line.65"></a>
+<span class="sourceLineNo">066</span>    lock.writeLock().lock();<a name="line.66"></a>
+<span class="sourceLineNo">067</span>    try {<a name="line.67"></a>
+<span class="sourceLineNo">068</span>      udpateMetaState(tableName, newState);<a name="line.68"></a>
+<span class="sourceLineNo">069</span>    } finally {<a name="line.69"></a>
+<span class="sourceLineNo">070</span>      lock.writeLock().unlock();<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>  }<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>   * Set table state to provided but only if table in specified states<a name="line.76"></a>
+<span class="sourceLineNo">077</span>   * Caller should lock table on write.<a name="line.77"></a>
+<span class="sourceLineNo">078</span>   * @param tableName table to change state for<a name="line.78"></a>
+<span class="sourceLineNo">079</span>   * @param newState new state<a name="line.79"></a>
+<span class="sourceLineNo">080</span>   * @param states states to check against<a name="line.80"></a>
+<span class="sourceLineNo">081</span>   * @return null if succeed or table state if failed<a name="line.81"></a>
+<span class="sourceLineNo">082</span>   * @throws IOException<a name="line.82"></a>
+<span class="sourceLineNo">083</span>   */<a name="line.83"></a>
+<span class="sourceLineNo">084</span>  public TableState.State setTableStateIfInStates(TableName tableName,<a name="line.84"></a>
+<span class="sourceLineNo">085</span>                                         TableState.State newState,<a name="line.85"></a>
+<span class="sourceLineNo">086</span>                                         TableState.State... states)<a name="line.86"></a>
+<span class="sourceLineNo">087</span>          throws IOException {<a name="line.87"></a>
+<span class="sourceLineNo">088</span>    lock.writeLock().lock();<a name="line.88"></a>
+<span class="sourceLineNo">089</span>    try {<a name="line.89"></a>
+<span class="sourceLineNo">090</span>      TableState currentState = readMetaState(tableName);<a name="line.90"></a>
+<span class="sourceLineNo">091</span>      if (currentState == null) {<a name="line.91"></a>
+<span class="sourceLineNo">092</span>        throw new TableNotFoundException(tableName);<a name="line.92"></a>
+<span class="sourceLineNo">093</span>      }<a name="line.93"></a>
+<span class="sourceLineNo">094</span>      if (currentState.inStates(states)) {<a name="line.94"></a>
+<span class="sourceLineNo">095</span>        udpateMetaState(tableName, newState);<a name="line.95"></a>
+<span class="sourceLineNo">096</span>        return null;<a name="line.96"></a>
+<span class="sourceLineNo">097</span>      } else {<a name="line.97"></a>
+<span class="sourceLineNo">098</span>        return currentState.getState();<a name="line.98"></a>
+<span class="sourceLineNo">099</span>      }<a name="line.99"></a>
+<span class="sourceLineNo">100</span>    } finally {<a name="line.100"></a>
+<span class="sourceLineNo">101</span>      lock.writeLock().unlock();<a name="line.101"></a>
+<span class="sourceLineNo">102</span>    }<a name="line.102"></a>
+<span class="sourceLineNo">103</span><a name="line.103"></a>
+<span class="sourceLineNo">104</span>  }<a name="line.104"></a>
+<span class="sourceLineNo">105</span><a name="line.105"></a>
+<span class="sourceLineNo">106</span>  /**<a name="line.106"></a>
+<span class="sourceLineNo">107</span>   * Set table state to provided but only if table not in specified states<a name="line.107"></a>
+<span class="sourceLineNo">108</span>   * Caller should lock table on write.<a name="line.108"></a>
+<span class="sourceLineNo">109</span>   * @param tableName table to change state for<a name="line.109"></a>
+<span class="sourceLineNo">110</span>   * @param newState new state<a name="line.110"></a>
+<span class="sourceLineNo">111</span>   * @param states states to check against<a name="line.111"></a>
+<span class="sourceLineNo">112</span>   * @throws IOException<a name="line.112"></a>
+<span class="sourceLineNo">113</span>   */<a name="line.113"></a>
+<span class="sourceLineNo">114</span>  public boolean setTableStateIfNotInStates(TableName tableName,<a name="line.114"></a>
+<span class="sourceLineNo">115</span>                                            TableState.State newState,<a name="line.115"></a>
+<span class="sourceLineNo">116</span>                                            TableState.State... states)<a name="line.116"></a>
+<span class="sourceLineNo">117</span>          throws IOException {<a name="line.117"></a>
+<span class="sourceLineNo">118</span>    TableState currentState = readMetaState(tableName);<a name="line.118"></a>
+<span class="sourceLineNo">119</span>    if (currentState == null) {<a name="line.119"></a>
+<span class="sourceLineNo">120</span>      throw new TableNotFoundException(tableName);<a name="line.120"></a>
+<span class="sourceLineNo">121</span>    }<a name="line.121"></a>
+<span class="sourceLineNo">122</span>    if (!currentState.inStates(states)) {<a name="line.122"></a>
+<span class="sourceLineNo">123</span>      udpateMetaState(tableName, newState);<a name="line.123"></a>
+<span class="sourceLineNo">124</span>      return true;<a name="line.124"></a>
+<span class="sourceLineNo">125</span>    } else {<a name="line.125"></a>
+<span class="sourceLineNo">126</span>      return false;<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>  public boolean isTableState(TableName tableName, TableState.State... states) {<a name="line.130"></a>
+<span class="sourceLineNo">131</span>    try {<a name="line.131"></a>
+<span class="sourceLineNo">132</span>      TableState.State tableState = getTableState(tableName);<a name="line.132"></a>
+<span class="sourceLineNo">133</span>      return TableState.isInStates(tableState, states);<a name="line.133"></a>
+<span class="sourceLineNo">134</span>    } catch (IOException e) {<a name="line.134"></a>
+<span class="sourceLineNo">135</span>      LOG.error("Unable to get table " + tableName + " state", e);<a name="line.135"></a>
+<span class="sourceLineNo">136</span>      return false;<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><a name="line.139"></a>
+<span class="sourceLineNo">140</span>  public void setDeletedTable(TableName tableName) throws IOException {<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    if (tableName.equals(TableName.META_TABLE_NAME))<a name="line.141"></a>
+<span class="sourceLineNo">142</span>      return;<a name="line.142"></a>
+<span class="sourceLineNo">143</span>    MetaTableAccessor.deleteTableState(master.getConnection(), tableName);<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>  public boolean isTablePresent(TableName tableName) throws IOException {<a name="line.146"></a>
+<span class="sourceLineNo">147</span>    return readMetaState(tableName) != null;<a name="line.147"></a>
+<span class="sourceLineNo">148</span>  }<a name="line.148"></a>
+<span class="sourceLineNo">149</span><a name="line.149"></a>
+<span class="sourceLineNo">150</span>  /**<a name="line.150"></a>
+<span class="sourceLineNo">151</span>   * Return all tables in given states.<a name="line.151"></a>
+<span class="sourceLineNo">152</span>   *<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   * @param states filter by states<a name="line.153"></a>
+<span class="sourceLineNo">154</span>   * @return tables in given states<a name="line.154"></a>
+<span class="sourceLineNo">155</span>   * @throws IOException<a name="line.155"></a>
+<span class="sourceLineNo">156</span>   */<a name="line.156"></a>
+<span class="sourceLineNo">157</span>  public Set&lt;TableName&gt; getTablesInStates(final TableState.State... states) throws IOException {<a name="line.157"></a>
+<span class="sourceLineNo">158</span>    final Set&lt;TableName&gt; rv = Sets.newHashSet();<a name="line.158"></a>
+<span class="sourceLineNo">159</span>    MetaTableAccessor.fullScanTables(master.getConnection(), new MetaTableAccessor.Visitor() {<a name="line.159"></a>
+<span class="sourceLineNo">160</span>      @Override<a name="line.160"></a>
+<span class="sourceLineNo">161</span>      public boolean visit(Result r) throws IOException {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>        TableState tableState = MetaTableAccessor.getTableState(r);<a name="line.162"></a>
+<span class="sourceLineNo">163</span>        if (tableState != null &amp;&amp; tableState.inStates(states))<a name="line.163"></a>
+<span class="sourceLineNo">164</span>          rv.add(tableState.getTableName());<a name="line.164"></a>
+<span class="sourceLineNo">165</span>        return true;<a name="line.165"></a>
+<span class="sourceLineNo">166</span>      }<a name="line.166"></a>
+<span class="sourceLineNo">167</span>    });<a name="line.167"></a>
+<span class="sourceLineNo">168</span>    return rv;<a name="line.168"></a>
+<span class="sourceLineNo">169</span>  }<a name="line.169"></a>
+<span class="sourceLineNo">170</span><a name="line.170"></a>
+<span class="sourceLineNo">171</span>  @NonNull<a name="line.171"></a>
+<span class="sourceLineNo">172</span>  public TableState.State getTableState(TableName tableName) throws IOException {<a name="line.172"></a>
+<span class="sourceLineNo">173</span>    TableState currentState = readMetaState(tableName);<a name="line.173"></a>
+<span class="sourceLineNo">174</span>    if (currentState == null) {<a name="line.174"></a>
+<span class="sourceLineNo">175</span>      throw new TableNotFoundException(tableName);<a name="line.175"></a>
+<span class="sourceLineNo">176</span>    }<a name="line.176"></a>
+<span class="sourceLineNo">177</span>    return currentState.getState();<a name="line.177"></a>
+<span class="sourceLineNo">178</span>  }<a name="line.178"></a>
+<span class="sourceLineNo">179</span><a name="line.179"></a>
+<span class="sourceLineNo">180</span>  protected void udpateMetaState(TableName tableName, TableState.State newState)<a name="line.180"></a>
+<span class="sourceLineNo">181</span>      throws IOException {<a name="line.181"></a>
+<span class="sourceLineNo">182</span>    MetaTableAccessor.updateTableState(master.getConnection(), tableName, newState);<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>  @Nullable<a name="line.185"></a>
+<span class="sourceLineNo">186</span>  protected TableState readMetaState(TableName tableName) throws IOException {<a name="line.186"></a>
+<span class="sourceLineNo">187</span>    if (tableName.equals(TableName.META_TABLE_NAME)) {<a name="line.187"></a>
+<span class="sourceLineNo">188</span>      return new TableState(tableName, TableState.State.ENABLED);<a name="line.188"></a>
+<span class="sourceLineNo">189</span>    }<a name="line.189"></a>
+<span class="sourceLineNo">190</span>    return MetaTableAccessor.getTableState(master.getConnection(), tableName);<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>  public void start() throws IOException {<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    TableDescriptors tableDescriptors = master.getTableDescriptors();<a name="line.194"></a>
+<span class="sourceLineNo">195</span>    Connection connection = master.getConnection();<a name="line.195"></a>
+<span class="sourceLineNo">196</span>    fixTableStates(tableDescriptors, connection);<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>  public static void fixTableStates(TableDescriptors tableDescriptors, Connection connection)<a name="line.199"></a>
+<span class="sourceLineNo">200</span>      throws IOException {<a name="line.200"></a>
+<span class="sourceLineNo">201</span>    final Map&lt;String, HTableDescriptor&gt; allDescriptors =<a name="line.201"></a>
+<span class="sourceLineNo">202</span>        tableDescriptors.getAllDescriptors();<a name="line.202"></a>
+<span class="sourceLineNo">203</span>    final Map&lt;String, TableState&gt; states = new HashMap&lt;&gt;();<a name="line.203"></a>
+<span class="sourceLineNo">204</span>    MetaTableAccessor.fullScanTables(connection, new MetaTableAccessor.Visitor() {<a name="line.204"></a>
+<span class="sourceLineNo">205</span>      @Override<a name="line.205"></a>
+<span class="sourceLineNo">206</span>      public boolean visit(Result r) throws IOException {<a name="line.206"></a>
+<span class="sourceLineNo">207</span>        TableState state = MetaTableAccessor.getTableState(r);<a name="line.207"></a>
+<span class="sourceLineNo">208</span>        if (state != null)<a name="line.208"></a>
+<span class="sourceLineNo">209</span>          states.put(state.getTableName().getNameAsString(), state);<a name="line.209"></a>
+<span class="sourceLineNo">210</span>        return true;<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>    for (Map.Entry&lt;String, HTableDescriptor&gt; entry : allDescriptors.entrySet()) {<a name="line.213"></a>
+<span class="sourceLineNo">214</span>      String table = entry.getKey();<a name="line.214"></a>
+<span class="sourceLineNo">215</span>      if (table.equals(TableName.META_TABLE_NAME.getNameAsString()))<a name="line.215"></a>
+<span class="sourceLineNo">216</span>        continue;<a name="line.216"></a>
+<span class="sourceLineNo">217</span>      if (!states.containsKey(table)) {<a name="line.217"></a>
+<span class="sourceLineNo">218</span>        LOG.warn("Found table with no state, assuming ENABLED");<a name="line.218"></a>
+<span class="sourceLineNo">219</span>        MetaTableAccessor.updateTableState(connection, TableName.valueOf(table),<a name="line.219"></a>
+<span class="sourceLineNo">220</span>            TableState.State.ENABLED);<a name="line.220"></a>
+<span class="sourceLineNo">221</span>      }<a name="line.221"></a>
+<span class="sourceLineNo">222</span>    }<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>
 
 
 


Mime
View raw message