hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [16/26] hbase-site git commit: Published site at .
Date Wed, 20 Sep 2017 13:06:16 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/7d90d02f/devapidocs/src-html/org/apache/hadoop/hbase/MetaTableAccessor.TableVisitorBase.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/MetaTableAccessor.TableVisitorBase.html b/devapidocs/src-html/org/apache/hadoop/hbase/MetaTableAccessor.TableVisitorBase.html
index 2e2767b..a634c1e 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/MetaTableAccessor.TableVisitorBase.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/MetaTableAccessor.TableVisitorBase.html
@@ -1732,8 +1732,8 @@
 <span class="sourceLineNo">1724</span>      Put putA = makePutFromRegionInfo(splitA);<a name="line.1724"></a>
 <span class="sourceLineNo">1725</span>      Put putB = makePutFromRegionInfo(splitB);<a name="line.1725"></a>
 <span class="sourceLineNo">1726</span><a name="line.1726"></a>
-<span class="sourceLineNo">1727</span>      addLocation(putA, sn, 1, -1, splitA.getReplicaId()); //new regions, openSeqNum = 1 is fine.<a name="line.1727"></a>
-<span class="sourceLineNo">1728</span>      addLocation(putB, sn, 1, -1, splitB.getReplicaId());<a name="line.1728"></a>
+<span class="sourceLineNo">1727</span>      addSequenceNum(putA, 1, -1, splitA.getReplicaId()); //new regions, openSeqNum = 1 is fine.<a name="line.1727"></a>
+<span class="sourceLineNo">1728</span>      addSequenceNum(putB, 1, -1, splitB.getReplicaId());<a name="line.1728"></a>
 <span class="sourceLineNo">1729</span><a name="line.1729"></a>
 <span class="sourceLineNo">1730</span>      // Add empty locations for region replicas of daughters so that number of replicas can be<a name="line.1730"></a>
 <span class="sourceLineNo">1731</span>      // cached whenever the primary region is looked up from meta<a name="line.1731"></a>
@@ -2108,143 +2108,152 @@
 <span class="sourceLineNo">2100</span>    return p.getClass().getSimpleName() + p.toJSON();<a name="line.2100"></a>
 <span class="sourceLineNo">2101</span>  }<a name="line.2101"></a>
 <span class="sourceLineNo">2102</span><a name="line.2102"></a>
