hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [31/51] [partial] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Wed, 19 Jul 2017 22:07:47 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/9eba7fcf/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.html b/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.html
index 53cae9a..64d0880 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.html
@@ -1034,289 +1034,283 @@
 <span class="sourceLineNo">1026</span>  protected List&lt;LoadQueueItem&gt; tryAtomicRegionLoad(ClientServiceCallable&lt;byte[]&gt; serviceCallable,<a name="line.1026"></a>
 <span class="sourceLineNo">1027</span>      final TableName tableName, final byte[] first, final Collection&lt;LoadQueueItem&gt; lqis)<a name="line.1027"></a>
 <span class="sourceLineNo">1028</span>      throws IOException {<a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>    final List&lt;Pair&lt;byte[], String&gt;&gt; famPaths = new ArrayList&lt;&gt;(lqis.size());<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>    for (LoadQueueItem lqi : lqis) {<a name="line.1030"></a>
-<span class="sourceLineNo">1031</span>      if (!unmatchedFamilies.contains(Bytes.toString(lqi.family))) {<a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>        famPaths.add(Pair.newPair(lqi.family, lqi.hfilePath.toString()));<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>      }<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>    }<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span>    try {<a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>      List&lt;LoadQueueItem&gt; toRetry = new ArrayList&lt;&gt;();<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span>      Configuration conf = getConf();<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>      byte[] region = RpcRetryingCallerFactory.instantiate(conf,<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>          null).&lt;byte[]&gt; newCaller()<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>          .callWithRetries(serviceCallable, Integer.MAX_VALUE);<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>      if (region == null) {<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>        LOG.warn("Attempt to bulk load region containing "<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>            + Bytes.toStringBinary(first) + " into table "<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>            + tableName  + " with files " + lqis<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span>            + " failed.  This is recoverable and they will be retried.");<a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>        toRetry.addAll(lqis); // return lqi's to retry<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span>      }<a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>      // success<a name="line.1048"></a>
-<span class="sourceLineNo">1049</span>      return toRetry;<a name="line.1049"></a>
-<span class="sourceLineNo">1050</span>    } catch (IOException e) {<a name="line.1050"></a>
-<span class="sourceLineNo">1051</span>      LOG.error("Encountered unrecoverable error from region server, additional details: "<a name="line.1051"></a>
-<span class="sourceLineNo">1052</span>          + serviceCallable.getExceptionMessageAdditionalDetail(), e);<a name="line.1052"></a>
-<span class="sourceLineNo">1053</span>      throw e;<a name="line.1053"></a>
-<span class="sourceLineNo">1054</span>    }<a name="line.1054"></a>
-<span class="sourceLineNo">1055</span>  }<a name="line.1055"></a>
-<span class="sourceLineNo">1056</span><a name="line.1056"></a>
-<span class="sourceLineNo">1057</span>  private final String toString(List&lt;Pair&lt;byte[], String&gt;&gt; list) {<a name="line.1057"></a>
-<span class="sourceLineNo">1058</span>    StringBuffer sb = new StringBuffer();<a name="line.1058"></a>
-<span class="sourceLineNo">1059</span>    sb.append("[");<a name="line.1059"></a>
-<span class="sourceLineNo">1060</span>    if(list != null){<a name="line.1060"></a>
-<span class="sourceLineNo">1061</span>      for(Pair&lt;byte[], String&gt; pair: list) {<a name="line.1061"></a>
-<span class="sourceLineNo">1062</span>        sb.append("{");<a name="line.1062"></a>
-<span class="sourceLineNo">1063</span>        sb.append(Bytes.toStringBinary(pair.getFirst()));<a name="line.1063"></a>
-<span class="sourceLineNo">1064</span>        sb.append(",");<a name="line.1064"></a>
-<span class="sourceLineNo">1065</span>        sb.append(pair.getSecond());<a name="line.1065"></a>
-<span class="sourceLineNo">1066</span>        sb.append("}");<a name="line.1066"></a>
-<span class="sourceLineNo">1067</span>      }<a name="line.1067"></a>
-<span class="sourceLineNo">1068</span>    }<a name="line.1068"></a>
-<span class="sourceLineNo">1069</span>    sb.append("]");<a name="line.1069"></a>
-<span class="sourceLineNo">1070</span>    return sb.toString();<a name="line.1070"></a>
-<span class="sourceLineNo">1071</span>  }<a name="line.1071"></a>
-<span class="sourceLineNo">1072</span>  private boolean isSecureBulkLoadEndpointAvailable() {<a name="line.1072"></a>
-<span class="sourceLineNo">1073</span>    String classes = getConf().get(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, "");<a name="line.1073"></a>
-<span class="sourceLineNo">1074</span>    return classes.contains("org.apache.hadoop.hbase.security.access.SecureBulkLoadEndpoint");<a name="line.1074"></a>
-<span class="sourceLineNo">1075</span>  }<a name="line.1075"></a>
-<span class="sourceLineNo">1076</span><a name="line.1076"></a>
-<span class="sourceLineNo">1077</span>  /**<a name="line.1077"></a>
-<span class="sourceLineNo">1078</span>   * Split a storefile into a top and bottom half, maintaining<a name="line.1078"></a>
-<span class="sourceLineNo">1079</span>   * the metadata, recreating bloom filters, etc.<a name="line.1079"></a>
-<span class="sourceLineNo">1080</span>   */<a name="line.1080"></a>
-<span class="sourceLineNo">1081</span>  static void splitStoreFile(<a name="line.1081"></a>
-<span class="sourceLineNo">1082</span>      Configuration conf, Path inFile,<a name="line.1082"></a>
-<span class="sourceLineNo">1083</span>      HColumnDescriptor familyDesc, byte[] splitKey,<a name="line.1083"></a>
-<span class="sourceLineNo">1084</span>      Path bottomOut, Path topOut) throws IOException {<a name="line.1084"></a>
-<span class="sourceLineNo">1085</span>    // Open reader with no block cache, and not in-memory<a name="line.1085"></a>
-<span class="sourceLineNo">1086</span>    Reference topReference = Reference.createTopReference(splitKey);<a name="line.1086"></a>
-<span class="sourceLineNo">1087</span>    Reference bottomReference = Reference.createBottomReference(splitKey);<a name="line.1087"></a>
-<span class="sourceLineNo">1088</span><a name="line.1088"></a>
-<span class="sourceLineNo">1089</span>    copyHFileHalf(conf, inFile, topOut, topReference, familyDesc);<a name="line.1089"></a>
-<span class="sourceLineNo">1090</span>    copyHFileHalf(conf, inFile, bottomOut, bottomReference, familyDesc);<a name="line.1090"></a>
-<span class="sourceLineNo">1091</span>  }<a name="line.1091"></a>
-<span class="sourceLineNo">1092</span><a name="line.1092"></a>
-<span class="sourceLineNo">1093</span>  /**<a name="line.1093"></a>
-<span class="sourceLineNo">1094</span>   * Copy half of an HFile into a new HFile.<a name="line.1094"></a>
-<span class="sourceLineNo">1095</span>   */<a name="line.1095"></a>
-<span class="sourceLineNo">1096</span>  private static void copyHFileHalf(<a name="line.1096"></a>
-<span class="sourceLineNo">1097</span>      Configuration conf, Path inFile, Path outFile, Reference reference,<a name="line.1097"></a>
-<span class="sourceLineNo">1098</span>      HColumnDescriptor familyDescriptor)<a name="line.1098"></a>
-<span class="sourceLineNo">1099</span>  throws IOException {<a name="line.1099"></a>
-<span class="sourceLineNo">1100</span>    FileSystem fs = inFile.getFileSystem(conf);<a name="line.1100"></a>
-<span class="sourceLineNo">1101</span>    CacheConfig cacheConf = new CacheConfig(conf);<a name="line.1101"></a>
-<span class="sourceLineNo">1102</span>    HalfStoreFileReader halfReader = null;<a name="line.1102"></a>
-<span class="sourceLineNo">1103</span>    StoreFileWriter halfWriter = null;<a name="line.1103"></a>
-<span class="sourceLineNo">1104</span>    try {<a name="line.1104"></a>
-<span class="sourceLineNo">1105</span>      halfReader = new HalfStoreFileReader(fs, inFile, cacheConf, reference, true,<a name="line.1105"></a>
-<span class="sourceLineNo">1106</span>          new AtomicInteger(0), true, conf);<a name="line.1106"></a>
-<span class="sourceLineNo">1107</span>      Map&lt;byte[], byte[]&gt; fileInfo = halfReader.loadFileInfo();<a name="line.1107"></a>
-<span class="sourceLineNo">1108</span><a name="line.1108"></a>
-<span class="sourceLineNo">1109</span>      int blocksize = familyDescriptor.getBlocksize();<a name="line.1109"></a>
-<span class="sourceLineNo">1110</span>      Algorithm compression = familyDescriptor.getCompressionType();<a name="line.1110"></a>
-<span class="sourceLineNo">1111</span>      BloomType bloomFilterType = familyDescriptor.getBloomFilterType();<a name="line.1111"></a>
-<span class="sourceLineNo">1112</span>      HFileContext hFileContext = new HFileContextBuilder()<a name="line.1112"></a>
-<span class="sourceLineNo">1113</span>                                  .withCompression(compression)<a name="line.1113"></a>
-<span class="sourceLineNo">1114</span>                                  .withChecksumType(HStore.getChecksumType(conf))<a name="line.1114"></a>
-<span class="sourceLineNo">1115</span>                                  .withBytesPerCheckSum(HStore.getBytesPerChecksum(conf))<a name="line.1115"></a>
-<span class="sourceLineNo">1116</span>                                  .withBlockSize(blocksize)<a name="line.1116"></a>
-<span class="sourceLineNo">1117</span>                                  .withDataBlockEncoding(familyDescriptor.getDataBlockEncoding())<a name="line.1117"></a>
-<span class="sourceLineNo">1118</span>                                  .withIncludesTags(true)<a name="line.1118"></a>
-<span class="sourceLineNo">1119</span>                                  .build();<a name="line.1119"></a>
-<span class="sourceLineNo">1120</span>      halfWriter = new StoreFileWriter.Builder(conf, cacheConf,<a name="line.1120"></a>
-<span class="sourceLineNo">1121</span>          fs)<a name="line.1121"></a>
-<span class="sourceLineNo">1122</span>              .withFilePath(outFile)<a name="line.1122"></a>
-<span class="sourceLineNo">1123</span>              .withBloomType(bloomFilterType)<a name="line.1123"></a>
-<span class="sourceLineNo">1124</span>              .withFileContext(hFileContext)<a name="line.1124"></a>
-<span class="sourceLineNo">1125</span>              .build();<a name="line.1125"></a>
-<span class="sourceLineNo">1126</span>      HFileScanner scanner = halfReader.getScanner(false, false, false);<a name="line.1126"></a>
-<span class="sourceLineNo">1127</span>      scanner.seekTo();<a name="line.1127"></a>
-<span class="sourceLineNo">1128</span>      do {<a name="line.1128"></a>
-<span class="sourceLineNo">1129</span>        halfWriter.append(scanner.getCell());<a name="line.1129"></a>
-<span class="sourceLineNo">1130</span>      } while (scanner.next());<a name="line.1130"></a>
-<span class="sourceLineNo">1131</span><a name="line.1131"></a>
-<span class="sourceLineNo">1132</span>      for (Map.Entry&lt;byte[],byte[]&gt; entry : fileInfo.entrySet()) {<a name="line.1132"></a>
-<span class="sourceLineNo">1133</span>        if (shouldCopyHFileMetaKey(entry.getKey())) {<a name="line.1133"></a>
-<span class="sourceLineNo">1134</span>          halfWriter.appendFileInfo(entry.getKey(), entry.getValue());<a name="line.1134"></a>
-<span class="sourceLineNo">1135</span>        }<a name="line.1135"></a>
-<span class="sourceLineNo">1136</span>      }<a name="line.1136"></a>
-<span class="sourceLineNo">1137</span>    } finally {<a name="line.1137"></a>
-<span class="sourceLineNo">1138</span>      if (halfWriter != null) {<a name="line.1138"></a>
-<span class="sourceLineNo">1139</span>        halfWriter.close();<a name="line.1139"></a>
-<span class="sourceLineNo">1140</span>      }<a name="line.1140"></a>
-<span class="sourceLineNo">1141</span>      if (halfReader != null) {<a name="line.1141"></a>
-<span class="sourceLineNo">1142</span>        halfReader.close(cacheConf.shouldEvictOnClose());<a name="line.1142"></a>
-<span class="sourceLineNo">1143</span>      }<a name="line.1143"></a>
-<span class="sourceLineNo">1144</span>    }<a name="line.1144"></a>
-<span class="sourceLineNo">1145</span>  }<a name="line.1145"></a>
+<span class="sourceLineNo">1029</span>    try {<a name="line.1029"></a>
+<span class="sourceLineNo">1030</span>      List&lt;LoadQueueItem&gt; toRetry = new ArrayList&lt;&gt;();<a name="line.1030"></a>
+<span class="sourceLineNo">1031</span>      Configuration conf = getConf();<a name="line.1031"></a>
+<span class="sourceLineNo">1032</span>      byte[] region = RpcRetryingCallerFactory.instantiate(conf,<a name="line.1032"></a>
+<span class="sourceLineNo">1033</span>          null).&lt;byte[]&gt; newCaller()<a name="line.1033"></a>
+<span class="sourceLineNo">1034</span>          .callWithRetries(serviceCallable, Integer.MAX_VALUE);<a name="line.1034"></a>
+<span class="sourceLineNo">1035</span>      if (region == null) {<a name="line.1035"></a>
+<span class="sourceLineNo">1036</span>        LOG.warn("Attempt to bulk load region containing "<a name="line.1036"></a>
+<span class="sourceLineNo">1037</span>            + Bytes.toStringBinary(first) + " into table "<a name="line.1037"></a>
+<span class="sourceLineNo">1038</span>            + tableName  + " with files " + lqis<a name="line.1038"></a>
+<span class="sourceLineNo">1039</span>            + " failed.  This is recoverable and they will be retried.");<a name="line.1039"></a>
+<span class="sourceLineNo">1040</span>        toRetry.addAll(lqis); // return lqi's to retry<a name="line.1040"></a>
+<span class="sourceLineNo">1041</span>      }<a name="line.1041"></a>
+<span class="sourceLineNo">1042</span>      // success<a name="line.1042"></a>
+<span class="sourceLineNo">1043</span>      return toRetry;<a name="line.1043"></a>
+<span class="sourceLineNo">1044</span>    } catch (IOException e) {<a name="line.1044"></a>
+<span class="sourceLineNo">1045</span>      LOG.error("Encountered unrecoverable error from region server, additional details: "<a name="line.1045"></a>
+<span class="sourceLineNo">1046</span>          + serviceCallable.getExceptionMessageAdditionalDetail(), e);<a name="line.1046"></a>
+<span class="sourceLineNo">1047</span>      throw e;<a name="line.1047"></a>
+<span class="sourceLineNo">1048</span>    }<a name="line.1048"></a>
+<span class="sourceLineNo">1049</span>  }<a name="line.1049"></a>
+<span class="sourceLineNo">1050</span><a name="line.1050"></a>
+<span class="sourceLineNo">1051</span>  private final String toString(List&lt;Pair&lt;byte[], String&gt;&gt; list) {<a name="line.1051"></a>
+<span class="sourceLineNo">1052</span>    StringBuffer sb = new StringBuffer();<a name="line.1052"></a>
+<span class="sourceLineNo">1053</span>    sb.append("[");<a name="line.1053"></a>
+<span class="sourceLineNo">1054</span>    if(list != null){<a name="line.1054"></a>
+<span class="sourceLineNo">1055</span>      for(Pair&lt;byte[], String&gt; pair: list) {<a name="line.1055"></a>
+<span class="sourceLineNo">1056</span>        sb.append("{");<a name="line.1056"></a>
+<span class="sourceLineNo">1057</span>        sb.append(Bytes.toStringBinary(pair.getFirst()));<a name="line.1057"></a>
+<span class="sourceLineNo">1058</span>        sb.append(",");<a name="line.1058"></a>
+<span class="sourceLineNo">1059</span>        sb.append(pair.getSecond());<a name="line.1059"></a>
+<span class="sourceLineNo">1060</span>        sb.append("}");<a name="line.1060"></a>
+<span class="sourceLineNo">1061</span>      }<a name="line.1061"></a>
+<span class="sourceLineNo">1062</span>    }<a name="line.1062"></a>
+<span class="sourceLineNo">1063</span>    sb.append("]");<a name="line.1063"></a>
+<span class="sourceLineNo">1064</span>    return sb.toString();<a name="line.1064"></a>
+<span class="sourceLineNo">1065</span>  }<a name="line.1065"></a>
+<span class="sourceLineNo">1066</span>  private boolean isSecureBulkLoadEndpointAvailable() {<a name="line.1066"></a>
+<span class="sourceLineNo">1067</span>    String classes = getConf().get(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY, "");<a name="line.1067"></a>
+<span class="sourceLineNo">1068</span>    return classes.contains("org.apache.hadoop.hbase.security.access.SecureBulkLoadEndpoint");<a name="line.1068"></a>
+<span class="sourceLineNo">1069</span>  }<a name="line.1069"></a>
+<span class="sourceLineNo">1070</span><a name="line.1070"></a>
+<span class="sourceLineNo">1071</span>  /**<a name="line.1071"></a>
+<span class="sourceLineNo">1072</span>   * Split a storefile into a top and bottom half, maintaining<a name="line.1072"></a>
+<span class="sourceLineNo">1073</span>   * the metadata, recreating bloom filters, etc.<a name="line.1073"></a>
+<span class="sourceLineNo">1074</span>   */<a name="line.1074"></a>
+<span class="sourceLineNo">1075</span>  static void splitStoreFile(<a name="line.1075"></a>
+<span class="sourceLineNo">1076</span>      Configuration conf, Path inFile,<a name="line.1076"></a>
+<span class="sourceLineNo">1077</span>      HColumnDescriptor familyDesc, byte[] splitKey,<a name="line.1077"></a>
+<span class="sourceLineNo">1078</span>      Path bottomOut, Path topOut) throws IOException {<a name="line.1078"></a>
+<span class="sourceLineNo">1079</span>    // Open reader with no block cache, and not in-memory<a name="line.1079"></a>
+<span class="sourceLineNo">1080</span>    Reference topReference = Reference.createTopReference(splitKey);<a name="line.1080"></a>
+<span class="sourceLineNo">1081</span>    Reference bottomReference = Reference.createBottomReference(splitKey);<a name="line.1081"></a>
+<span class="sourceLineNo">1082</span><a name="line.1082"></a>
+<span class="sourceLineNo">1083</span>    copyHFileHalf(conf, inFile, topOut, topReference, familyDesc);<a name="line.1083"></a>
+<span class="sourceLineNo">1084</span>    copyHFileHalf(conf, inFile, bottomOut, bottomReference, familyDesc);<a name="line.1084"></a>
+<span class="sourceLineNo">1085</span>  }<a name="line.1085"></a>
+<span class="sourceLineNo">1086</span><a name="line.1086"></a>
+<span class="sourceLineNo">1087</span>  /**<a name="line.1087"></a>
+<span class="sourceLineNo">1088</span>   * Copy half of an HFile into a new HFile.<a name="line.1088"></a>
+<span class="sourceLineNo">1089</span>   */<a name="line.1089"></a>
+<span class="sourceLineNo">1090</span>  private static void copyHFileHalf(<a name="line.1090"></a>
+<span class="sourceLineNo">1091</span>      Configuration conf, Path inFile, Path outFile, Reference reference,<a name="line.1091"></a>
+<span class="sourceLineNo">1092</span>      HColumnDescriptor familyDescriptor)<a name="line.1092"></a>
+<span class="sourceLineNo">1093</span>  throws IOException {<a name="line.1093"></a>
+<span class="sourceLineNo">1094</span>    FileSystem fs = inFile.getFileSystem(conf);<a name="line.1094"></a>
+<span class="sourceLineNo">1095</span>    CacheConfig cacheConf = new CacheConfig(conf);<a name="line.1095"></a>
+<span class="sourceLineNo">1096</span>    HalfStoreFileReader halfReader = null;<a name="line.1096"></a>
+<span class="sourceLineNo">1097</span>    StoreFileWriter halfWriter = null;<a name="line.1097"></a>
+<span class="sourceLineNo">1098</span>    try {<a name="line.1098"></a>
+<span class="sourceLineNo">1099</span>      halfReader = new HalfStoreFileReader(fs, inFile, cacheConf, reference, true,<a name="line.1099"></a>
+<span class="sourceLineNo">1100</span>          new AtomicInteger(0), true, conf);<a name="line.1100"></a>
+<span class="sourceLineNo">1101</span>      Map&lt;byte[], byte[]&gt; fileInfo = halfReader.loadFileInfo();<a name="line.1101"></a>
+<span class="sourceLineNo">1102</span><a name="line.1102"></a>
+<span class="sourceLineNo">1103</span>      int blocksize = familyDescriptor.getBlocksize();<a name="line.1103"></a>
+<span class="sourceLineNo">1104</span>      Algorithm compression = familyDescriptor.getCompressionType();<a name="line.1104"></a>
+<span class="sourceLineNo">1105</span>      BloomType bloomFilterType = familyDescriptor.getBloomFilterType();<a name="line.1105"></a>
+<span class="sourceLineNo">1106</span>      HFileContext hFileContext = new HFileContextBuilder()<a name="line.1106"></a>
+<span class="sourceLineNo">1107</span>                                  .withCompression(compression)<a name="line.1107"></a>
+<span class="sourceLineNo">1108</span>                                  .withChecksumType(HStore.getChecksumType(conf))<a name="line.1108"></a>
+<span class="sourceLineNo">1109</span>                                  .withBytesPerCheckSum(HStore.getBytesPerChecksum(conf))<a name="line.1109"></a>
+<span class="sourceLineNo">1110</span>                                  .withBlockSize(blocksize)<a name="line.1110"></a>
+<span class="sourceLineNo">1111</span>                                  .withDataBlockEncoding(familyDescriptor.getDataBlockEncoding())<a name="line.1111"></a>
+<span class="sourceLineNo">1112</span>                                  .withIncludesTags(true)<a name="line.1112"></a>
+<span class="sourceLineNo">1113</span>                                  .build();<a name="line.1113"></a>
+<span class="sourceLineNo">1114</span>      halfWriter = new StoreFileWriter.Builder(conf, cacheConf,<a name="line.1114"></a>
+<span class="sourceLineNo">1115</span>          fs)<a name="line.1115"></a>
+<span class="sourceLineNo">1116</span>              .withFilePath(outFile)<a name="line.1116"></a>
+<span class="sourceLineNo">1117</span>              .withBloomType(bloomFilterType)<a name="line.1117"></a>
+<span class="sourceLineNo">1118</span>              .withFileContext(hFileContext)<a name="line.1118"></a>
+<span class="sourceLineNo">1119</span>              .build();<a name="line.1119"></a>
+<span class="sourceLineNo">1120</span>      HFileScanner scanner = halfReader.getScanner(false, false, false);<a name="line.1120"></a>
+<span class="sourceLineNo">1121</span>      scanner.seekTo();<a name="line.1121"></a>
+<span class="sourceLineNo">1122</span>      do {<a name="line.1122"></a>
+<span class="sourceLineNo">1123</span>        halfWriter.append(scanner.getCell());<a name="line.1123"></a>
+<span class="sourceLineNo">1124</span>      } while (scanner.next());<a name="line.1124"></a>
+<span class="sourceLineNo">1125</span><a name="line.1125"></a>
+<span class="sourceLineNo">1126</span>      for (Map.Entry&lt;byte[],byte[]&gt; entry : fileInfo.entrySet()) {<a name="line.1126"></a>
+<span class="sourceLineNo">1127</span>        if (shouldCopyHFileMetaKey(entry.getKey())) {<a name="line.1127"></a>
+<span class="sourceLineNo">1128</span>          halfWriter.appendFileInfo(entry.getKey(), entry.getValue());<a name="line.1128"></a>
+<span class="sourceLineNo">1129</span>        }<a name="line.1129"></a>
+<span class="sourceLineNo">1130</span>      }<a name="line.1130"></a>
+<span class="sourceLineNo">1131</span>    } finally {<a name="line.1131"></a>
+<span class="sourceLineNo">1132</span>      if (halfWriter != null) {<a name="line.1132"></a>
+<span class="sourceLineNo">1133</span>        halfWriter.close();<a name="line.1133"></a>
+<span class="sourceLineNo">1134</span>      }<a name="line.1134"></a>
+<span class="sourceLineNo">1135</span>      if (halfReader != null) {<a name="line.1135"></a>
+<span class="sourceLineNo">1136</span>        halfReader.close(cacheConf.shouldEvictOnClose());<a name="line.1136"></a>
+<span class="sourceLineNo">1137</span>      }<a name="line.1137"></a>
+<span class="sourceLineNo">1138</span>    }<a name="line.1138"></a>
+<span class="sourceLineNo">1139</span>  }<a name="line.1139"></a>
+<span class="sourceLineNo">1140</span><a name="line.1140"></a>
+<span class="sourceLineNo">1141</span>  private static boolean shouldCopyHFileMetaKey(byte[] key) {<a name="line.1141"></a>
+<span class="sourceLineNo">1142</span>    // skip encoding to keep hfile meta consistent with data block info, see HBASE-15085<a name="line.1142"></a>
+<span class="sourceLineNo">1143</span>    if (Bytes.equals(key, HFileDataBlockEncoder.DATA_BLOCK_ENCODING)) {<a name="line.1143"></a>
+<span class="sourceLineNo">1144</span>      return false;<a name="line.1144"></a>
+<span class="sourceLineNo">1145</span>    }<a name="line.1145"></a>
 <span class="sourceLineNo">1146</span><a name="line.1146"></a>
-<span class="sourceLineNo">1147</span>  private static boolean shouldCopyHFileMetaKey(byte[] key) {<a name="line.1147"></a>
-<span class="sourceLineNo">1148</span>    // skip encoding to keep hfile meta consistent with data block info, see HBASE-15085<a name="line.1148"></a>
-<span class="sourceLineNo">1149</span>    if (Bytes.equals(key, HFileDataBlockEncoder.DATA_BLOCK_ENCODING)) {<a name="line.1149"></a>
-<span class="sourceLineNo">1150</span>      return false;<a name="line.1150"></a>
-<span class="sourceLineNo">1151</span>    }<a name="line.1151"></a>
-<span class="sourceLineNo">1152</span><a name="line.1152"></a>
-<span class="sourceLineNo">1153</span>    return !HFile.isReservedFileInfoKey(key);<a name="line.1153"></a>
-<span class="sourceLineNo">1154</span>  }<a name="line.1154"></a>
-<span class="sourceLineNo">1155</span><a name="line.1155"></a>
-<span class="sourceLineNo">1156</span>  /*<a name="line.1156"></a>
-<span class="sourceLineNo">1157</span>   * Infers region boundaries for a new table.<a name="line.1157"></a>
-<span class="sourceLineNo">1158</span>   * Parameter:<a name="line.1158"></a>
-<span class="sourceLineNo">1159</span>   *   bdryMap is a map between keys to an integer belonging to {+1, -1}<a name="line.1159"></a>
-<span class="sourceLineNo">1160</span>   *     If a key is a start key of a file, then it maps to +1<a name="line.1160"></a>
-<span class="sourceLineNo">1161</span>   *     If a key is an end key of a file, then it maps to -1<a name="line.1161"></a>
-<span class="sourceLineNo">1162</span>   * Algo:<a name="line.1162"></a>
-<span class="sourceLineNo">1163</span>   * 1) Poll on the keys in order:<a name="line.1163"></a>
-<span class="sourceLineNo">1164</span>   *    a) Keep adding the mapped values to these keys (runningSum)<a name="line.1164"></a>
-<span class="sourceLineNo">1165</span>   *    b) Each time runningSum reaches 0, add the start Key from when the runningSum had started to<a name="line.1165"></a>
-<span class="sourceLineNo">1166</span>   *       a boundary list.<a name="line.1166"></a>
-<span class="sourceLineNo">1167</span>   * 2) Return the boundary list.<a name="line.1167"></a>
-<span class="sourceLineNo">1168</span>   */<a name="line.1168"></a>
-<span class="sourceLineNo">1169</span>  public static byte[][] inferBoundaries(TreeMap&lt;byte[], Integer&gt; bdryMap) {<a name="line.1169"></a>
-<span class="sourceLineNo">1170</span>    ArrayList&lt;byte[]&gt; keysArray = new ArrayList&lt;&gt;();<a name="line.1170"></a>
-<span class="sourceLineNo">1171</span>    int runningValue = 0;<a name="line.1171"></a>
-<span class="sourceLineNo">1172</span>    byte[] currStartKey = null;<a name="line.1172"></a>
-<span class="sourceLineNo">1173</span>    boolean firstBoundary = true;<a name="line.1173"></a>
-<span class="sourceLineNo">1174</span><a name="line.1174"></a>
-<span class="sourceLineNo">1175</span>    for (Map.Entry&lt;byte[], Integer&gt; item: bdryMap.entrySet()) {<a name="line.1175"></a>
-<span class="sourceLineNo">1176</span>      if (runningValue == 0) {<a name="line.1176"></a>
-<span class="sourceLineNo">1177</span>        currStartKey = item.getKey();<a name="line.1177"></a>
-<span class="sourceLineNo">1178</span>      }<a name="line.1178"></a>
-<span class="sourceLineNo">1179</span>      runningValue += item.getValue();<a name="line.1179"></a>
-<span class="sourceLineNo">1180</span>      if (runningValue == 0) {<a name="line.1180"></a>
-<span class="sourceLineNo">1181</span>        if (!firstBoundary) {<a name="line.1181"></a>
-<span class="sourceLineNo">1182</span>          keysArray.add(currStartKey);<a name="line.1182"></a>
-<span class="sourceLineNo">1183</span>        }<a name="line.1183"></a>
-<span class="sourceLineNo">1184</span>        firstBoundary = false;<a name="line.1184"></a>
-<span class="sourceLineNo">1185</span>      }<a name="line.1185"></a>
-<span class="sourceLineNo">1186</span>    }<a name="line.1186"></a>
-<span class="sourceLineNo">1187</span><a name="line.1187"></a>
-<span class="sourceLineNo">1188</span>    return keysArray.toArray(new byte[0][0]);<a name="line.1188"></a>
-<span class="sourceLineNo">1189</span>  }<a name="line.1189"></a>
-<span class="sourceLineNo">1190</span><a name="line.1190"></a>
-<span class="sourceLineNo">1191</span>  /*<a name="line.1191"></a>
-<span class="sourceLineNo">1192</span>   * If the table is created for the first time, then "completebulkload" reads the files twice.<a name="line.1192"></a>
-<span class="sourceLineNo">1193</span>   * More modifications necessary if we want to avoid doing it.<a name="line.1193"></a>
-<span class="sourceLineNo">1194</span>   */<a name="line.1194"></a>
-<span class="sourceLineNo">1195</span>  private void createTable(TableName tableName, String dirPath, Admin admin) throws IOException {<a name="line.1195"></a>
-<span class="sourceLineNo">1196</span>    final Path hfofDir = new Path(dirPath);<a name="line.1196"></a>
-<span class="sourceLineNo">1197</span>    final FileSystem fs = hfofDir.getFileSystem(getConf());<a name="line.1197"></a>
-<span class="sourceLineNo">1198</span><a name="line.1198"></a>
-<span class="sourceLineNo">1199</span>    // Add column families<a name="line.1199"></a>
-<span class="sourceLineNo">1200</span>    // Build a set of keys<a name="line.1200"></a>
-<span class="sourceLineNo">1201</span>    final HTableDescriptor htd = new HTableDescriptor(tableName);<a name="line.1201"></a>
-<span class="sourceLineNo">1202</span>    final TreeMap&lt;byte[], Integer&gt; map = new TreeMap&lt;&gt;(Bytes.BYTES_COMPARATOR);<a name="line.1202"></a>
-<span class="sourceLineNo">1203</span>    visitBulkHFiles(fs, hfofDir, new BulkHFileVisitor&lt;HColumnDescriptor&gt;() {<a name="line.1203"></a>
+<span class="sourceLineNo">1147</span>    return !HFile.isReservedFileInfoKey(key);<a name="line.1147"></a>
+<span class="sourceLineNo">1148</span>  }<a name="line.1148"></a>
+<span class="sourceLineNo">1149</span><a name="line.1149"></a>
+<span class="sourceLineNo">1150</span>  /*<a name="line.1150"></a>
+<span class="sourceLineNo">1151</span>   * Infers region boundaries for a new table.<a name="line.1151"></a>
+<span class="sourceLineNo">1152</span>   * Parameter:<a name="line.1152"></a>
+<span class="sourceLineNo">1153</span>   *   bdryMap is a map between keys to an integer belonging to {+1, -1}<a name="line.1153"></a>
+<span class="sourceLineNo">1154</span>   *     If a key is a start key of a file, then it maps to +1<a name="line.1154"></a>
+<span class="sourceLineNo">1155</span>   *     If a key is an end key of a file, then it maps to -1<a name="line.1155"></a>
+<span class="sourceLineNo">1156</span>   * Algo:<a name="line.1156"></a>
+<span class="sourceLineNo">1157</span>   * 1) Poll on the keys in order:<a name="line.1157"></a>
+<span class="sourceLineNo">1158</span>   *    a) Keep adding the mapped values to these keys (runningSum)<a name="line.1158"></a>
+<span class="sourceLineNo">1159</span>   *    b) Each time runningSum reaches 0, add the start Key from when the runningSum had started to<a name="line.1159"></a>
+<span class="sourceLineNo">1160</span>   *       a boundary list.<a name="line.1160"></a>
+<span class="sourceLineNo">1161</span>   * 2) Return the boundary list.<a name="line.1161"></a>
+<span class="sourceLineNo">1162</span>   */<a name="line.1162"></a>
+<span class="sourceLineNo">1163</span>  public static byte[][] inferBoundaries(TreeMap&lt;byte[], Integer&gt; bdryMap) {<a name="line.1163"></a>
+<span class="sourceLineNo">1164</span>    ArrayList&lt;byte[]&gt; keysArray = new ArrayList&lt;&gt;();<a name="line.1164"></a>
+<span class="sourceLineNo">1165</span>    int runningValue = 0;<a name="line.1165"></a>
+<span class="sourceLineNo">1166</span>    byte[] currStartKey = null;<a name="line.1166"></a>
+<span class="sourceLineNo">1167</span>    boolean firstBoundary = true;<a name="line.1167"></a>
+<span class="sourceLineNo">1168</span><a name="line.1168"></a>
+<span class="sourceLineNo">1169</span>    for (Map.Entry&lt;byte[], Integer&gt; item: bdryMap.entrySet()) {<a name="line.1169"></a>
+<span class="sourceLineNo">1170</span>      if (runningValue == 0) {<a name="line.1170"></a>
+<span class="sourceLineNo">1171</span>        currStartKey = item.getKey();<a name="line.1171"></a>
+<span class="sourceLineNo">1172</span>      }<a name="line.1172"></a>
+<span class="sourceLineNo">1173</span>      runningValue += item.getValue();<a name="line.1173"></a>
+<span class="sourceLineNo">1174</span>      if (runningValue == 0) {<a name="line.1174"></a>
+<span class="sourceLineNo">1175</span>        if (!firstBoundary) {<a name="line.1175"></a>
+<span class="sourceLineNo">1176</span>          keysArray.add(currStartKey);<a name="line.1176"></a>
+<span class="sourceLineNo">1177</span>        }<a name="line.1177"></a>
+<span class="sourceLineNo">1178</span>        firstBoundary = false;<a name="line.1178"></a>
+<span class="sourceLineNo">1179</span>      }<a name="line.1179"></a>
+<span class="sourceLineNo">1180</span>    }<a name="line.1180"></a>
+<span class="sourceLineNo">1181</span><a name="line.1181"></a>
+<span class="sourceLineNo">1182</span>    return keysArray.toArray(new byte[0][0]);<a name="line.1182"></a>
+<span class="sourceLineNo">1183</span>  }<a name="line.1183"></a>
+<span class="sourceLineNo">1184</span><a name="line.1184"></a>
+<span class="sourceLineNo">1185</span>  /*<a name="line.1185"></a>
+<span class="sourceLineNo">1186</span>   * If the table is created for the first time, then "completebulkload" reads the files twice.<a name="line.1186"></a>
+<span class="sourceLineNo">1187</span>   * More modifications necessary if we want to avoid doing it.<a name="line.1187"></a>
+<span class="sourceLineNo">1188</span>   */<a name="line.1188"></a>
+<span class="sourceLineNo">1189</span>  private void createTable(TableName tableName, String dirPath, Admin admin) throws IOException {<a name="line.1189"></a>
+<span class="sourceLineNo">1190</span>    final Path hfofDir = new Path(dirPath);<a name="line.1190"></a>
+<span class="sourceLineNo">1191</span>    final FileSystem fs = hfofDir.getFileSystem(getConf());<a name="line.1191"></a>
+<span class="sourceLineNo">1192</span><a name="line.1192"></a>
+<span class="sourceLineNo">1193</span>    // Add column families<a name="line.1193"></a>
+<span class="sourceLineNo">1194</span>    // Build a set of keys<a name="line.1194"></a>
+<span class="sourceLineNo">1195</span>    final HTableDescriptor htd = new HTableDescriptor(tableName);<a name="line.1195"></a>
+<span class="sourceLineNo">1196</span>    final TreeMap&lt;byte[], Integer&gt; map = new TreeMap&lt;&gt;(Bytes.BYTES_COMPARATOR);<a name="line.1196"></a>
+<span class="sourceLineNo">1197</span>    visitBulkHFiles(fs, hfofDir, new BulkHFileVisitor&lt;HColumnDescriptor&gt;() {<a name="line.1197"></a>
+<span class="sourceLineNo">1198</span>      @Override<a name="line.1198"></a>
+<span class="sourceLineNo">1199</span>      public HColumnDescriptor bulkFamily(final byte[] familyName) {<a name="line.1199"></a>
+<span class="sourceLineNo">1200</span>        HColumnDescriptor hcd = new HColumnDescriptor(familyName);<a name="line.1200"></a>
+<span class="sourceLineNo">1201</span>        htd.addFamily(hcd);<a name="line.1201"></a>
+<span class="sourceLineNo">1202</span>        return hcd;<a name="line.1202"></a>
+<span class="sourceLineNo">1203</span>      }<a name="line.1203"></a>
 <span class="sourceLineNo">1204</span>      @Override<a name="line.1204"></a>
-<span class="sourceLineNo">1205</span>      public HColumnDescriptor bulkFamily(final byte[] familyName) {<a name="line.1205"></a>
-<span class="sourceLineNo">1206</span>        HColumnDescriptor hcd = new HColumnDescriptor(familyName);<a name="line.1206"></a>
-<span class="sourceLineNo">1207</span>        htd.addFamily(hcd);<a name="line.1207"></a>
-<span class="sourceLineNo">1208</span>        return hcd;<a name="line.1208"></a>
-<span class="sourceLineNo">1209</span>      }<a name="line.1209"></a>
-<span class="sourceLineNo">1210</span>      @Override<a name="line.1210"></a>
-<span class="sourceLineNo">1211</span>      public void bulkHFile(final HColumnDescriptor hcd, final FileStatus hfileStatus)<a name="line.1211"></a>
-<span class="sourceLineNo">1212</span>          throws IOException {<a name="line.1212"></a>
-<span class="sourceLineNo">1213</span>        Path hfile = hfileStatus.getPath();<a name="line.1213"></a>
-<span class="sourceLineNo">1214</span>        try (HFile.Reader reader =<a name="line.1214"></a>
-<span class="sourceLineNo">1215</span>            HFile.createReader(fs, hfile, new CacheConfig(getConf()), true, getConf())) {<a name="line.1215"></a>
-<span class="sourceLineNo">1216</span>          if (hcd.getCompressionType() != reader.getFileContext().getCompression()) {<a name="line.1216"></a>
-<span class="sourceLineNo">1217</span>            hcd.setCompressionType(reader.getFileContext().getCompression());<a name="line.1217"></a>
-<span class="sourceLineNo">1218</span>            LOG.info("Setting compression " + hcd.getCompressionType().name() + " for family " +<a name="line.1218"></a>
-<span class="sourceLineNo">1219</span>                hcd.toString());<a name="line.1219"></a>
-<span class="sourceLineNo">1220</span>          }<a name="line.1220"></a>
-<span class="sourceLineNo">1221</span>          reader.loadFileInfo();<a name="line.1221"></a>
-<span class="sourceLineNo">1222</span>          byte[] first = reader.getFirstRowKey();<a name="line.1222"></a>
-<span class="sourceLineNo">1223</span>          byte[] last = reader.getLastRowKey();<a name="line.1223"></a>
-<span class="sourceLineNo">1224</span><a name="line.1224"></a>
-<span class="sourceLineNo">1225</span>          LOG.info("Trying to figure out region boundaries hfile=" + hfile + " first=" +<a name="line.1225"></a>
-<span class="sourceLineNo">1226</span>              Bytes.toStringBinary(first) + " last=" + Bytes.toStringBinary(last));<a name="line.1226"></a>
-<span class="sourceLineNo">1227</span><a name="line.1227"></a>
-<span class="sourceLineNo">1228</span>          // To eventually infer start key-end key boundaries<a name="line.1228"></a>
-<span class="sourceLineNo">1229</span>          Integer value = map.containsKey(first) ? map.get(first) : 0;<a name="line.1229"></a>
-<span class="sourceLineNo">1230</span>          map.put(first, value + 1);<a name="line.1230"></a>
+<span class="sourceLineNo">1205</span>      public void bulkHFile(final HColumnDescriptor hcd, final FileStatus hfileStatus)<a name="line.1205"></a>
+<span class="sourceLineNo">1206</span>          throws IOException {<a name="line.1206"></a>
+<span class="sourceLineNo">1207</span>        Path hfile = hfileStatus.getPath();<a name="line.1207"></a>
+<span class="sourceLineNo">1208</span>        try (HFile.Reader reader =<a name="line.1208"></a>
+<span class="sourceLineNo">1209</span>            HFile.createReader(fs, hfile, new CacheConfig(getConf()), true, getConf())) {<a name="line.1209"></a>
+<span class="sourceLineNo">1210</span>          if (hcd.getCompressionType() != reader.getFileContext().getCompression()) {<a name="line.1210"></a>
+<span class="sourceLineNo">1211</span>            hcd.setCompressionType(reader.getFileContext().getCompression());<a name="line.1211"></a>
+<span class="sourceLineNo">1212</span>            LOG.info("Setting compression " + hcd.getCompressionType().name() + " for family " +<a name="line.1212"></a>
+<span class="sourceLineNo">1213</span>                hcd.toString());<a name="line.1213"></a>
+<span class="sourceLineNo">1214</span>          }<a name="line.1214"></a>
+<span class="sourceLineNo">1215</span>          reader.loadFileInfo();<a name="line.1215"></a>
+<span class="sourceLineNo">1216</span>          byte[] first = reader.getFirstRowKey();<a name="line.1216"></a>
+<span class="sourceLineNo">1217</span>          byte[] last = reader.getLastRowKey();<a name="line.1217"></a>
+<span class="sourceLineNo">1218</span><a name="line.1218"></a>
+<span class="sourceLineNo">1219</span>          LOG.info("Trying to figure out region boundaries hfile=" + hfile + " first=" +<a name="line.1219"></a>
+<span class="sourceLineNo">1220</span>              Bytes.toStringBinary(first) + " last=" + Bytes.toStringBinary(last));<a name="line.1220"></a>
+<span class="sourceLineNo">1221</span><a name="line.1221"></a>
+<span class="sourceLineNo">1222</span>          // To eventually infer start key-end key boundaries<a name="line.1222"></a>
+<span class="sourceLineNo">1223</span>          Integer value = map.containsKey(first) ? map.get(first) : 0;<a name="line.1223"></a>
+<span class="sourceLineNo">1224</span>          map.put(first, value + 1);<a name="line.1224"></a>
+<span class="sourceLineNo">1225</span><a name="line.1225"></a>
+<span class="sourceLineNo">1226</span>          value = map.containsKey(last) ? map.get(last) : 0;<a name="line.1226"></a>
+<span class="sourceLineNo">1227</span>          map.put(last, value - 1);<a name="line.1227"></a>
+<span class="sourceLineNo">1228</span>        }<a name="line.1228"></a>
+<span class="sourceLineNo">1229</span>      }<a name="line.1229"></a>
+<span class="sourceLineNo">1230</span>    });<a name="line.1230"></a>
 <span class="sourceLineNo">1231</span><a name="line.1231"></a>
-<span class="sourceLineNo">1232</span>          value = map.containsKey(last) ? map.get(last) : 0;<a name="line.1232"></a>
-<span class="sourceLineNo">1233</span>          map.put(last, value - 1);<a name="line.1233"></a>
-<span class="sourceLineNo">1234</span>        }<a name="line.1234"></a>
-<span class="sourceLineNo">1235</span>      }<a name="line.1235"></a>
-<span class="sourceLineNo">1236</span>    });<a name="line.1236"></a>
+<span class="sourceLineNo">1232</span>    byte[][] keys = LoadIncrementalHFiles.inferBoundaries(map);<a name="line.1232"></a>
+<span class="sourceLineNo">1233</span>    admin.createTable(htd, keys);<a name="line.1233"></a>
+<span class="sourceLineNo">1234</span><a name="line.1234"></a>
+<span class="sourceLineNo">1235</span>    LOG.info("Table "+ tableName +" is available!!");<a name="line.1235"></a>
+<span class="sourceLineNo">1236</span>  }<a name="line.1236"></a>
 <span class="sourceLineNo">1237</span><a name="line.1237"></a>
-<span class="sourceLineNo">1238</span>    byte[][] keys = LoadIncrementalHFiles.inferBoundaries(map);<a name="line.1238"></a>
-<span class="sourceLineNo">1239</span>    admin.createTable(htd, keys);<a name="line.1239"></a>
-<span class="sourceLineNo">1240</span><a name="line.1240"></a>
-<span class="sourceLineNo">1241</span>    LOG.info("Table "+ tableName +" is available!!");<a name="line.1241"></a>
-<span class="sourceLineNo">1242</span>  }<a name="line.1242"></a>
+<span class="sourceLineNo">1238</span>  public Map&lt;LoadQueueItem, ByteBuffer&gt; run(String dirPath, Map&lt;byte[], List&lt;Path&gt;&gt; map,<a name="line.1238"></a>
+<span class="sourceLineNo">1239</span>      TableName tableName) throws IOException {<a name="line.1239"></a>
+<span class="sourceLineNo">1240</span>    initialize();<a name="line.1240"></a>
+<span class="sourceLineNo">1241</span>    try (Connection connection = ConnectionFactory.createConnection(getConf());<a name="line.1241"></a>
+<span class="sourceLineNo">1242</span>        Admin admin = connection.getAdmin()) {<a name="line.1242"></a>
 <span class="sourceLineNo">1243</span><a name="line.1243"></a>
-<span class="sourceLineNo">1244</span>  public Map&lt;LoadQueueItem, ByteBuffer&gt; run(String dirPath, Map&lt;byte[], List&lt;Path&gt;&gt; map,<a name="line.1244"></a>
-<span class="sourceLineNo">1245</span>      TableName tableName) throws IOException {<a name="line.1245"></a>
-<span class="sourceLineNo">1246</span>    initialize();<a name="line.1246"></a>
-<span class="sourceLineNo">1247</span>    try (Connection connection = ConnectionFactory.createConnection(getConf());<a name="line.1247"></a>
-<span class="sourceLineNo">1248</span>        Admin admin = connection.getAdmin()) {<a name="line.1248"></a>
-<span class="sourceLineNo">1249</span><a name="line.1249"></a>
-<span class="sourceLineNo">1250</span>      boolean tableExists = admin.tableExists(tableName);<a name="line.1250"></a>
-<span class="sourceLineNo">1251</span>      if (!tableExists) {<a name="line.1251"></a>
-<span class="sourceLineNo">1252</span>        if (dirPath != null &amp;&amp; "yes".equalsIgnoreCase(getConf().get(CREATE_TABLE_CONF_KEY, "yes"))) {<a name="line.1252"></a>
-<span class="sourceLineNo">1253</span>          this.createTable(tableName, dirPath, admin);<a name="line.1253"></a>
-<span class="sourceLineNo">1254</span>        } else {<a name="line.1254"></a>
-<span class="sourceLineNo">1255</span>          String errorMsg = format("Table '%s' does not exist.", tableName);<a name="line.1255"></a>
-<span class="sourceLineNo">1256</span>          LOG.error(errorMsg);<a name="line.1256"></a>
-<span class="sourceLineNo">1257</span>          throw new TableNotFoundException(errorMsg);<a name="line.1257"></a>
-<span class="sourceLineNo">1258</span>        }<a name="line.1258"></a>
-<span class="sourceLineNo">1259</span>      }<a name="line.1259"></a>
-<span class="sourceLineNo">1260</span>      Path hfofDir = null;<a name="line.1260"></a>
-<span class="sourceLineNo">1261</span>      if (dirPath != null) {<a name="line.1261"></a>
-<span class="sourceLineNo">1262</span>        hfofDir = new Path(dirPath);<a name="line.1262"></a>
-<span class="sourceLineNo">1263</span>      }<a name="line.1263"></a>
-<span class="sourceLineNo">1264</span><a name="line.1264"></a>
-<span class="sourceLineNo">1265</span>      try (Table table = connection.getTable(tableName);<a name="line.1265"></a>
-<span class="sourceLineNo">1266</span>        RegionLocator locator = connection.getRegionLocator(tableName)) {<a name="line.1266"></a>
-<span class="sourceLineNo">1267</span>        boolean silence = "yes".equalsIgnoreCase(getConf().get(IGNORE_UNMATCHED_CF_CONF_KEY, ""));<a name="line.1267"></a>
-<span class="sourceLineNo">1268</span>        boolean copyFiles = getConf().getBoolean(ALWAYS_COPY_FILES, false);<a name="line.1268"></a>
-<span class="sourceLineNo">1269</span>        if (dirPath != null) {<a name="line.1269"></a>
-<span class="sourceLineNo">1270</span>          doBulkLoad(hfofDir, admin, table, locator, silence, copyFiles);<a name="line.1270"></a>
-<span class="sourceLineNo">1271</span>        } else {<a name="line.1271"></a>
-<span class="sourceLineNo">1272</span>          doBulkLoad(map, admin, table, locator, silence, copyFiles);<a name="line.1272"></a>
-<span class="sourceLineNo">1273</span>        }<a name="line.1273"></a>
-<span class="sourceLineNo">1274</span>        return retValue;<a name="line.1274"></a>
-<span class="sourceLineNo">1275</span>      }<a name="line.1275"></a>
-<span class="sourceLineNo">1276</span>    }<a name="line.1276"></a>
-<span class="sourceLineNo">1277</span>  }<a name="line.1277"></a>
-<span class="sourceLineNo">1278</span><a name="line.1278"></a>
-<span class="sourceLineNo">1279</span>  @Override<a name="line.1279"></a>
-<span class="sourceLineNo">1280</span>  public int run(String[] args) throws Exception {<a name="line.1280"></a>
-<span class="sourceLineNo">1281</span>    if (args.length &lt; 2) {<a name="line.1281"></a>
-<span class="sourceLineNo">1282</span>      usage();<a name="line.1282"></a>
-<span class="sourceLineNo">1283</span>      return -1;<a name="line.1283"></a>
-<span class="sourceLineNo">1284</span>    }<a name="line.1284"></a>
-<span class="sourceLineNo">1285</span><a name="line.1285"></a>
-<span class="sourceLineNo">1286</span>    String dirPath = args[0];<a name="line.1286"></a>
-<span class="sourceLineNo">1287</span>    TableName tableName = TableName.valueOf(args[1]);<a name="line.1287"></a>
-<span class="sourceLineNo">1288</span>    Map&lt;LoadQueueItem, ByteBuffer&gt; loaded = run(dirPath, null, tableName);<a name="line.1288"></a>
-<span class="sourceLineNo">1289</span>    if (loaded == null || !loaded.isEmpty()) return 0;<a name="line.1289"></a>
-<span class="sourceLineNo">1290</span>    return -1;<a name="line.1290"></a>
+<span class="sourceLineNo">1244</span>      boolean tableExists = admin.tableExists(tableName);<a name="line.1244"></a>
+<span class="sourceLineNo">1245</span>      if (!tableExists) {<a name="line.1245"></a>
+<span class="sourceLineNo">1246</span>        if (dirPath != null &amp;&amp; "yes".equalsIgnoreCase(getConf().get(CREATE_TABLE_CONF_KEY, "yes"))) {<a name="line.1246"></a>
+<span class="sourceLineNo">1247</span>          this.createTable(tableName, dirPath, admin);<a name="line.1247"></a>
+<span class="sourceLineNo">1248</span>        } else {<a name="line.1248"></a>
+<span class="sourceLineNo">1249</span>          String errorMsg = format("Table '%s' does not exist.", tableName);<a name="line.1249"></a>
+<span class="sourceLineNo">1250</span>          LOG.error(errorMsg);<a name="line.1250"></a>
+<span class="sourceLineNo">1251</span>          throw new TableNotFoundException(errorMsg);<a name="line.1251"></a>
+<span class="sourceLineNo">1252</span>        }<a name="line.1252"></a>
+<span class="sourceLineNo">1253</span>      }<a name="line.1253"></a>
+<span class="sourceLineNo">1254</span>      Path hfofDir = null;<a name="line.1254"></a>
+<span class="sourceLineNo">1255</span>      if (dirPath != null) {<a name="line.1255"></a>
+<span class="sourceLineNo">1256</span>        hfofDir = new Path(dirPath);<a name="line.1256"></a>
+<span class="sourceLineNo">1257</span>      }<a name="line.1257"></a>
+<span class="sourceLineNo">1258</span><a name="line.1258"></a>
+<span class="sourceLineNo">1259</span>      try (Table table = connection.getTable(tableName);<a name="line.1259"></a>
+<span class="sourceLineNo">1260</span>        RegionLocator locator = connection.getRegionLocator(tableName)) {<a name="line.1260"></a>
+<span class="sourceLineNo">1261</span>        boolean silence = "yes".equalsIgnoreCase(getConf().get(IGNORE_UNMATCHED_CF_CONF_KEY, ""));<a name="line.1261"></a>
+<span class="sourceLineNo">1262</span>        boolean copyFiles = getConf().getBoolean(ALWAYS_COPY_FILES, false);<a name="line.1262"></a>
+<span class="sourceLineNo">1263</span>        if (dirPath != null) {<a name="line.1263"></a>
+<span class="sourceLineNo">1264</span>          doBulkLoad(hfofDir, admin, table, locator, silence, copyFiles);<a name="line.1264"></a>
+<span class="sourceLineNo">1265</span>        } else {<a name="line.1265"></a>
+<span class="sourceLineNo">1266</span>          doBulkLoad(map, admin, table, locator, silence, copyFiles);<a name="line.1266"></a>
+<span class="sourceLineNo">1267</span>        }<a name="line.1267"></a>
+<span class="sourceLineNo">1268</span>        return retValue;<a name="line.1268"></a>
+<span class="sourceLineNo">1269</span>      }<a name="line.1269"></a>
+<span class="sourceLineNo">1270</span>    }<a name="line.1270"></a>
+<span class="sourceLineNo">1271</span>  }<a name="line.1271"></a>
+<span class="sourceLineNo">1272</span><a name="line.1272"></a>
+<span class="sourceLineNo">1273</span>  @Override<a name="line.1273"></a>
+<span class="sourceLineNo">1274</span>  public int run(String[] args) throws Exception {<a name="line.1274"></a>
+<span class="sourceLineNo">1275</span>    if (args.length &lt; 2) {<a name="line.1275"></a>
+<span class="sourceLineNo">1276</span>      usage();<a name="line.1276"></a>
+<span class="sourceLineNo">1277</span>      return -1;<a name="line.1277"></a>
+<span class="sourceLineNo">1278</span>    }<a name="line.1278"></a>
+<span class="sourceLineNo">1279</span><a name="line.1279"></a>
+<span class="sourceLineNo">1280</span>    String dirPath = args[0];<a name="line.1280"></a>
+<span class="sourceLineNo">1281</span>    TableName tableName = TableName.valueOf(args[1]);<a name="line.1281"></a>
+<span class="sourceLineNo">1282</span>    Map&lt;LoadQueueItem, ByteBuffer&gt; loaded = run(dirPath, null, tableName);<a name="line.1282"></a>
+<span class="sourceLineNo">1283</span>    if (loaded == null || !loaded.isEmpty()) return 0;<a name="line.1283"></a>
+<span class="sourceLineNo">1284</span>    return -1;<a name="line.1284"></a>
+<span class="sourceLineNo">1285</span>  }<a name="line.1285"></a>
+<span class="sourceLineNo">1286</span><a name="line.1286"></a>
+<span class="sourceLineNo">1287</span>  public static void main(String[] args) throws Exception {<a name="line.1287"></a>
+<span class="sourceLineNo">1288</span>    Configuration conf = HBaseConfiguration.create();<a name="line.1288"></a>
+<span class="sourceLineNo">1289</span>    int ret = ToolRunner.run(conf, new LoadIncrementalHFiles(conf), args);<a name="line.1289"></a>
+<span class="sourceLineNo">1290</span>    System.exit(ret);<a name="line.1290"></a>
 <span class="sourceLineNo">1291</span>  }<a name="line.1291"></a>
 <span class="sourceLineNo">1292</span><a name="line.1292"></a>
-<span class="sourceLineNo">1293</span>  public static void main(String[] args) throws Exception {<a name="line.1293"></a>
-<span class="sourceLineNo">1294</span>    Configuration conf = HBaseConfiguration.create();<a name="line.1294"></a>
-<span class="sourceLineNo">1295</span>    int ret = ToolRunner.run(conf, new LoadIncrementalHFiles(conf), args);<a name="line.1295"></a>
-<span class="sourceLineNo">1296</span>    System.exit(ret);<a name="line.1296"></a>
-<span class="sourceLineNo">1297</span>  }<a name="line.1297"></a>
-<span class="sourceLineNo">1298</span><a name="line.1298"></a>
-<span class="sourceLineNo">1299</span>  /**<a name="line.1299"></a>
-<span class="sourceLineNo">1300</span>   * Called from replication sink, where it manages bulkToken(staging directory) by itself. This is<a name="line.1300"></a>
-<span class="sourceLineNo">1301</span>   * used only when SecureBulkLoadEndpoint is configured in hbase.coprocessor.region.classes<a name="line.1301"></a>
-<span class="sourceLineNo">1302</span>   * property. This directory is used as a temporary directory where all files are initially<a name="line.1302"></a>
-<span class="sourceLineNo">1303</span>   * copied/moved from user given directory, set all the required file permissions and then from<a name="line.1303"></a>
-<span class="sourceLineNo">1304</span>   * their it is finally loaded into a table. This should be set only when, one would like to manage<a name="line.1304"></a>
-<span class="sourceLineNo">1305</span>   * the staging directory by itself. Otherwise this tool will handle this by itself.<a name="line.1305"></a>
-<span class="sourceLineNo">1306</span>   * @param stagingDir staging directory path<a name="line.1306"></a>
-<span class="sourceLineNo">1307</span>   */<a name="line.1307"></a>
-<span class="sourceLineNo">1308</span>  public void setBulkToken(String stagingDir) {<a name="line.1308"></a>
-<span class="sourceLineNo">1309</span>    this.bulkToken = stagingDir;<a name="line.1309"></a>
-<span class="sourceLineNo">1310</span>  }<a name="line.1310"></a>
-<span class="sourceLineNo">1311</span>}<a name="line.1311"></a>
+<span class="sourceLineNo">1293</span>  /**<a name="line.1293"></a>
+<span class="sourceLineNo">1294</span>   * Called from replication sink, where it manages bulkToken(staging directory) by itself. This is<a name="line.1294"></a>
+<span class="sourceLineNo">1295</span>   * used only when SecureBulkLoadEndpoint is configured in hbase.coprocessor.region.classes<a name="line.1295"></a>
+<span class="sourceLineNo">1296</span>   * property. This directory is used as a temporary directory where all files are initially<a name="line.1296"></a>
+<span class="sourceLineNo">1297</span>   * copied/moved from user given directory, set all the required file permissions and then from<a name="line.1297"></a>
+<span class="sourceLineNo">1298</span>   * their it is finally loaded into a table. This should be set only when, one would like to manage<a name="line.1298"></a>
+<span class="sourceLineNo">1299</span>   * the staging directory by itself. Otherwise this tool will handle this by itself.<a name="line.1299"></a>
+<span class="sourceLineNo">1300</span>   * @param stagingDir staging directory path<a name="line.1300"></a>
+<span class="sourceLineNo">1301</span>   */<a name="line.1301"></a>
+<span class="sourceLineNo">1302</span>  public void setBulkToken(String stagingDir) {<a name="line.1302"></a>
+<span class="sourceLineNo">1303</span>    this.bulkToken = stagingDir;<a name="line.1303"></a>
+<span class="sourceLineNo">1304</span>  }<a name="line.1304"></a>
+<span class="sourceLineNo">1305</span>}<a name="line.1305"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/9eba7fcf/devapidocs/src-html/org/apache/hadoop/hbase/master/DeadServer.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/DeadServer.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/DeadServer.html
index 0f70d04..3603490 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/DeadServer.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/DeadServer.html
@@ -142,80 +142,75 @@
 <span class="sourceLineNo">134</span><a name="line.134"></a>
 <span class="sourceLineNo">135</span>    assert numProcessing &gt;= 0: "Number of dead servers in processing should always be non-negative";<a name="line.135"></a>
 <span class="sourceLineNo">136</span><a name="line.136"></a>