-<span class="sourceLineNo">2103</span>  /**<a name="line.2103"></a>
-<span class="sourceLineNo">2104</span>   * Get replication position for a peer in a region.<a name="line.2104"></a>
-<span class="sourceLineNo">2105</span>   * @param connection connection we're using<a name="line.2105"></a>
-<span class="sourceLineNo">2106</span>   * @return the position of this peer, -1 if no position in meta.<a name="line.2106"></a>
-<span class="sourceLineNo">2107</span>   */<a name="line.2107"></a>
-<span class="sourceLineNo">2108</span>  public static long getReplicationPositionForOnePeer(Connection connection,<a name="line.2108"></a>
-<span class="sourceLineNo">2109</span>      byte[] encodedRegionName, String peerId) throws IOException {<a name="line.2109"></a>
-<span class="sourceLineNo">2110</span>    Get get = new Get(encodedRegionName);<a name="line.2110"></a>
-<span class="sourceLineNo">2111</span>    get.addColumn(HConstants.REPLICATION_POSITION_FAMILY, Bytes.toBytes(peerId));<a name="line.2111"></a>
-<span class="sourceLineNo">2112</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2112"></a>
-<span class="sourceLineNo">2113</span>    if (r.isEmpty()) {<a name="line.2113"></a>
-<span class="sourceLineNo">2114</span>      return -1;<a name="line.2114"></a>
-<span class="sourceLineNo">2115</span>    }<a name="line.2115"></a>
-<span class="sourceLineNo">2116</span>    Cell cell = r.rawCells()[0];<a name="line.2116"></a>
-<span class="sourceLineNo">2117</span>    return Bytes.toLong(cell.getValueArray(),cell.getValueOffset(),cell.getValueLength());<a name="line.2117"></a>
-<span class="sourceLineNo">2118</span>  }<a name="line.2118"></a>
-<span class="sourceLineNo">2119</span><a name="line.2119"></a>
-<span class="sourceLineNo">2120</span>  /**<a name="line.2120"></a>
-<span class="sourceLineNo">2121</span>   * Get replication positions for all peers in a region.<a name="line.2121"></a>
-<span class="sourceLineNo">2122</span>   * @param connection connection we're using<a name="line.2122"></a>
-<span class="sourceLineNo">2123</span>   * @param encodedRegionName region's encoded name<a name="line.2123"></a>
-<span class="sourceLineNo">2124</span>   * @return the map of positions for each peer<a name="line.2124"></a>
-<span class="sourceLineNo">2125</span>   */<a name="line.2125"></a>
-<span class="sourceLineNo">2126</span>  public static Map&lt;String, Long&gt; getReplicationPositionForAllPeer(Connection connection,<a name="line.2126"></a>
-<span class="sourceLineNo">2127</span>      byte[] encodedRegionName) throws IOException {<a name="line.2127"></a>
-<span class="sourceLineNo">2128</span>    Get get = new Get(encodedRegionName);<a name="line.2128"></a>
-<span class="sourceLineNo">2129</span>    get.addFamily(HConstants.REPLICATION_POSITION_FAMILY);<a name="line.2129"></a>
-<span class="sourceLineNo">2130</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2130"></a>
-<span class="sourceLineNo">2131</span>    Map&lt;String, Long&gt; map = new HashMap&lt;&gt;((int) (r.size() / 0.75 + 1));<a name="line.2131"></a>
-<span class="sourceLineNo">2132</span>    for (Cell c : r.listCells()) {<a name="line.2132"></a>
-<span class="sourceLineNo">2133</span>      map.put(<a name="line.2133"></a>
-<span class="sourceLineNo">2134</span>          Bytes.toString(c.getQualifierArray(), c.getQualifierOffset(), c.getQualifierLength()),<a name="line.2134"></a>
-<span class="sourceLineNo">2135</span>          Bytes.toLong(c.getValueArray(), c.getValueOffset(), c.getValueLength()));<a name="line.2135"></a>
-<span class="sourceLineNo">2136</span>    }<a name="line.2136"></a>
-<span class="sourceLineNo">2137</span>    return map;<a name="line.2137"></a>
-<span class="sourceLineNo">2138</span>  }<a name="line.2138"></a>
-<span class="sourceLineNo">2139</span><a name="line.2139"></a>
-<span class="sourceLineNo">2140</span>  /**<a name="line.2140"></a>
-<span class="sourceLineNo">2141</span>   * Get replication barriers for all peers in a region.<a name="line.2141"></a>
-<span class="sourceLineNo">2142</span>   * @param encodedRegionName region's encoded name<a name="line.2142"></a>
-<span class="sourceLineNo">2143</span>   * @return a list of barrier sequence numbers.<a name="line.2143"></a>
-<span class="sourceLineNo">2144</span>   * @throws IOException<a name="line.2144"></a>
-<span class="sourceLineNo">2145</span>   */<a name="line.2145"></a>
-<span class="sourceLineNo">2146</span>  public static List&lt;Long&gt; getReplicationBarriers(Connection connection, byte[] encodedRegionName)<a name="line.2146"></a>
-<span class="sourceLineNo">2147</span>      throws IOException {<a name="line.2147"></a>
-<span class="sourceLineNo">2148</span>    Get get = new Get(encodedRegionName);<a name="line.2148"></a>
-<span class="sourceLineNo">2149</span>    get.addFamily(HConstants.REPLICATION_BARRIER_FAMILY);<a name="line.2149"></a>
-<span class="sourceLineNo">2150</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2150"></a>
-<span class="sourceLineNo">2151</span>    List&lt;Long&gt; list = new ArrayList&lt;&gt;();<a name="line.2151"></a>
-<span class="sourceLineNo">2152</span>    if (!r.isEmpty()) {<a name="line.2152"></a>
-<span class="sourceLineNo">2153</span>      for (Cell cell : r.rawCells()) {<a name="line.2153"></a>
-<span class="sourceLineNo">2154</span>        list.add(Bytes.toLong(cell.getQualifierArray(), cell.getQualifierOffset(),<a name="line.2154"></a>
-<span class="sourceLineNo">2155</span>            cell.getQualifierLength()));<a name="line.2155"></a>
-<span class="sourceLineNo">2156</span>      }<a name="line.2156"></a>
-<span class="sourceLineNo">2157</span>    }<a name="line.2157"></a>
-<span class="sourceLineNo">2158</span>    return list;<a name="line.2158"></a>
-<span class="sourceLineNo">2159</span>  }<a name="line.2159"></a>
-<span class="sourceLineNo">2160</span><a name="line.2160"></a>
-<span class="sourceLineNo">2161</span>  /**<a name="line.2161"></a>
-<span class="sourceLineNo">2162</span>   * Get all barriers in all regions.<a name="line.2162"></a>
-<span class="sourceLineNo">2163</span>   * @return a map of barrier lists in all regions<a name="line.2163"></a>
-<span class="sourceLineNo">2164</span>   * @throws IOException<a name="line.2164"></a>
-<span class="sourceLineNo">2165</span>   */<a name="line.2165"></a>
-<span class="sourceLineNo">2166</span>  public static Map&lt;String, List&lt;Long&gt;&gt; getAllBarriers(Connection connection) throws IOException {<a name="line.2166"></a>
-<span class="sourceLineNo">2167</span>    Map&lt;String, List&lt;Long&gt;&gt; map = new HashMap&lt;&gt;();<a name="line.2167"></a>
-<span class="sourceLineNo">2168</span>    Scan scan = new Scan();<a name="line.2168"></a>
-<span class="sourceLineNo">2169</span>    scan.addFamily(HConstants.REPLICATION_BARRIER_FAMILY);<a name="line.2169"></a>
-<span class="sourceLineNo">2170</span>    try (Table t = getMetaHTable(connection);<a name="line.2170"></a>
-<span class="sourceLineNo">2171</span>        ResultScanner scanner = t.getScanner(scan)) {<a name="line.2171"></a>
-<span class="sourceLineNo">2172</span>      Result result;<a name="line.2172"></a>
-<span class="sourceLineNo">2173</span>      while ((result = scanner.next()) != null) {<a name="line.2173"></a>
-<span class="sourceLineNo">2174</span>        String key = Bytes.toString(result.getRow());<a name="line.2174"></a>
-<span class="sourceLineNo">2175</span>        List&lt;Long&gt; list = new ArrayList&lt;&gt;(result.rawCells().length);<a name="line.2175"></a>
-<span class="sourceLineNo">2176</span>        for (Cell cell : result.rawCells()) {<a name="line.2176"></a>
-<span class="sourceLineNo">2177</span>          list.add(Bytes.toLong(cell.getQualifierArray(), cell.getQualifierOffset(),<a name="line.2177"></a>
-<span class="sourceLineNo">2178</span>              cell.getQualifierLength()));<a name="line.2178"></a>
-<span class="sourceLineNo">2179</span>        }<a name="line.2179"></a>
-<span class="sourceLineNo">2180</span>        map.put(key, list);<a name="line.2180"></a>
-<span class="sourceLineNo">2181</span>      }<a name="line.2181"></a>
-<span class="sourceLineNo">2182</span>    }<a name="line.2182"></a>
-<span class="sourceLineNo">2183</span>    return map;<a name="line.2183"></a>
-<span class="sourceLineNo">2184</span>  }<a name="line.2184"></a>
-<span class="sourceLineNo">2185</span><a name="line.2185"></a>
-<span class="sourceLineNo">2186</span>  /**<a name="line.2186"></a>
-<span class="sourceLineNo">2187</span>   * Get daughter region(s) for a region, only used in serial replication.<a name="line.2187"></a>
-<span class="sourceLineNo">2188</span>   * @param connection connection we're using<a name="line.2188"></a>
-<span class="sourceLineNo">2189</span>   * @param encodedName region's encoded name<a name="line.2189"></a>
-<span class="sourceLineNo">2190</span>   * @throws IOException<a name="line.2190"></a>
-<span class="sourceLineNo">2191</span>   */<a name="line.2191"></a>
-<span class="sourceLineNo">2192</span>  public static String getSerialReplicationDaughterRegion(Connection connection, byte[] encodedName)<a name="line.2192"></a>
-<span class="sourceLineNo">2193</span>      throws IOException {<a name="line.2193"></a>
-<span class="sourceLineNo">2194</span>    Get get = new Get(encodedName);<a name="line.2194"></a>
-<span class="sourceLineNo">2195</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, daughterNameCq);<a name="line.2195"></a>
-<span class="sourceLineNo">2196</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2196"></a>
-<span class="sourceLineNo">2197</span>    if (!result.isEmpty()) {<a name="line.2197"></a>
-<span class="sourceLineNo">2198</span>      Cell c = result.rawCells()[0];<a name="line.2198"></a>
-<span class="sourceLineNo">2199</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2199"></a>
-<span class="sourceLineNo">2200</span>    }<a name="line.2200"></a>
-<span class="sourceLineNo">2201</span>    return null;<a name="line.2201"></a>
-<span class="sourceLineNo">2202</span>  }<a name="line.2202"></a>
-<span class="sourceLineNo">2203</span><a name="line.2203"></a>
-<span class="sourceLineNo">2204</span>  /**<a name="line.2204"></a>
-<span class="sourceLineNo">2205</span>   * Get parent region(s) for a region, only used in serial replication.<a name="line.2205"></a>
-<span class="sourceLineNo">2206</span>   * @param connection connection we're using<a name="line.2206"></a>
-<span class="sourceLineNo">2207</span>   * @param encodedName region's encoded name<a name="line.2207"></a>
-<span class="sourceLineNo">2208</span>   * @throws IOException<a name="line.2208"></a>
-<span class="sourceLineNo">2209</span>   */<a name="line.2209"></a>
-<span class="sourceLineNo">2210</span>  public static String getSerialReplicationParentRegion(Connection connection, byte[] encodedName)<a name="line.2210"></a>
-<span class="sourceLineNo">2211</span>      throws IOException {<a name="line.2211"></a>
-<span class="sourceLineNo">2212</span>    Get get = new Get(encodedName);<a name="line.2212"></a>
-<span class="sourceLineNo">2213</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, parentNameCq);<a name="line.2213"></a>
-<span class="sourceLineNo">2214</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2214"></a>
-<span class="sourceLineNo">2215</span>    if (!result.isEmpty()) {<a name="line.2215"></a>
-<span class="sourceLineNo">2216</span>      Cell c = result.rawCells()[0];<a name="line.2216"></a>
-<span class="sourceLineNo">2217</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2217"></a>
-<span class="sourceLineNo">2218</span>    }<a name="line.2218"></a>
-<span class="sourceLineNo">2219</span>    return null;<a name="line.2219"></a>
-<span class="sourceLineNo">2220</span>  }<a name="line.2220"></a>
-<span class="sourceLineNo">2221</span><a name="line.2221"></a>
-<span class="sourceLineNo">2222</span>  /**<a name="line.2222"></a>
-<span class="sourceLineNo">2223</span>   * Get the table name for a region, only used in serial replication.<a name="line.2223"></a>
-<span class="sourceLineNo">2224</span>   * @param connection connection we're using<a name="line.2224"></a>
-<span class="sourceLineNo">2225</span>   * @param encodedName region's encoded name<a name="line.2225"></a>
-<span class="sourceLineNo">2226</span>   * @throws IOException<a name="line.2226"></a>
-<span class="sourceLineNo">2227</span>   */<a name="line.2227"></a>
-<span class="sourceLineNo">2228</span>  public static String getSerialReplicationTableName(Connection connection, byte[] encodedName)<a name="line.2228"></a>
-<span class="sourceLineNo">2229</span>      throws IOException {<a name="line.2229"></a>
-<span class="sourceLineNo">2230</span>    Get get = new Get(encodedName);<a name="line.2230"></a>
-<span class="sourceLineNo">2231</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, tableNameCq);<a name="line.2231"></a>
-<span class="sourceLineNo">2232</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2232"></a>
-<span class="sourceLineNo">2233</span>    if (!result.isEmpty()) {<a name="line.2233"></a>
-<span class="sourceLineNo">2234</span>      Cell c = result.rawCells()[0];<a name="line.2234"></a>
-<span class="sourceLineNo">2235</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2235"></a>
-<span class="sourceLineNo">2236</span>    }<a name="line.2236"></a>
-<span class="sourceLineNo">2237</span>    return null;<a name="line.2237"></a>
-<span class="sourceLineNo">2238</span>  }<a name="line.2238"></a>
-<span class="sourceLineNo">2239</span>}<a name="line.2239"></a>
+<span class="sourceLineNo">2103</span>  public static Put addSequenceNum(final Put p, long openSeqNum, long time, int replicaId) {<a name="line.2103"></a>
+<span class="sourceLineNo">2104</span>    if (time &lt;= 0) {<a name="line.2104"></a>
+<span class="sourceLineNo">2105</span>      time = EnvironmentEdgeManager.currentTime();<a name="line.2105"></a>
+<span class="sourceLineNo">2106</span>    }<a name="line.2106"></a>
+<span class="sourceLineNo">2107</span>    p.addImmutable(HConstants.CATALOG_FAMILY, getSeqNumColumn(replicaId), time,<a name="line.2107"></a>
+<span class="sourceLineNo">2108</span>      Bytes.toBytes(openSeqNum));<a name="line.2108"></a>
+<span class="sourceLineNo">2109</span>    return p;<a name="line.2109"></a>
+<span class="sourceLineNo">2110</span>  }<a name="line.2110"></a>
+<span class="sourceLineNo">2111</span><a name="line.2111"></a>
+<span class="sourceLineNo">2112</span>  /**<a name="line.2112"></a>
+<span class="sourceLineNo">2113</span>   * Get replication position for a peer in a region.<a name="line.2113"></a>
+<span class="sourceLineNo">2114</span>   * @param connection connection we're using<a name="line.2114"></a>
+<span class="sourceLineNo">2115</span>   * @return the position of this peer, -1 if no position in meta.<a name="line.2115"></a>
+<span class="sourceLineNo">2116</span>   */<a name="line.2116"></a>
+<span class="sourceLineNo">2117</span>  public static long getReplicationPositionForOnePeer(Connection connection,<a name="line.2117"></a>
+<span class="sourceLineNo">2118</span>      byte[] encodedRegionName, String peerId) throws IOException {<a name="line.2118"></a>
+<span class="sourceLineNo">2119</span>    Get get = new Get(encodedRegionName);<a name="line.2119"></a>
+<span class="sourceLineNo">2120</span>    get.addColumn(HConstants.REPLICATION_POSITION_FAMILY, Bytes.toBytes(peerId));<a name="line.2120"></a>
+<span class="sourceLineNo">2121</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2121"></a>
+<span class="sourceLineNo">2122</span>    if (r.isEmpty()) {<a name="line.2122"></a>
+<span class="sourceLineNo">2123</span>      return -1;<a name="line.2123"></a>
+<span class="sourceLineNo">2124</span>    }<a name="line.2124"></a>
+<span class="sourceLineNo">2125</span>    Cell cell = r.rawCells()[0];<a name="line.2125"></a>
+<span class="sourceLineNo">2126</span>    return Bytes.toLong(cell.getValueArray(),cell.getValueOffset(),cell.getValueLength());<a name="line.2126"></a>
+<span class="sourceLineNo">2127</span>  }<a name="line.2127"></a>
+<span class="sourceLineNo">2128</span><a name="line.2128"></a>
+<span class="sourceLineNo">2129</span>  /**<a name="line.2129"></a>
+<span class="sourceLineNo">2130</span>   * Get replication positions for all peers in a region.<a name="line.2130"></a>
+<span class="sourceLineNo">2131</span>   * @param connection connection we're using<a name="line.2131"></a>
+<span class="sourceLineNo">2132</span>   * @param encodedRegionName region's encoded name<a name="line.2132"></a>
+<span class="sourceLineNo">2133</span>   * @return the map of positions for each peer<a name="line.2133"></a>
+<span class="sourceLineNo">2134</span>   */<a name="line.2134"></a>
+<span class="sourceLineNo">2135</span>  public static Map&lt;String, Long&gt; getReplicationPositionForAllPeer(Connection connection,<a name="line.2135"></a>
+<span class="sourceLineNo">2136</span>      byte[] encodedRegionName) throws IOException {<a name="line.2136"></a>
+<span class="sourceLineNo">2137</span>    Get get = new Get(encodedRegionName);<a name="line.2137"></a>
+<span class="sourceLineNo">2138</span>    get.addFamily(HConstants.REPLICATION_POSITION_FAMILY);<a name="line.2138"></a>
+<span class="sourceLineNo">2139</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2139"></a>
+<span class="sourceLineNo">2140</span>    Map&lt;String, Long&gt; map = new HashMap&lt;&gt;((int) (r.size() / 0.75 + 1));<a name="line.2140"></a>
+<span class="sourceLineNo">2141</span>    for (Cell c : r.listCells()) {<a name="line.2141"></a>
+<span class="sourceLineNo">2142</span>      map.put(<a name="line.2142"></a>
+<span class="sourceLineNo">2143</span>          Bytes.toString(c.getQualifierArray(), c.getQualifierOffset(), c.getQualifierLength()),<a name="line.2143"></a>
+<span class="sourceLineNo">2144</span>          Bytes.toLong(c.getValueArray(), c.getValueOffset(), c.getValueLength()));<a name="line.2144"></a>
+<span class="sourceLineNo">2145</span>    }<a name="line.2145"></a>
+<span class="sourceLineNo">2146</span>    return map;<a name="line.2146"></a>
+<span class="sourceLineNo">2147</span>  }<a name="line.2147"></a>
+<span class="sourceLineNo">2148</span><a name="line.2148"></a>
+<span class="sourceLineNo">2149</span>  /**<a name="line.2149"></a>
+<span class="sourceLineNo">2150</span>   * Get replication barriers for all peers in a region.<a name="line.2150"></a>
+<span class="sourceLineNo">2151</span>   * @param encodedRegionName region's encoded name<a name="line.2151"></a>
+<span class="sourceLineNo">2152</span>   * @return a list of barrier sequence numbers.<a name="line.2152"></a>
+<span class="sourceLineNo">2153</span>   * @throws IOException<a name="line.2153"></a>
+<span class="sourceLineNo">2154</span>   */<a name="line.2154"></a>
+<span class="sourceLineNo">2155</span>  public static List&lt;Long&gt; getReplicationBarriers(Connection connection, byte[] encodedRegionName)<a name="line.2155"></a>
+<span class="sourceLineNo">2156</span>      throws IOException {<a name="line.2156"></a>
+<span class="sourceLineNo">2157</span>    Get get = new Get(encodedRegionName);<a name="line.2157"></a>
+<span class="sourceLineNo">2158</span>    get.addFamily(HConstants.REPLICATION_BARRIER_FAMILY);<a name="line.2158"></a>
+<span class="sourceLineNo">2159</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2159"></a>
+<span class="sourceLineNo">2160</span>    List&lt;Long&gt; list = new ArrayList&lt;&gt;();<a name="line.2160"></a>
+<span class="sourceLineNo">2161</span>    if (!r.isEmpty()) {<a name="line.2161"></a>
+<span class="sourceLineNo">2162</span>      for (Cell cell : r.rawCells()) {<a name="line.2162"></a>
+<span class="sourceLineNo">2163</span>        list.add(Bytes.toLong(cell.getQualifierArray(), cell.getQualifierOffset(),<a name="line.2163"></a>
+<span class="sourceLineNo">2164</span>            cell.getQualifierLength()));<a name="line.2164"></a>
+<span class="sourceLineNo">2165</span>      }<a name="line.2165"></a>
+<span class="sourceLineNo">2166</span>    }<a name="line.2166"></a>
+<span class="sourceLineNo">2167</span>    return list;<a name="line.2167"></a>
+<span class="sourceLineNo">2168</span>  }<a name="line.2168"></a>
+<span class="sourceLineNo">2169</span><a name="line.2169"></a>
+<span class="sourceLineNo">2170</span>  /**<a name="line.2170"></a>
+<span class="sourceLineNo">2171</span>   * Get all barriers in all regions.<a name="line.2171"></a>
+<span class="sourceLineNo">2172</span>   * @return a map of barrier lists in all regions<a name="line.2172"></a>
+<span class="sourceLineNo">2173</span>   * @throws IOException<a name="line.2173"></a>
+<span class="sourceLineNo">2174</span>   */<a name="line.2174"></a>
+<span class="sourceLineNo">2175</span>  public static Map&lt;String, List&lt;Long&gt;&gt; getAllBarriers(Connection connection) throws IOException {<a name="line.2175"></a>
+<span class="sourceLineNo">2176</span>    Map&lt;String, List&lt;Long&gt;&gt; map = new HashMap&lt;&gt;();<a name="line.2176"></a>
+<span class="sourceLineNo">2177</span>    Scan scan = new Scan();<a name="line.2177"></a>
+<span class="sourceLineNo">2178</span>    scan.addFamily(HConstants.REPLICATION_BARRIER_FAMILY);<a name="line.2178"></a>
+<span class="sourceLineNo">2179</span>    try (Table t = getMetaHTable(connection);<a name="line.2179"></a>
+<span class="sourceLineNo">2180</span>        ResultScanner scanner = t.getScanner(scan)) {<a name="line.2180"></a>
+<span class="sourceLineNo">2181</span>      Result result;<a name="line.2181"></a>
+<span class="sourceLineNo">2182</span>      while ((result = scanner.next()) != null) {<a name="line.2182"></a>
+<span class="sourceLineNo">2183</span>        String key = Bytes.toString(result.getRow());<a name="line.2183"></a>
+<span class="sourceLineNo">2184</span>        List&lt;Long&gt; list = new ArrayList&lt;&gt;(result.rawCells().length);<a name="line.2184"></a>
+<span class="sourceLineNo">2185</span>        for (Cell cell : result.rawCells()) {<a name="line.2185"></a>
+<span class="sourceLineNo">2186</span>          list.add(Bytes.toLong(cell.getQualifierArray(), cell.getQualifierOffset(),<a name="line.2186"></a>
+<span class="sourceLineNo">2187</span>              cell.getQualifierLength()));<a name="line.2187"></a>
+<span class="sourceLineNo">2188</span>        }<a name="line.2188"></a>
+<span class="sourceLineNo">2189</span>        map.put(key, list);<a name="line.2189"></a>
+<span class="sourceLineNo">2190</span>      }<a name="line.2190"></a>
+<span class="sourceLineNo">2191</span>    }<a name="line.2191"></a>
+<span class="sourceLineNo">2192</span>    return map;<a name="line.2192"></a>
+<span class="sourceLineNo">2193</span>  }<a name="line.2193"></a>
+<span class="sourceLineNo">2194</span><a name="line.2194"></a>
+<span class="sourceLineNo">2195</span>  /**<a name="line.2195"></a>
+<span class="sourceLineNo">2196</span>   * Get daughter region(s) for a region, only used in serial replication.<a name="line.2196"></a>
+<span class="sourceLineNo">2197</span>   * @param connection connection we're using<a name="line.2197"></a>
+<span class="sourceLineNo">2198</span>   * @param encodedName region's encoded name<a name="line.2198"></a>
+<span class="sourceLineNo">2199</span>   * @throws IOException<a name="line.2199"></a>
+<span class="sourceLineNo">2200</span>   */<a name="line.2200"></a>
+<span class="sourceLineNo">2201</span>  public static String getSerialReplicationDaughterRegion(Connection connection, byte[] encodedName)<a name="line.2201"></a>
+<span class="sourceLineNo">2202</span>      throws IOException {<a name="line.2202"></a>
+<span class="sourceLineNo">2203</span>    Get get = new Get(encodedName);<a name="line.2203"></a>
+<span class="sourceLineNo">2204</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, daughterNameCq);<a name="line.2204"></a>
+<span class="sourceLineNo">2205</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2205"></a>
+<span class="sourceLineNo">2206</span>    if (!result.isEmpty()) {<a name="line.2206"></a>
+<span class="sourceLineNo">2207</span>      Cell c = result.rawCells()[0];<a name="line.2207"></a>
+<span class="sourceLineNo">2208</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2208"></a>
+<span class="sourceLineNo">2209</span>    }<a name="line.2209"></a>
+<span class="sourceLineNo">2210</span>    return null;<a name="line.2210"></a>
+<span class="sourceLineNo">2211</span>  }<a name="line.2211"></a>
+<span class="sourceLineNo">2212</span><a name="line.2212"></a>
+<span class="sourceLineNo">2213</span>  /**<a name="line.2213"></a>
+<span class="sourceLineNo">2214</span>   * Get parent region(s) for a region, only used in serial replication.<a name="line.2214"></a>
+<span class="sourceLineNo">2215</span>   * @param connection connection we're using<a name="line.2215"></a>
+<span class="sourceLineNo">2216</span>   * @param encodedName region's encoded name<a name="line.2216"></a>
+<span class="sourceLineNo">2217</span>   * @throws IOException<a name="line.2217"></a>
+<span class="sourceLineNo">2218</span>   */<a name="line.2218"></a>
+<span class="sourceLineNo">2219</span>  public static String getSerialReplicationParentRegion(Connection connection, byte[] encodedName)<a name="line.2219"></a>
+<span class="sourceLineNo">2220</span>      throws IOException {<a name="line.2220"></a>
+<span class="sourceLineNo">2221</span>    Get get = new Get(encodedName);<a name="line.2221"></a>
+<span class="sourceLineNo">2222</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, parentNameCq);<a name="line.2222"></a>
+<span class="sourceLineNo">2223</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2223"></a>
+<span class="sourceLineNo">2224</span>    if (!result.isEmpty()) {<a name="line.2224"></a>
+<span class="sourceLineNo">2225</span>      Cell c = result.rawCells()[0];<a name="line.2225"></a>
+<span class="sourceLineNo">2226</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2226"></a>
+<span class="sourceLineNo">2227</span>    }<a name="line.2227"></a>
+<span class="sourceLineNo">2228</span>    return null;<a name="line.2228"></a>
+<span class="sourceLineNo">2229</span>  }<a name="line.2229"></a>
+<span class="sourceLineNo">2230</span><a name="line.2230"></a>
+<span class="sourceLineNo">2231</span>  /**<a name="line.2231"></a>
+<span class="sourceLineNo">2232</span>   * Get the table name for a region, only used in serial replication.<a name="line.2232"></a>
+<span class="sourceLineNo">2233</span>   * @param connection connection we're using<a name="line.2233"></a>
+<span class="sourceLineNo">2234</span>   * @param encodedName region's encoded name<a name="line.2234"></a>
+<span class="sourceLineNo">2235</span>   * @throws IOException<a name="line.2235"></a>
+<span class="sourceLineNo">2236</span>   */<a name="line.2236"></a>
+<span class="sourceLineNo">2237</span>  public static String getSerialReplicationTableName(Connection connection, byte[] encodedName)<a name="line.2237"></a>
+<span class="sourceLineNo">2238</span>      throws IOException {<a name="line.2238"></a>
+<span class="sourceLineNo">2239</span>    Get get = new Get(encodedName);<a name="line.2239"></a>
+<span class="sourceLineNo">2240</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, tableNameCq);<a name="line.2240"></a>
+<span class="sourceLineNo">2241</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2241"></a>
+<span class="sourceLineNo">2242</span>    if (!result.isEmpty()) {<a name="line.2242"></a>
+<span class="sourceLineNo">2243</span>      Cell c = result.rawCells()[0];<a name="line.2243"></a>
+<span class="sourceLineNo">2244</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2244"></a>
+<span class="sourceLineNo">2245</span>    }<a name="line.2245"></a>
+<span class="sourceLineNo">2246</span>    return null;<a name="line.2246"></a>
+<span class="sourceLineNo">2247</span>  }<a name="line.2247"></a>
+<span class="sourceLineNo">2248</span>}<a name="line.2248"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/7d90d02f/devapidocs/src-html/org/apache/hadoop/hbase/MetaTableAccessor.Visitor.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/MetaTableAccessor.Visitor.html b/devapidocs/src-html/org/apache/hadoop/hbase/MetaTableAccessor.Visitor.html
index 2e2767b..a634c1e 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/MetaTableAccessor.Visitor.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/MetaTableAccessor.Visitor.html
@@ -1732,8 +1732,8 @@
 <span class="sourceLineNo">1724</span>      Put putA = makePutFromRegionInfo(splitA);<a name="line.1724"></a>
 <span class="sourceLineNo">1725</span>      Put putB = makePutFromRegionInfo(splitB);<a name="line.1725"></a>
 <span class="sourceLineNo">1726</span><a name="line.1726"></a>