-<span class="sourceLineNo">137</span>    if (numProcessing &lt; 0) {<a name="line.137"></a>
-<span class="sourceLineNo">138</span>      LOG.error("Number of dead servers in processing = " + numProcessing<a name="line.138"></a>
-<span class="sourceLineNo">139</span>          + ". Something went wrong, this should always be non-negative.");<a name="line.139"></a>
-<span class="sourceLineNo">140</span>      numProcessing = 0;<a name="line.140"></a>
-<span class="sourceLineNo">141</span>    }<a name="line.141"></a>
-<span class="sourceLineNo">142</span>    if (numProcessing == 0) { processing = false; }<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 synchronized int size() {<a name="line.145"></a>
-<span class="sourceLineNo">146</span>    return deadServers.size();<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>  public synchronized boolean isEmpty() {<a name="line.149"></a>
-<span class="sourceLineNo">150</span>    return deadServers.isEmpty();<a name="line.150"></a>
-<span class="sourceLineNo">151</span>  }<a name="line.151"></a>
-<span class="sourceLineNo">152</span><a name="line.152"></a>
-<span class="sourceLineNo">153</span>  public synchronized void cleanAllPreviousInstances(final ServerName newServerName) {<a name="line.153"></a>
-<span class="sourceLineNo">154</span>    Iterator&lt;ServerName&gt; it = deadServers.keySet().iterator();<a name="line.154"></a>
-<span class="sourceLineNo">155</span>    while (it.hasNext()) {<a name="line.155"></a>
-<span class="sourceLineNo">156</span>      ServerName sn = it.next();<a name="line.156"></a>
-<span class="sourceLineNo">157</span>      if (ServerName.isSameHostnameAndPort(sn, newServerName)) {<a name="line.157"></a>
-<span class="sourceLineNo">158</span>        it.remove();<a name="line.158"></a>
-<span class="sourceLineNo">159</span>      }<a name="line.159"></a>
-<span class="sourceLineNo">160</span>    }<a name="line.160"></a>
-<span class="sourceLineNo">161</span>  }<a name="line.161"></a>
-<span class="sourceLineNo">162</span><a name="line.162"></a>
-<span class="sourceLineNo">163</span>  public synchronized String toString() {<a name="line.163"></a>
-<span class="sourceLineNo">164</span>    StringBuilder sb = new StringBuilder();<a name="line.164"></a>
-<span class="sourceLineNo">165</span>    for (ServerName sn : deadServers.keySet()) {<a name="line.165"></a>
-<span class="sourceLineNo">166</span>      if (sb.length() &gt; 0) {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>        sb.append(", ");<a name="line.167"></a>
-<span class="sourceLineNo">168</span>      }<a name="line.168"></a>
-<span class="sourceLineNo">169</span>      sb.append(sn.toString());<a name="line.169"></a>
-<span class="sourceLineNo">170</span>    }<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    return sb.toString();<a name="line.171"></a>
-<span class="sourceLineNo">172</span>  }<a name="line.172"></a>
-<span class="sourceLineNo">173</span><a name="line.173"></a>
-<span class="sourceLineNo">174</span>  /**<a name="line.174"></a>
-<span class="sourceLineNo">175</span>   * Extract all the servers dead since a given time, and sort them.<a name="line.175"></a>
-<span class="sourceLineNo">176</span>   * @param ts the time, 0 for all<a name="line.176"></a>
-<span class="sourceLineNo">177</span>   * @return a sorted array list, by death time, lowest values first.<a name="line.177"></a>
-<span class="sourceLineNo">178</span>   */<a name="line.178"></a>
-<span class="sourceLineNo">179</span>  public synchronized List&lt;Pair&lt;ServerName, Long&gt;&gt; copyDeadServersSince(long ts){<a name="line.179"></a>
-<span class="sourceLineNo">180</span>    List&lt;Pair&lt;ServerName, Long&gt;&gt; res =  new ArrayList&lt;&gt;(size());<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>    for (Map.Entry&lt;ServerName, Long&gt; entry:deadServers.entrySet()){<a name="line.182"></a>
-<span class="sourceLineNo">183</span>      if (entry.getValue() &gt;= ts){<a name="line.183"></a>
-<span class="sourceLineNo">184</span>        res.add(new Pair&lt;&gt;(entry.getKey(), entry.getValue()));<a name="line.184"></a>
-<span class="sourceLineNo">185</span>      }<a name="line.185"></a>
-<span class="sourceLineNo">186</span>    }<a name="line.186"></a>
-<span class="sourceLineNo">187</span><a name="line.187"></a>
-<span class="sourceLineNo">188</span>    Collections.sort(res, ServerNameDeathDateComparator);<a name="line.188"></a>
-<span class="sourceLineNo">189</span>    return res;<a name="line.189"></a>
-<span class="sourceLineNo">190</span>  }<a name="line.190"></a>
-<span class="sourceLineNo">191</span>  <a name="line.191"></a>
-<span class="sourceLineNo">192</span>  /**<a name="line.192"></a>
-<span class="sourceLineNo">193</span>   * Get the time when a server died<a name="line.193"></a>
-<span class="sourceLineNo">194</span>   * @param deadServerName the dead server name<a name="line.194"></a>
-<span class="sourceLineNo">195</span>   * @return the date when the server died <a name="line.195"></a>
-<span class="sourceLineNo">196</span>   */<a name="line.196"></a>
-<span class="sourceLineNo">197</span>  public synchronized Date getTimeOfDeath(final ServerName deadServerName){<a name="line.197"></a>
-<span class="sourceLineNo">198</span>    Long time = deadServers.get(deadServerName);<a name="line.198"></a>
-<span class="sourceLineNo">199</span>    return time == null ? null : new Date(time);<a name="line.199"></a>
-<span class="sourceLineNo">200</span>  }<a name="line.200"></a>
-<span class="sourceLineNo">201</span><a name="line.201"></a>
-<span class="sourceLineNo">202</span>  private static Comparator&lt;Pair&lt;ServerName, Long&gt;&gt; ServerNameDeathDateComparator =<a name="line.202"></a>
-<span class="sourceLineNo">203</span>      new Comparator&lt;Pair&lt;ServerName, Long&gt;&gt;(){<a name="line.203"></a>
-<span class="sourceLineNo">204</span><a name="line.204"></a>
-<span class="sourceLineNo">205</span>    @Override<a name="line.205"></a>
-<span class="sourceLineNo">206</span>    public int compare(Pair&lt;ServerName, Long&gt; o1, Pair&lt;ServerName, Long&gt; o2) {<a name="line.206"></a>
-<span class="sourceLineNo">207</span>      return o1.getSecond().compareTo(o2.getSecond());<a name="line.207"></a>
-<span class="sourceLineNo">208</span>    }<a name="line.208"></a>
-<span class="sourceLineNo">209</span>  };<a name="line.209"></a>
-<span class="sourceLineNo">210</span>}<a name="line.210"></a>
+<span class="sourceLineNo">137</span>    if (numProcessing == 0) { processing = false; }<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 synchronized int size() {<a name="line.140"></a>
+<span class="sourceLineNo">141</span>    return deadServers.size();<a name="line.141"></a>
+<span class="sourceLineNo">142</span>  }<a name="line.142"></a>
+<span class="sourceLineNo">143</span><a name="line.143"></a>
+<span class="sourceLineNo">144</span>  public synchronized boolean isEmpty() {<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    return deadServers.isEmpty();<a name="line.145"></a>
+<span class="sourceLineNo">146</span>  }<a name="line.146"></a>
+<span class="sourceLineNo">147</span><a name="line.147"></a>
+<span class="sourceLineNo">148</span>  public synchronized void cleanAllPreviousInstances(final ServerName newServerName) {<a name="line.148"></a>
+<span class="sourceLineNo">149</span>    Iterator&lt;ServerName&gt; it = deadServers.keySet().iterator();<a name="line.149"></a>
+<span class="sourceLineNo">150</span>    while (it.hasNext()) {<a name="line.150"></a>
+<span class="sourceLineNo">151</span>      ServerName sn = it.next();<a name="line.151"></a>
+<span class="sourceLineNo">152</span>      if (ServerName.isSameHostnameAndPort(sn, newServerName)) {<a name="line.152"></a>
+<span class="sourceLineNo">153</span>        it.remove();<a name="line.153"></a>
+<span class="sourceLineNo">154</span>      }<a name="line.154"></a>
+<span class="sourceLineNo">155</span>    }<a name="line.155"></a>
+<span class="sourceLineNo">156</span>  }<a name="line.156"></a>
+<span class="sourceLineNo">157</span><a name="line.157"></a>
+<span class="sourceLineNo">158</span>  public synchronized String toString() {<a name="line.158"></a>
+<span class="sourceLineNo">159</span>    StringBuilder sb = new StringBuilder();<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    for (ServerName sn : deadServers.keySet()) {<a name="line.160"></a>
+<span class="sourceLineNo">161</span>      if (sb.length() &gt; 0) {<a name="line.161"></a>
+<span class="sourceLineNo">162</span>        sb.append(", ");<a name="line.162"></a>
+<span class="sourceLineNo">163</span>      }<a name="line.163"></a>
+<span class="sourceLineNo">164</span>      sb.append(sn.toString());<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    }<a name="line.165"></a>
+<span class="sourceLineNo">166</span>    return sb.toString();<a name="line.166"></a>
+<span class="sourceLineNo">167</span>  }<a name="line.167"></a>
+<span class="sourceLineNo">168</span><a name="line.168"></a>
+<span class="sourceLineNo">169</span>  /**<a name="line.169"></a>
+<span class="sourceLineNo">170</span>   * Extract all the servers dead since a given time, and sort them.<a name="line.170"></a>
+<span class="sourceLineNo">171</span>   * @param ts the time, 0 for all<a name="line.171"></a>
+<span class="sourceLineNo">172</span>   * @return a sorted array list, by death time, lowest values first.<a name="line.172"></a>
+<span class="sourceLineNo">173</span>   */<a name="line.173"></a>
+<span class="sourceLineNo">174</span>  public synchronized List&lt;Pair&lt;ServerName, Long&gt;&gt; copyDeadServersSince(long ts){<a name="line.174"></a>
+<span class="sourceLineNo">175</span>    List&lt;Pair&lt;ServerName, Long&gt;&gt; res =  new ArrayList&lt;&gt;(size());<a name="line.175"></a>
+<span class="sourceLineNo">176</span><a name="line.176"></a>
+<span class="sourceLineNo">177</span>    for (Map.Entry&lt;ServerName, Long&gt; entry:deadServers.entrySet()){<a name="line.177"></a>
+<span class="sourceLineNo">178</span>      if (entry.getValue() &gt;= ts){<a name="line.178"></a>
+<span class="sourceLineNo">179</span>        res.add(new Pair&lt;&gt;(entry.getKey(), entry.getValue()));<a name="line.179"></a>
+<span class="sourceLineNo">180</span>      }<a name="line.180"></a>
+<span class="sourceLineNo">181</span>    }<a name="line.181"></a>
+<span class="sourceLineNo">182</span><a name="line.182"></a>
+<span class="sourceLineNo">183</span>    Collections.sort(res, ServerNameDeathDateComparator);<a name="line.183"></a>
+<span class="sourceLineNo">184</span>    return res;<a name="line.184"></a>
+<span class="sourceLineNo">185</span>  }<a name="line.185"></a>
+<span class="sourceLineNo">186</span>  <a name="line.186"></a>
+<span class="sourceLineNo">187</span>  /**<a name="line.187"></a>
+<span class="sourceLineNo">188</span>   * Get the time when a server died<a name="line.188"></a>
+<span class="sourceLineNo">189</span>   * @param deadServerName the dead server name<a name="line.189"></a>
+<span class="sourceLineNo">190</span>   * @return the date when the server died <a name="line.190"></a>
+<span class="sourceLineNo">191</span>   */<a name="line.191"></a>
+<span class="sourceLineNo">192</span>  public synchronized Date getTimeOfDeath(final ServerName deadServerName){<a name="line.192"></a>
+<span class="sourceLineNo">193</span>    Long time = deadServers.get(deadServerName);<a name="line.193"></a>
+<span class="sourceLineNo">194</span>    return time == null ? null : new Date(time);<a name="line.194"></a>
+<span class="sourceLineNo">195</span>  }<a name="line.195"></a>
+<span class="sourceLineNo">196</span><a name="line.196"></a>
+<span class="sourceLineNo">197</span>  private static Comparator&lt;Pair&lt;ServerName, Long&gt;&gt; ServerNameDeathDateComparator =<a name="line.197"></a>
+<span class="sourceLineNo">198</span>      new Comparator&lt;Pair&lt;ServerName, Long&gt;&gt;(){<a name="line.198"></a>
+<span class="sourceLineNo">199</span><a name="line.199"></a>
+<span class="sourceLineNo">200</span>    @Override<a name="line.200"></a>
+<span class="sourceLineNo">201</span>    public int compare(Pair&lt;ServerName, Long&gt; o1, Pair&lt;ServerName, Long&gt; o2) {<a name="line.201"></a>
+<span class="sourceLineNo">202</span>      return o1.getSecond().compareTo(o2.getSecond());<a name="line.202"></a>
+<span class="sourceLineNo">203</span>    }<a name="line.203"></a>
+<span class="sourceLineNo">204</span>  };<a name="line.204"></a>
+<span class="sourceLineNo">205</span>}<a name="line.205"></a>
 
 
 


Mime
View raw message