-<span class="sourceLineNo">1727</span>      addLocation(putA, sn, 1, -1, splitA.getReplicaId()); //new regions, openSeqNum = 1 is fine.<a name="line.1727"></a>
-<span class="sourceLineNo">1728</span>      addLocation(putB, sn, 1, -1, splitB.getReplicaId());<a name="line.1728"></a>
+<span class="sourceLineNo">1727</span>      addSequenceNum(putA, 1, -1, splitA.getReplicaId()); //new regions, openSeqNum = 1 is fine.<a name="line.1727"></a>
+<span class="sourceLineNo">1728</span>      addSequenceNum(putB, 1, -1, splitB.getReplicaId());<a name="line.1728"></a>
 <span class="sourceLineNo">1729</span><a name="line.1729"></a>
 <span class="sourceLineNo">1730</span>      // Add empty locations for region replicas of daughters so that number of replicas can be<a name="line.1730"></a>
 <span class="sourceLineNo">1731</span>      // cached whenever the primary region is looked up from meta<a name="line.1731"></a>
@@ -2108,143 +2108,152 @@
 <span class="sourceLineNo">2100</span>    return p.getClass().getSimpleName() + p.toJSON();<a name="line.2100"></a>
 <span class="sourceLineNo">2101</span>  }<a name="line.2101"></a>
 <span class="sourceLineNo">2102</span><a name="line.2102"></a>
-<span class="sourceLineNo">2103</span>  /**<a name="line.2103"></a>
-<span class="sourceLineNo">2104</span>   * Get replication position for a peer in a region.<a name="line.2104"></a>
-<span class="sourceLineNo">2105</span>   * @param connection connection we're using<a name="line.2105"></a>
-<span class="sourceLineNo">2106</span>   * @return the position of this peer, -1 if no position in meta.<a name="line.2106"></a>
-<span class="sourceLineNo">2107</span>   */<a name="line.2107"></a>
-<span class="sourceLineNo">2108</span>  public static long getReplicationPositionForOnePeer(Connection connection,<a name="line.2108"></a>
-<span class="sourceLineNo">2109</span>      byte[] encodedRegionName, String peerId) throws IOException {<a name="line.2109"></a>
-<span class="sourceLineNo">2110</span>    Get get = new Get(encodedRegionName);<a name="line.2110"></a>
-<span class="sourceLineNo">2111</span>    get.addColumn(HConstants.REPLICATION_POSITION_FAMILY, Bytes.toBytes(peerId));<a name="line.2111"></a>
-<span class="sourceLineNo">2112</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2112"></a>
-<span class="sourceLineNo">2113</span>    if (r.isEmpty()) {<a name="line.2113"></a>
-<span class="sourceLineNo">2114</span>      return -1;<a name="line.2114"></a>
-<span class="sourceLineNo">2115</span>    }<a name="line.2115"></a>
-<span class="sourceLineNo">2116</span>    Cell cell = r.rawCells()[0];<a name="line.2116"></a>
-<span class="sourceLineNo">2117</span>    return Bytes.toLong(cell.getValueArray(),cell.getValueOffset(),cell.getValueLength());<a name="line.2117"></a>
-<span class="sourceLineNo">2118</span>  }<a name="line.2118"></a>
-<span class="sourceLineNo">2119</span><a name="line.2119"></a>
-<span class="sourceLineNo">2120</span>  /**<a name="line.2120"></a>
-<span class="sourceLineNo">2121</span>   * Get replication positions for all peers in a region.<a name="line.2121"></a>
-<span class="sourceLineNo">2122</span>   * @param connection connection we're using<a name="line.2122"></a>
-<span class="sourceLineNo">2123</span>   * @param encodedRegionName region's encoded name<a name="line.2123"></a>
-<span class="sourceLineNo">2124</span>   * @return the map of positions for each peer<a name="line.2124"></a>
-<span class="sourceLineNo">2125</span>   */<a name="line.2125"></a>
-<span class="sourceLineNo">2126</span>  public static Map&lt;String, Long&gt; getReplicationPositionForAllPeer(Connection connection,<a name="line.2126"></a>
-<span class="sourceLineNo">2127</span>      byte[] encodedRegionName) throws IOException {<a name="line.2127"></a>
-<span class="sourceLineNo">2128</span>    Get get = new Get(encodedRegionName);<a name="line.2128"></a>
-<span class="sourceLineNo">2129</span>    get.addFamily(HConstants.REPLICATION_POSITION_FAMILY);<a name="line.2129"></a>
-<span class="sourceLineNo">2130</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2130"></a>
-<span class="sourceLineNo">2131</span>    Map&lt;String, Long&gt; map = new HashMap&lt;&gt;((int) (r.size() / 0.75 + 1));<a name="line.2131"></a>
-<span class="sourceLineNo">2132</span>    for (Cell c : r.listCells()) {<a name="line.2132"></a>
-<span class="sourceLineNo">2133</span>      map.put(<a name="line.2133"></a>
-<span class="sourceLineNo">2134</span>          Bytes.toString(c.getQualifierArray(), c.getQualifierOffset(), c.getQualifierLength()),<a name="line.2134"></a>
-<span class="sourceLineNo">2135</span>          Bytes.toLong(c.getValueArray(), c.getValueOffset(), c.getValueLength()));<a name="line.2135"></a>
-<span class="sourceLineNo">2136</span>    }<a name="line.2136"></a>
-<span class="sourceLineNo">2137</span>    return map;<a name="line.2137"></a>
-<span class="sourceLineNo">2138</span>  }<a name="line.2138"></a>
-<span class="sourceLineNo">2139</span><a name="line.2139"></a>
-<span class="sourceLineNo">2140</span>  /**<a name="line.2140"></a>
-<span class="sourceLineNo">2141</span>   * Get replication barriers for all peers in a region.<a name="line.2141"></a>
-<span class="sourceLineNo">2142</span>   * @param encodedRegionName region's encoded name<a name="line.2142"></a>
-<span class="sourceLineNo">2143</span>   * @return a list of barrier sequence numbers.<a name="line.2143"></a>
-<span class="sourceLineNo">2144</span>   * @throws IOException<a name="line.2144"></a>
-<span class="sourceLineNo">2145</span>   */<a name="line.2145"></a>
-<span class="sourceLineNo">2146</span>  public static List&lt;Long&gt; getReplicationBarriers(Connection connection, byte[] encodedRegionName)<a name="line.2146"></a>
-<span class="sourceLineNo">2147</span>      throws IOException {<a name="line.2147"></a>
-<span class="sourceLineNo">2148</span>    Get get = new Get(encodedRegionName);<a name="line.2148"></a>
-<span class="sourceLineNo">2149</span>    get.addFamily(HConstants.REPLICATION_BARRIER_FAMILY);<a name="line.2149"></a>
-<span class="sourceLineNo">2150</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2150"></a>
-<span class="sourceLineNo">2151</span>    List&lt;Long&gt; list = new ArrayList&lt;&gt;();<a name="line.2151"></a>
-<span class="sourceLineNo">2152</span>    if (!r.isEmpty()) {<a name="line.2152"></a>
-<span class="sourceLineNo">2153</span>      for (Cell cell : r.rawCells()) {<a name="line.2153"></a>
-<span class="sourceLineNo">2154</span>        list.add(Bytes.toLong(cell.getQualifierArray(), cell.getQualifierOffset(),<a name="line.2154"></a>
-<span class="sourceLineNo">2155</span>            cell.getQualifierLength()));<a name="line.2155"></a>
-<span class="sourceLineNo">2156</span>      }<a name="line.2156"></a>
-<span class="sourceLineNo">2157</span>    }<a name="line.2157"></a>
-<span class="sourceLineNo">2158</span>    return list;<a name="line.2158"></a>
-<span class="sourceLineNo">2159</span>  }<a name="line.2159"></a>
-<span class="sourceLineNo">2160</span><a name="line.2160"></a>
-<span class="sourceLineNo">2161</span>  /**<a name="line.2161"></a>
-<span class="sourceLineNo">2162</span>   * Get all barriers in all regions.<a name="line.2162"></a>
-<span class="sourceLineNo">2163</span>   * @return a map of barrier lists in all regions<a name="line.2163"></a>
-<span class="sourceLineNo">2164</span>   * @throws IOException<a name="line.2164"></a>
-<span class="sourceLineNo">2165</span>   */<a name="line.2165"></a>
-<span class="sourceLineNo">2166</span>  public static Map&lt;String, List&lt;Long&gt;&gt; getAllBarriers(Connection connection) throws IOException {<a name="line.2166"></a>
-<span class="sourceLineNo">2167</span>    Map&lt;String, List&lt;Long&gt;&gt; map = new HashMap&lt;&gt;();<a name="line.2167"></a>
-<span class="sourceLineNo">2168</span>    Scan scan = new Scan();<a name="line.2168"></a>
-<span class="sourceLineNo">2169</span>    scan.addFamily(HConstants.REPLICATION_BARRIER_FAMILY);<a name="line.2169"></a>
-<span class="sourceLineNo">2170</span>    try (Table t = getMetaHTable(connection);<a name="line.2170"></a>
-<span class="sourceLineNo">2171</span>        ResultScanner scanner = t.getScanner(scan)) {<a name="line.2171"></a>
-<span class="sourceLineNo">2172</span>      Result result;<a name="line.2172"></a>
-<span class="sourceLineNo">2173</span>      while ((result = scanner.next()) != null) {<a name="line.2173"></a>
-<span class="sourceLineNo">2174</span>        String key = Bytes.toString(result.getRow());<a name="line.2174"></a>
-<span class="sourceLineNo">2175</span>        List&lt;Long&gt; list = new ArrayList&lt;&gt;(result.rawCells().length);<a name="line.2175"></a>
-<span class="sourceLineNo">2176</span>        for (Cell cell : result.rawCells()) {<a name="line.2176"></a>
-<span class="sourceLineNo">2177</span>          list.add(Bytes.toLong(cell.getQualifierArray(), cell.getQualifierOffset(),<a name="line.2177"></a>
-<span class="sourceLineNo">2178</span>              cell.getQualifierLength()));<a name="line.2178"></a>
-<span class="sourceLineNo">2179</span>        }<a name="line.2179"></a>
-<span class="sourceLineNo">2180</span>        map.put(key, list);<a name="line.2180"></a>
-<span class="sourceLineNo">2181</span>      }<a name="line.2181"></a>
-<span class="sourceLineNo">2182</span>    }<a name="line.2182"></a>
-<span class="sourceLineNo">2183</span>    return map;<a name="line.2183"></a>
-<span class="sourceLineNo">2184</span>  }<a name="line.2184"></a>
-<span class="sourceLineNo">2185</span><a name="line.2185"></a>
-<span class="sourceLineNo">2186</span>  /**<a name="line.2186"></a>
-<span class="sourceLineNo">2187</span>   * Get daughter region(s) for a region, only used in serial replication.<a name="line.2187"></a>
-<span class="sourceLineNo">2188</span>   * @param connection connection we're using<a name="line.2188"></a>
-<span class="sourceLineNo">2189</span>   * @param encodedName region's encoded name<a name="line.2189"></a>
-<span class="sourceLineNo">2190</span>   * @throws IOException<a name="line.2190"></a>
-<span class="sourceLineNo">2191</span>   */<a name="line.2191"></a>
-<span class="sourceLineNo">2192</span>  public static String getSerialReplicationDaughterRegion(Connection connection, byte[] encodedName)<a name="line.2192"></a>
-<span class="sourceLineNo">2193</span>      throws IOException {<a name="line.2193"></a>
-<span class="sourceLineNo">2194</span>    Get get = new Get(encodedName);<a name="line.2194"></a>
-<span class="sourceLineNo">2195</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, daughterNameCq);<a name="line.2195"></a>
-<span class="sourceLineNo">2196</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2196"></a>
-<span class="sourceLineNo">2197</span>    if (!result.isEmpty()) {<a name="line.2197"></a>
-<span class="sourceLineNo">2198</span>      Cell c = result.rawCells()[0];<a name="line.2198"></a>
-<span class="sourceLineNo">2199</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2199"></a>
-<span class="sourceLineNo">2200</span>    }<a name="line.2200"></a>
-<span class="sourceLineNo">2201</span>    return null;<a name="line.2201"></a>
-<span class="sourceLineNo">2202</span>  }<a name="line.2202"></a>
-<span class="sourceLineNo">2203</span><a name="line.2203"></a>
-<span class="sourceLineNo">2204</span>  /**<a name="line.2204"></a>
-<span class="sourceLineNo">2205</span>   * Get parent region(s) for a region, only used in serial replication.<a name="line.2205"></a>
-<span class="sourceLineNo">2206</span>   * @param connection connection we're using<a name="line.2206"></a>
-<span class="sourceLineNo">2207</span>   * @param encodedName region's encoded name<a name="line.2207"></a>
-<span class="sourceLineNo">2208</span>   * @throws IOException<a name="line.2208"></a>
-<span class="sourceLineNo">2209</span>   */<a name="line.2209"></a>
-<span class="sourceLineNo">2210</span>  public static String getSerialReplicationParentRegion(Connection connection, byte[] encodedName)<a name="line.2210"></a>
-<span class="sourceLineNo">2211</span>      throws IOException {<a name="line.2211"></a>
-<span class="sourceLineNo">2212</span>    Get get = new Get(encodedName);<a name="line.2212"></a>
-<span class="sourceLineNo">2213</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, parentNameCq);<a name="line.2213"></a>
-<span class="sourceLineNo">2214</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2214"></a>
-<span class="sourceLineNo">2215</span>    if (!result.isEmpty()) {<a name="line.2215"></a>
-<span class="sourceLineNo">2216</span>      Cell c = result.rawCells()[0];<a name="line.2216"></a>
-<span class="sourceLineNo">2217</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2217"></a>
-<span class="sourceLineNo">2218</span>    }<a name="line.2218"></a>
-<span class="sourceLineNo">2219</span>    return null;<a name="line.2219"></a>
-<span class="sourceLineNo">2220</span>  }<a name="line.2220"></a>
-<span class="sourceLineNo">2221</span><a name="line.2221"></a>
-<span class="sourceLineNo">2222</span>  /**<a name="line.2222"></a>
-<span class="sourceLineNo">2223</span>   * Get the table name for a region, only used in serial replication.<a name="line.2223"></a>
-<span class="sourceLineNo">2224</span>   * @param connection connection we're using<a name="line.2224"></a>
-<span class="sourceLineNo">2225</span>   * @param encodedName region's encoded name<a name="line.2225"></a>
-<span class="sourceLineNo">2226</span>   * @throws IOException<a name="line.2226"></a>
-<span class="sourceLineNo">2227</span>   */<a name="line.2227"></a>
-<span class="sourceLineNo">2228</span>  public static String getSerialReplicationTableName(Connection connection, byte[] encodedName)<a name="line.2228"></a>
-<span class="sourceLineNo">2229</span>      throws IOException {<a name="line.2229"></a>
-<span class="sourceLineNo">2230</span>    Get get = new Get(encodedName);<a name="line.2230"></a>
-<span class="sourceLineNo">2231</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, tableNameCq);<a name="line.2231"></a>
-<span class="sourceLineNo">2232</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2232"></a>
-<span class="sourceLineNo">2233</span>    if (!result.isEmpty()) {<a name="line.2233"></a>
-<span class="sourceLineNo">2234</span>      Cell c = result.rawCells()[0];<a name="line.2234"></a>
-<span class="sourceLineNo">2235</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2235"></a>
-<span class="sourceLineNo">2236</span>    }<a name="line.2236"></a>
-<span class="sourceLineNo">2237</span>    return null;<a name="line.2237"></a>
-<span class="sourceLineNo">2238</span>  }<a name="line.2238"></a>
-<span class="sourceLineNo">2239</span>}<a name="line.2239"></a>
+<span class="sourceLineNo">2103</span>  public static Put addSequenceNum(final Put p, long openSeqNum, long time, int replicaId) {<a name="line.2103"></a>
+<span class="sourceLineNo">2104</span>    if (time &lt;= 0) {<a name="line.2104"></a>
+<span class="sourceLineNo">2105</span>      time = EnvironmentEdgeManager.currentTime();<a name="line.2105"></a>
+<span class="sourceLineNo">2106</span>    }<a name="line.2106"></a>
+<span class="sourceLineNo">2107</span>    p.addImmutable(HConstants.CATALOG_FAMILY, getSeqNumColumn(replicaId), time,<a name="line.2107"></a>
+<span class="sourceLineNo">2108</span>      Bytes.toBytes(openSeqNum));<a name="line.2108"></a>
+<span class="sourceLineNo">2109</span>    return p;<a name="line.2109"></a>
+<span class="sourceLineNo">2110</span>  }<a name="line.2110"></a>
+<span class="sourceLineNo">2111</span><a name="line.2111"></a>
+<span class="sourceLineNo">2112</span>  /**<a name="line.2112"></a>
+<span class="sourceLineNo">2113</span>   * Get replication position for a peer in a region.<a name="line.2113"></a>
+<span class="sourceLineNo">2114</span>   * @param connection connection we're using<a name="line.2114"></a>
+<span class="sourceLineNo">2115</span>   * @return the position of this peer, -1 if no position in meta.<a name="line.2115"></a>
+<span class="sourceLineNo">2116</span>   */<a name="line.2116"></a>
+<span class="sourceLineNo">2117</span>  public static long getReplicationPositionForOnePeer(Connection connection,<a name="line.2117"></a>
+<span class="sourceLineNo">2118</span>      byte[] encodedRegionName, String peerId) throws IOException {<a name="line.2118"></a>
+<span class="sourceLineNo">2119</span>    Get get = new Get(encodedRegionName);<a name="line.2119"></a>
+<span class="sourceLineNo">2120</span>    get.addColumn(HConstants.REPLICATION_POSITION_FAMILY, Bytes.toBytes(peerId));<a name="line.2120"></a>
+<span class="sourceLineNo">2121</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2121"></a>
+<span class="sourceLineNo">2122</span>    if (r.isEmpty()) {<a name="line.2122"></a>
+<span class="sourceLineNo">2123</span>      return -1;<a name="line.2123"></a>
+<span class="sourceLineNo">2124</span>    }<a name="line.2124"></a>
+<span class="sourceLineNo">2125</span>    Cell cell = r.rawCells()[0];<a name="line.2125"></a>
+<span class="sourceLineNo">2126</span>    return Bytes.toLong(cell.getValueArray(),cell.getValueOffset(),cell.getValueLength());<a name="line.2126"></a>
+<span class="sourceLineNo">2127</span>  }<a name="line.2127"></a>
+<span class="sourceLineNo">2128</span><a name="line.2128"></a>
+<span class="sourceLineNo">2129</span>  /**<a name="line.2129"></a>
+<span class="sourceLineNo">2130</span>   * Get replication positions for all peers in a region.<a name="line.2130"></a>
+<span class="sourceLineNo">2131</span>   * @param connection connection we're using<a name="line.2131"></a>
+<span class="sourceLineNo">2132</span>   * @param encodedRegionName region's encoded name<a name="line.2132"></a>
+<span class="sourceLineNo">2133</span>   * @return the map of positions for each peer<a name="line.2133"></a>
+<span class="sourceLineNo">2134</span>   */<a name="line.2134"></a>
+<span class="sourceLineNo">2135</span>  public static Map&lt;String, Long&gt; getReplicationPositionForAllPeer(Connection connection,<a name="line.2135"></a>
+<span class="sourceLineNo">2136</span>      byte[] encodedRegionName) throws IOException {<a name="line.2136"></a>
+<span class="sourceLineNo">2137</span>    Get get = new Get(encodedRegionName);<a name="line.2137"></a>
+<span class="sourceLineNo">2138</span>    get.addFamily(HConstants.REPLICATION_POSITION_FAMILY);<a name="line.2138"></a>
+<span class="sourceLineNo">2139</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2139"></a>
+<span class="sourceLineNo">2140</span>    Map&lt;String, Long&gt; map = new HashMap&lt;&gt;((int) (r.size() / 0.75 + 1));<a name="line.2140"></a>
+<span class="sourceLineNo">2141</span>    for (Cell c : r.listCells()) {<a name="line.2141"></a>
+<span class="sourceLineNo">2142</span>      map.put(<a name="line.2142"></a>
+<span class="sourceLineNo">2143</span>          Bytes.toString(c.getQualifierArray(), c.getQualifierOffset(), c.getQualifierLength()),<a name="line.2143"></a>
+<span class="sourceLineNo">2144</span>          Bytes.toLong(c.getValueArray(), c.getValueOffset(), c.getValueLength()));<a name="line.2144"></a>
+<span class="sourceLineNo">2145</span>    }<a name="line.2145"></a>
+<span class="sourceLineNo">2146</span>    return map;<a name="line.2146"></a>
+<span class="sourceLineNo">2147</span>  }<a name="line.2147"></a>
+<span class="sourceLineNo">2148</span><a name="line.2148"></a>
+<span class="sourceLineNo">2149</span>  /**<a name="line.2149"></a>
+<span class="sourceLineNo">2150</span>   * Get replication barriers for all peers in a region.<a name="line.2150"></a>
+<span class="sourceLineNo">2151</span>   * @param encodedRegionName region's encoded name<a name="line.2151"></a>
+<span class="sourceLineNo">2152</span>   * @return a list of barrier sequence numbers.<a name="line.2152"></a>
+<span class="sourceLineNo">2153</span>   * @throws IOException<a name="line.2153"></a>
+<span class="sourceLineNo">2154</span>   */<a name="line.2154"></a>
+<span class="sourceLineNo">2155</span>  public static List&lt;Long&gt; getReplicationBarriers(Connection connection, byte[] encodedRegionName)<a name="line.2155"></a>
+<span class="sourceLineNo">2156</span>      throws IOException {<a name="line.2156"></a>
+<span class="sourceLineNo">2157</span>    Get get = new Get(encodedRegionName);<a name="line.2157"></a>
+<span class="sourceLineNo">2158</span>    get.addFamily(HConstants.REPLICATION_BARRIER_FAMILY);<a name="line.2158"></a>
+<span class="sourceLineNo">2159</span>    Result r = get(getMetaHTable(connection), get);<a name="line.2159"></a>
+<span class="sourceLineNo">2160</span>    List&lt;Long&gt; list = new ArrayList&lt;&gt;();<a name="line.2160"></a>
+<span class="sourceLineNo">2161</span>    if (!r.isEmpty()) {<a name="line.2161"></a>
+<span class="sourceLineNo">2162</span>      for (Cell cell : r.rawCells()) {<a name="line.2162"></a>
+<span class="sourceLineNo">2163</span>        list.add(Bytes.toLong(cell.getQualifierArray(), cell.getQualifierOffset(),<a name="line.2163"></a>
+<span class="sourceLineNo">2164</span>            cell.getQualifierLength()));<a name="line.2164"></a>
+<span class="sourceLineNo">2165</span>      }<a name="line.2165"></a>
+<span class="sourceLineNo">2166</span>    }<a name="line.2166"></a>
+<span class="sourceLineNo">2167</span>    return list;<a name="line.2167"></a>
+<span class="sourceLineNo">2168</span>  }<a name="line.2168"></a>
+<span class="sourceLineNo">2169</span><a name="line.2169"></a>
+<span class="sourceLineNo">2170</span>  /**<a name="line.2170"></a>
+<span class="sourceLineNo">2171</span>   * Get all barriers in all regions.<a name="line.2171"></a>
+<span class="sourceLineNo">2172</span>   * @return a map of barrier lists in all regions<a name="line.2172"></a>
+<span class="sourceLineNo">2173</span>   * @throws IOException<a name="line.2173"></a>
+<span class="sourceLineNo">2174</span>   */<a name="line.2174"></a>
+<span class="sourceLineNo">2175</span>  public static Map&lt;String, List&lt;Long&gt;&gt; getAllBarriers(Connection connection) throws IOException {<a name="line.2175"></a>
+<span class="sourceLineNo">2176</span>    Map&lt;String, List&lt;Long&gt;&gt; map = new HashMap&lt;&gt;();<a name="line.2176"></a>
+<span class="sourceLineNo">2177</span>    Scan scan = new Scan();<a name="line.2177"></a>
+<span class="sourceLineNo">2178</span>    scan.addFamily(HConstants.REPLICATION_BARRIER_FAMILY);<a name="line.2178"></a>
+<span class="sourceLineNo">2179</span>    try (Table t = getMetaHTable(connection);<a name="line.2179"></a>
+<span class="sourceLineNo">2180</span>        ResultScanner scanner = t.getScanner(scan)) {<a name="line.2180"></a>
+<span class="sourceLineNo">2181</span>      Result result;<a name="line.2181"></a>
+<span class="sourceLineNo">2182</span>      while ((result = scanner.next()) != null) {<a name="line.2182"></a>
+<span class="sourceLineNo">2183</span>        String key = Bytes.toString(result.getRow());<a name="line.2183"></a>
+<span class="sourceLineNo">2184</span>        List&lt;Long&gt; list = new ArrayList&lt;&gt;(result.rawCells().length);<a name="line.2184"></a>
+<span class="sourceLineNo">2185</span>        for (Cell cell : result.rawCells()) {<a name="line.2185"></a>
+<span class="sourceLineNo">2186</span>          list.add(Bytes.toLong(cell.getQualifierArray(), cell.getQualifierOffset(),<a name="line.2186"></a>
+<span class="sourceLineNo">2187</span>              cell.getQualifierLength()));<a name="line.2187"></a>
+<span class="sourceLineNo">2188</span>        }<a name="line.2188"></a>
+<span class="sourceLineNo">2189</span>        map.put(key, list);<a name="line.2189"></a>
+<span class="sourceLineNo">2190</span>      }<a name="line.2190"></a>
+<span class="sourceLineNo">2191</span>    }<a name="line.2191"></a>
+<span class="sourceLineNo">2192</span>    return map;<a name="line.2192"></a>
+<span class="sourceLineNo">2193</span>  }<a name="line.2193"></a>
+<span class="sourceLineNo">2194</span><a name="line.2194"></a>
+<span class="sourceLineNo">2195</span>  /**<a name="line.2195"></a>
+<span class="sourceLineNo">2196</span>   * Get daughter region(s) for a region, only used in serial replication.<a name="line.2196"></a>
+<span class="sourceLineNo">2197</span>   * @param connection connection we're using<a name="line.2197"></a>
+<span class="sourceLineNo">2198</span>   * @param encodedName region's encoded name<a name="line.2198"></a>
+<span class="sourceLineNo">2199</span>   * @throws IOException<a name="line.2199"></a>
+<span class="sourceLineNo">2200</span>   */<a name="line.2200"></a>
+<span class="sourceLineNo">2201</span>  public static String getSerialReplicationDaughterRegion(Connection connection, byte[] encodedName)<a name="line.2201"></a>
+<span class="sourceLineNo">2202</span>      throws IOException {<a name="line.2202"></a>
+<span class="sourceLineNo">2203</span>    Get get = new Get(encodedName);<a name="line.2203"></a>
+<span class="sourceLineNo">2204</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, daughterNameCq);<a name="line.2204"></a>
+<span class="sourceLineNo">2205</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2205"></a>
+<span class="sourceLineNo">2206</span>    if (!result.isEmpty()) {<a name="line.2206"></a>
+<span class="sourceLineNo">2207</span>      Cell c = result.rawCells()[0];<a name="line.2207"></a>
+<span class="sourceLineNo">2208</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2208"></a>
+<span class="sourceLineNo">2209</span>    }<a name="line.2209"></a>
+<span class="sourceLineNo">2210</span>    return null;<a name="line.2210"></a>
+<span class="sourceLineNo">2211</span>  }<a name="line.2211"></a>
+<span class="sourceLineNo">2212</span><a name="line.2212"></a>
+<span class="sourceLineNo">2213</span>  /**<a name="line.2213"></a>
+<span class="sourceLineNo">2214</span>   * Get parent region(s) for a region, only used in serial replication.<a name="line.2214"></a>
+<span class="sourceLineNo">2215</span>   * @param connection connection we're using<a name="line.2215"></a>
+<span class="sourceLineNo">2216</span>   * @param encodedName region's encoded name<a name="line.2216"></a>
+<span class="sourceLineNo">2217</span>   * @throws IOException<a name="line.2217"></a>
+<span class="sourceLineNo">2218</span>   */<a name="line.2218"></a>
+<span class="sourceLineNo">2219</span>  public static String getSerialReplicationParentRegion(Connection connection, byte[] encodedName)<a name="line.2219"></a>
+<span class="sourceLineNo">2220</span>      throws IOException {<a name="line.2220"></a>
+<span class="sourceLineNo">2221</span>    Get get = new Get(encodedName);<a name="line.2221"></a>
+<span class="sourceLineNo">2222</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, parentNameCq);<a name="line.2222"></a>
+<span class="sourceLineNo">2223</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2223"></a>
+<span class="sourceLineNo">2224</span>    if (!result.isEmpty()) {<a name="line.2224"></a>
+<span class="sourceLineNo">2225</span>      Cell c = result.rawCells()[0];<a name="line.2225"></a>
+<span class="sourceLineNo">2226</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2226"></a>
+<span class="sourceLineNo">2227</span>    }<a name="line.2227"></a>
+<span class="sourceLineNo">2228</span>    return null;<a name="line.2228"></a>
+<span class="sourceLineNo">2229</span>  }<a name="line.2229"></a>
+<span class="sourceLineNo">2230</span><a name="line.2230"></a>
+<span class="sourceLineNo">2231</span>  /**<a name="line.2231"></a>
+<span class="sourceLineNo">2232</span>   * Get the table name for a region, only used in serial replication.<a name="line.2232"></a>
+<span class="sourceLineNo">2233</span>   * @param connection connection we're using<a name="line.2233"></a>
+<span class="sourceLineNo">2234</span>   * @param encodedName region's encoded name<a name="line.2234"></a>
+<span class="sourceLineNo">2235</span>   * @throws IOException<a name="line.2235"></a>
+<span class="sourceLineNo">2236</span>   */<a name="line.2236"></a>
+<span class="sourceLineNo">2237</span>  public static String getSerialReplicationTableName(Connection connection, byte[] encodedName)<a name="line.2237"></a>
+<span class="sourceLineNo">2238</span>      throws IOException {<a name="line.2238"></a>
+<span class="sourceLineNo">2239</span>    Get get = new Get(encodedName);<a name="line.2239"></a>
+<span class="sourceLineNo">2240</span>    get.addColumn(HConstants.REPLICATION_META_FAMILY, tableNameCq);<a name="line.2240"></a>
+<span class="sourceLineNo">2241</span>    Result result = get(getMetaHTable(connection), get);<a name="line.2241"></a>
+<span class="sourceLineNo">2242</span>    if (!result.isEmpty()) {<a name="line.2242"></a>
+<span class="sourceLineNo">2243</span>      Cell c = result.rawCells()[0];<a name="line.2243"></a>
+<span class="sourceLineNo">2244</span>      return Bytes.toString(c.getValueArray(), c.getValueOffset(), c.getValueLength());<a name="line.2244"></a>
+<span class="sourceLineNo">2245</span>    }<a name="line.2245"></a>
+<span class="sourceLineNo">2246</span>    return null;<a name="line.2246"></a>
+<span class="sourceLineNo">2247</span>  }<a name="line.2247"></a>
+<span class="sourceLineNo">2248</span>}<a name="line.2248"></a>
 
 
 


Mime
View raw message