hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject [22/51] [partial] hbase-site git commit: Published site at 07b623670647686084f8f5fd2038e2bafcfdac54.
Date Wed, 30 Dec 2015 22:15:43 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e5c3dcd1/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.LoadQueueItem.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.LoadQueueItem.html b/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.LoadQueueItem.html
index 7c00453..f955098 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.LoadQueueItem.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.LoadQueueItem.html
@@ -911,177 +911,178 @@
 <span class="sourceLineNo">903</span>                                  .withBytesPerCheckSum(HStore.getBytesPerChecksum(conf))<a name="line.903"></a>
 <span class="sourceLineNo">904</span>                                  .withBlockSize(blocksize)<a name="line.904"></a>
 <span class="sourceLineNo">905</span>                                  .withDataBlockEncoding(familyDescriptor.getDataBlockEncoding())<a name="line.905"></a>
-<span class="sourceLineNo">906</span>                                  .build();<a name="line.906"></a>
-<span class="sourceLineNo">907</span>      halfWriter = new StoreFile.WriterBuilder(conf, cacheConf,<a name="line.907"></a>
-<span class="sourceLineNo">908</span>          fs)<a name="line.908"></a>
-<span class="sourceLineNo">909</span>              .withFilePath(outFile)<a name="line.909"></a>
-<span class="sourceLineNo">910</span>              .withBloomType(bloomFilterType)<a name="line.910"></a>
-<span class="sourceLineNo">911</span>              .withFileContext(hFileContext)<a name="line.911"></a>
-<span class="sourceLineNo">912</span>              .build();<a name="line.912"></a>
-<span class="sourceLineNo">913</span>      HFileScanner scanner = halfReader.getScanner(false, false, false);<a name="line.913"></a>
-<span class="sourceLineNo">914</span>      scanner.seekTo();<a name="line.914"></a>
-<span class="sourceLineNo">915</span>      do {<a name="line.915"></a>
-<span class="sourceLineNo">916</span>        halfWriter.append(scanner.getCell());<a name="line.916"></a>
-<span class="sourceLineNo">917</span>      } while (scanner.next());<a name="line.917"></a>
-<span class="sourceLineNo">918</span><a name="line.918"></a>
-<span class="sourceLineNo">919</span>      for (Map.Entry&lt;byte[],byte[]&gt; entry : fileInfo.entrySet()) {<a name="line.919"></a>
-<span class="sourceLineNo">920</span>        if (shouldCopyHFileMetaKey(entry.getKey())) {<a name="line.920"></a>
-<span class="sourceLineNo">921</span>          halfWriter.appendFileInfo(entry.getKey(), entry.getValue());<a name="line.921"></a>
-<span class="sourceLineNo">922</span>        }<a name="line.922"></a>
-<span class="sourceLineNo">923</span>      }<a name="line.923"></a>
-<span class="sourceLineNo">924</span>    } finally {<a name="line.924"></a>
-<span class="sourceLineNo">925</span>      if (halfWriter != null) halfWriter.close();<a name="line.925"></a>
-<span class="sourceLineNo">926</span>      if (halfReader != null) halfReader.close(cacheConf.shouldEvictOnClose());<a name="line.926"></a>
-<span class="sourceLineNo">927</span>    }<a name="line.927"></a>
-<span class="sourceLineNo">928</span>  }<a name="line.928"></a>
-<span class="sourceLineNo">929</span><a name="line.929"></a>
-<span class="sourceLineNo">930</span>  private static boolean shouldCopyHFileMetaKey(byte[] key) {<a name="line.930"></a>
-<span class="sourceLineNo">931</span>    return !HFile.isReservedFileInfoKey(key);<a name="line.931"></a>
-<span class="sourceLineNo">932</span>  }<a name="line.932"></a>
-<span class="sourceLineNo">933</span><a name="line.933"></a>
-<span class="sourceLineNo">934</span>  /*<a name="line.934"></a>
-<span class="sourceLineNo">935</span>   * Infers region boundaries for a new table.<a name="line.935"></a>
-<span class="sourceLineNo">936</span>   * Parameter:<a name="line.936"></a>
-<span class="sourceLineNo">937</span>   *   bdryMap is a map between keys to an integer belonging to {+1, -1}<a name="line.937"></a>
-<span class="sourceLineNo">938</span>   *     If a key is a start key of a file, then it maps to +1<a name="line.938"></a>
-<span class="sourceLineNo">939</span>   *     If a key is an end key of a file, then it maps to -1<a name="line.939"></a>
-<span class="sourceLineNo">940</span>   * Algo:<a name="line.940"></a>
-<span class="sourceLineNo">941</span>   * 1) Poll on the keys in order:<a name="line.941"></a>
-<span class="sourceLineNo">942</span>   *    a) Keep adding the mapped values to these keys (runningSum)<a name="line.942"></a>
-<span class="sourceLineNo">943</span>   *    b) Each time runningSum reaches 0, add the start Key from when the runningSum had started to<a name="line.943"></a>
-<span class="sourceLineNo">944</span>   *       a boundary list.<a name="line.944"></a>
-<span class="sourceLineNo">945</span>   * 2) Return the boundary list.<a name="line.945"></a>
-<span class="sourceLineNo">946</span>   */<a name="line.946"></a>
-<span class="sourceLineNo">947</span>  public static byte[][] inferBoundaries(TreeMap&lt;byte[], Integer&gt; bdryMap) {<a name="line.947"></a>
-<span class="sourceLineNo">948</span>    ArrayList&lt;byte[]&gt; keysArray = new ArrayList&lt;byte[]&gt;();<a name="line.948"></a>
-<span class="sourceLineNo">949</span>    int runningValue = 0;<a name="line.949"></a>
-<span class="sourceLineNo">950</span>    byte[] currStartKey = null;<a name="line.950"></a>
-<span class="sourceLineNo">951</span>    boolean firstBoundary = true;<a name="line.951"></a>
-<span class="sourceLineNo">952</span><a name="line.952"></a>
-<span class="sourceLineNo">953</span>    for (Map.Entry&lt;byte[], Integer&gt; item: bdryMap.entrySet()) {<a name="line.953"></a>
-<span class="sourceLineNo">954</span>      if (runningValue == 0) currStartKey = item.getKey();<a name="line.954"></a>
-<span class="sourceLineNo">955</span>      runningValue += item.getValue();<a name="line.955"></a>
-<span class="sourceLineNo">956</span>      if (runningValue == 0) {<a name="line.956"></a>
-<span class="sourceLineNo">957</span>        if (!firstBoundary) keysArray.add(currStartKey);<a name="line.957"></a>
-<span class="sourceLineNo">958</span>        firstBoundary = false;<a name="line.958"></a>
-<span class="sourceLineNo">959</span>      }<a name="line.959"></a>
-<span class="sourceLineNo">960</span>    }<a name="line.960"></a>
-<span class="sourceLineNo">961</span><a name="line.961"></a>
-<span class="sourceLineNo">962</span>    return keysArray.toArray(new byte[0][0]);<a name="line.962"></a>
-<span class="sourceLineNo">963</span>  }<a name="line.963"></a>
-<span class="sourceLineNo">964</span><a name="line.964"></a>
-<span class="sourceLineNo">965</span>  /*<a name="line.965"></a>
-<span class="sourceLineNo">966</span>   * If the table is created for the first time, then "completebulkload" reads the files twice.<a name="line.966"></a>
-<span class="sourceLineNo">967</span>   * More modifications necessary if we want to avoid doing it.<a name="line.967"></a>
-<span class="sourceLineNo">968</span>   */<a name="line.968"></a>
-<span class="sourceLineNo">969</span>  private void createTable(TableName tableName, String dirPath, Admin admin) throws Exception {<a name="line.969"></a>
-<span class="sourceLineNo">970</span>    final Path hfofDir = new Path(dirPath);<a name="line.970"></a>
-<span class="sourceLineNo">971</span>    final FileSystem fs = hfofDir.getFileSystem(getConf());<a name="line.971"></a>
-<span class="sourceLineNo">972</span><a name="line.972"></a>
-<span class="sourceLineNo">973</span>    // Add column families<a name="line.973"></a>
-<span class="sourceLineNo">974</span>    // Build a set of keys<a name="line.974"></a>
-<span class="sourceLineNo">975</span>    final HTableDescriptor htd = new HTableDescriptor(tableName);<a name="line.975"></a>
-<span class="sourceLineNo">976</span>    final TreeMap&lt;byte[], Integer&gt; map = new TreeMap&lt;byte[], Integer&gt;(Bytes.BYTES_COMPARATOR);<a name="line.976"></a>
-<span class="sourceLineNo">977</span>    visitBulkHFiles(fs, hfofDir, new BulkHFileVisitor&lt;HColumnDescriptor&gt;() {<a name="line.977"></a>
-<span class="sourceLineNo">978</span>      @Override<a name="line.978"></a>
-<span class="sourceLineNo">979</span>      public HColumnDescriptor bulkFamily(final byte[] familyName) {<a name="line.979"></a>
-<span class="sourceLineNo">980</span>        HColumnDescriptor hcd = new HColumnDescriptor(familyName);<a name="line.980"></a>
-<span class="sourceLineNo">981</span>        htd.addFamily(hcd);<a name="line.981"></a>
-<span class="sourceLineNo">982</span>        return hcd;<a name="line.982"></a>
-<span class="sourceLineNo">983</span>      }<a name="line.983"></a>
-<span class="sourceLineNo">984</span>      @Override<a name="line.984"></a>
-<span class="sourceLineNo">985</span>      public void bulkHFile(final HColumnDescriptor hcd, final FileStatus hfileStatus)<a name="line.985"></a>
-<span class="sourceLineNo">986</span>          throws IOException {<a name="line.986"></a>
-<span class="sourceLineNo">987</span>        Path hfile = hfileStatus.getPath();<a name="line.987"></a>
-<span class="sourceLineNo">988</span>        HFile.Reader reader = HFile.createReader(fs, hfile,<a name="line.988"></a>
-<span class="sourceLineNo">989</span>            new CacheConfig(getConf()), getConf());<a name="line.989"></a>
-<span class="sourceLineNo">990</span>        try {<a name="line.990"></a>
-<span class="sourceLineNo">991</span>          if (hcd.getCompressionType() != reader.getFileContext().getCompression()) {<a name="line.991"></a>
-<span class="sourceLineNo">992</span>            hcd.setCompressionType(reader.getFileContext().getCompression());<a name="line.992"></a>
-<span class="sourceLineNo">993</span>            LOG.info("Setting compression " + hcd.getCompressionType().name() +<a name="line.993"></a>
-<span class="sourceLineNo">994</span>                     " for family " + hcd.toString());<a name="line.994"></a>
-<span class="sourceLineNo">995</span>          }<a name="line.995"></a>
-<span class="sourceLineNo">996</span>          reader.loadFileInfo();<a name="line.996"></a>
-<span class="sourceLineNo">997</span>          byte[] first = reader.getFirstRowKey();<a name="line.997"></a>
-<span class="sourceLineNo">998</span>          byte[] last  = reader.getLastRowKey();<a name="line.998"></a>
-<span class="sourceLineNo">999</span><a name="line.999"></a>
-<span class="sourceLineNo">1000</span>          LOG.info("Trying to figure out region boundaries hfile=" + hfile +<a name="line.1000"></a>
-<span class="sourceLineNo">1001</span>            " first=" + Bytes.toStringBinary(first) +<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>            " last="  + Bytes.toStringBinary(last));<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span><a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>          // To eventually infer start key-end key boundaries<a name="line.1004"></a>
-<span class="sourceLineNo">1005</span>          Integer value = map.containsKey(first)? map.get(first):0;<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>          map.put(first, value+1);<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span><a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>          value = map.containsKey(last)? map.get(last):0;<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>          map.put(last, value-1);<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>        } finally {<a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>          reader.close();<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>        }<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>      }<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>    });<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span><a name="line.1015"></a>
-<span class="sourceLineNo">1016</span>    byte[][] keys = LoadIncrementalHFiles.inferBoundaries(map);<a name="line.1016"></a>
-<span class="sourceLineNo">1017</span>    admin.createTable(htd, keys);<a name="line.1017"></a>
-<span class="sourceLineNo">1018</span><a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>    LOG.info("Table "+ tableName +" is available!!");<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>  }<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span><a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>  @Override<a name="line.1022"></a>
-<span class="sourceLineNo">1023</span>  public int run(String[] args) throws Exception {<a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>    if (args.length != 2) {<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>      usage();<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span>      return -1;<a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>    }<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span><a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>    initialize();<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>    try (Connection connection = ConnectionFactory.createConnection(getConf());<a name="line.1030"></a>
-<span class="sourceLineNo">1031</span>        Admin admin = connection.getAdmin()) {<a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>      String dirPath = args[0];<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>      TableName tableName = TableName.valueOf(args[1]);<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span><a name="line.1034"></a>
-<span class="sourceLineNo">1035</span>      boolean tableExists = admin.tableExists(tableName);<a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>      if (!tableExists) {<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span>        if ("yes".equalsIgnoreCase(getConf().get(CREATE_TABLE_CONF_KEY, "yes"))) {<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>          this.createTable(tableName, dirPath, admin);<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>        } else {<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>          String errorMsg = format("Table '%s' does not exist.", tableName);<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>          LOG.error(errorMsg);<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>          throw new TableNotFoundException(errorMsg);<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>        }<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>      }<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span><a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>      Path hfofDir = new Path(dirPath);<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span><a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>      try (Table table = connection.getTable(tableName);<a name="line.1048"></a>
-<span class="sourceLineNo">1049</span>          RegionLocator locator = connection.getRegionLocator(tableName)) {<a name="line.1049"></a>
-<span class="sourceLineNo">1050</span>          doBulkLoad(hfofDir, admin, table, locator);<a name="line.1050"></a>
-<span class="sourceLineNo">1051</span>      }<a name="line.1051"></a>
-<span class="sourceLineNo">1052</span>    }<a name="line.1052"></a>
-<span class="sourceLineNo">1053</span><a name="line.1053"></a>
-<span class="sourceLineNo">1054</span>    return 0;<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>  public static void main(String[] args) throws Exception {<a name="line.1057"></a>
-<span class="sourceLineNo">1058</span>    Configuration conf = HBaseConfiguration.create();<a name="line.1058"></a>
-<span class="sourceLineNo">1059</span>    int ret = ToolRunner.run(conf, new LoadIncrementalHFiles(), args);<a name="line.1059"></a>
-<span class="sourceLineNo">1060</span>    System.exit(ret);<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>  /**<a name="line.1063"></a>
-<span class="sourceLineNo">1064</span>   * Called from replication sink, where it manages bulkToken(staging directory) by itself. This is<a name="line.1064"></a>
-<span class="sourceLineNo">1065</span>   * used only when {@link SecureBulkLoadEndpoint} is configured in hbase.coprocessor.region.classes<a name="line.1065"></a>
-<span class="sourceLineNo">1066</span>   * property. This directory is used as a temporary directory where all files are initially<a name="line.1066"></a>
-<span class="sourceLineNo">1067</span>   * copied/moved from user given directory, set all the required file permissions and then from<a name="line.1067"></a>
-<span class="sourceLineNo">1068</span>   * their it is finally loaded into a table. This should be set only when, one would like to manage<a name="line.1068"></a>
-<span class="sourceLineNo">1069</span>   * the staging directory by itself. Otherwise this tool will handle this by itself.<a name="line.1069"></a>
-<span class="sourceLineNo">1070</span>   * @param stagingDir staging directory path<a name="line.1070"></a>
-<span class="sourceLineNo">1071</span>   */<a name="line.1071"></a>
-<span class="sourceLineNo">1072</span>  public void setBulkToken(String stagingDir) {<a name="line.1072"></a>
-<span class="sourceLineNo">1073</span>    this.bulkToken = stagingDir;<a name="line.1073"></a>
-<span class="sourceLineNo">1074</span>  }<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">906</span>                                  .withIncludesTags(true)<a name="line.906"></a>
+<span class="sourceLineNo">907</span>                                  .build();<a name="line.907"></a>
+<span class="sourceLineNo">908</span>      halfWriter = new StoreFile.WriterBuilder(conf, cacheConf,<a name="line.908"></a>
+<span class="sourceLineNo">909</span>          fs)<a name="line.909"></a>
+<span class="sourceLineNo">910</span>              .withFilePath(outFile)<a name="line.910"></a>
+<span class="sourceLineNo">911</span>              .withBloomType(bloomFilterType)<a name="line.911"></a>
+<span class="sourceLineNo">912</span>              .withFileContext(hFileContext)<a name="line.912"></a>
+<span class="sourceLineNo">913</span>              .build();<a name="line.913"></a>
+<span class="sourceLineNo">914</span>      HFileScanner scanner = halfReader.getScanner(false, false, false);<a name="line.914"></a>
+<span class="sourceLineNo">915</span>      scanner.seekTo();<a name="line.915"></a>
+<span class="sourceLineNo">916</span>      do {<a name="line.916"></a>
+<span class="sourceLineNo">917</span>        halfWriter.append(scanner.getCell());<a name="line.917"></a>
+<span class="sourceLineNo">918</span>      } while (scanner.next());<a name="line.918"></a>
+<span class="sourceLineNo">919</span><a name="line.919"></a>
+<span class="sourceLineNo">920</span>      for (Map.Entry&lt;byte[],byte[]&gt; entry : fileInfo.entrySet()) {<a name="line.920"></a>
+<span class="sourceLineNo">921</span>        if (shouldCopyHFileMetaKey(entry.getKey())) {<a name="line.921"></a>
+<span class="sourceLineNo">922</span>          halfWriter.appendFileInfo(entry.getKey(), entry.getValue());<a name="line.922"></a>
+<span class="sourceLineNo">923</span>        }<a name="line.923"></a>
+<span class="sourceLineNo">924</span>      }<a name="line.924"></a>
+<span class="sourceLineNo">925</span>    } finally {<a name="line.925"></a>
+<span class="sourceLineNo">926</span>      if (halfWriter != null) halfWriter.close();<a name="line.926"></a>
+<span class="sourceLineNo">927</span>      if (halfReader != null) halfReader.close(cacheConf.shouldEvictOnClose());<a name="line.927"></a>
+<span class="sourceLineNo">928</span>    }<a name="line.928"></a>
+<span class="sourceLineNo">929</span>  }<a name="line.929"></a>
+<span class="sourceLineNo">930</span><a name="line.930"></a>
+<span class="sourceLineNo">931</span>  private static boolean shouldCopyHFileMetaKey(byte[] key) {<a name="line.931"></a>
+<span class="sourceLineNo">932</span>    return !HFile.isReservedFileInfoKey(key);<a name="line.932"></a>
+<span class="sourceLineNo">933</span>  }<a name="line.933"></a>
+<span class="sourceLineNo">934</span><a name="line.934"></a>
+<span class="sourceLineNo">935</span>  /*<a name="line.935"></a>
+<span class="sourceLineNo">936</span>   * Infers region boundaries for a new table.<a name="line.936"></a>
+<span class="sourceLineNo">937</span>   * Parameter:<a name="line.937"></a>
+<span class="sourceLineNo">938</span>   *   bdryMap is a map between keys to an integer belonging to {+1, -1}<a name="line.938"></a>
+<span class="sourceLineNo">939</span>   *     If a key is a start key of a file, then it maps to +1<a name="line.939"></a>
+<span class="sourceLineNo">940</span>   *     If a key is an end key of a file, then it maps to -1<a name="line.940"></a>
+<span class="sourceLineNo">941</span>   * Algo:<a name="line.941"></a>
+<span class="sourceLineNo">942</span>   * 1) Poll on the keys in order:<a name="line.942"></a>
+<span class="sourceLineNo">943</span>   *    a) Keep adding the mapped values to these keys (runningSum)<a name="line.943"></a>
+<span class="sourceLineNo">944</span>   *    b) Each time runningSum reaches 0, add the start Key from when the runningSum had started to<a name="line.944"></a>
+<span class="sourceLineNo">945</span>   *       a boundary list.<a name="line.945"></a>
+<span class="sourceLineNo">946</span>   * 2) Return the boundary list.<a name="line.946"></a>
+<span class="sourceLineNo">947</span>   */<a name="line.947"></a>
+<span class="sourceLineNo">948</span>  public static byte[][] inferBoundaries(TreeMap&lt;byte[], Integer&gt; bdryMap) {<a name="line.948"></a>
+<span class="sourceLineNo">949</span>    ArrayList&lt;byte[]&gt; keysArray = new ArrayList&lt;byte[]&gt;();<a name="line.949"></a>
+<span class="sourceLineNo">950</span>    int runningValue = 0;<a name="line.950"></a>
+<span class="sourceLineNo">951</span>    byte[] currStartKey = null;<a name="line.951"></a>
+<span class="sourceLineNo">952</span>    boolean firstBoundary = true;<a name="line.952"></a>
+<span class="sourceLineNo">953</span><a name="line.953"></a>
+<span class="sourceLineNo">954</span>    for (Map.Entry&lt;byte[], Integer&gt; item: bdryMap.entrySet()) {<a name="line.954"></a>
+<span class="sourceLineNo">955</span>      if (runningValue == 0) currStartKey = item.getKey();<a name="line.955"></a>
+<span class="sourceLineNo">956</span>      runningValue += item.getValue();<a name="line.956"></a>
+<span class="sourceLineNo">957</span>      if (runningValue == 0) {<a name="line.957"></a>
+<span class="sourceLineNo">958</span>        if (!firstBoundary) keysArray.add(currStartKey);<a name="line.958"></a>
+<span class="sourceLineNo">959</span>        firstBoundary = false;<a name="line.959"></a>
+<span class="sourceLineNo">960</span>      }<a name="line.960"></a>
+<span class="sourceLineNo">961</span>    }<a name="line.961"></a>
+<span class="sourceLineNo">962</span><a name="line.962"></a>
+<span class="sourceLineNo">963</span>    return keysArray.toArray(new byte[0][0]);<a name="line.963"></a>
+<span class="sourceLineNo">964</span>  }<a name="line.964"></a>
+<span class="sourceLineNo">965</span><a name="line.965"></a>
+<span class="sourceLineNo">966</span>  /*<a name="line.966"></a>
+<span class="sourceLineNo">967</span>   * If the table is created for the first time, then "completebulkload" reads the files twice.<a name="line.967"></a>
+<span class="sourceLineNo">968</span>   * More modifications necessary if we want to avoid doing it.<a name="line.968"></a>
+<span class="sourceLineNo">969</span>   */<a name="line.969"></a>
+<span class="sourceLineNo">970</span>  private void createTable(TableName tableName, String dirPath, Admin admin) throws Exception {<a name="line.970"></a>
+<span class="sourceLineNo">971</span>    final Path hfofDir = new Path(dirPath);<a name="line.971"></a>
+<span class="sourceLineNo">972</span>    final FileSystem fs = hfofDir.getFileSystem(getConf());<a name="line.972"></a>
+<span class="sourceLineNo">973</span><a name="line.973"></a>
+<span class="sourceLineNo">974</span>    // Add column families<a name="line.974"></a>
+<span class="sourceLineNo">975</span>    // Build a set of keys<a name="line.975"></a>
+<span class="sourceLineNo">976</span>    final HTableDescriptor htd = new HTableDescriptor(tableName);<a name="line.976"></a>
+<span class="sourceLineNo">977</span>    final TreeMap&lt;byte[], Integer&gt; map = new TreeMap&lt;byte[], Integer&gt;(Bytes.BYTES_COMPARATOR);<a name="line.977"></a>
+<span class="sourceLineNo">978</span>    visitBulkHFiles(fs, hfofDir, new BulkHFileVisitor&lt;HColumnDescriptor&gt;() {<a name="line.978"></a>
+<span class="sourceLineNo">979</span>      @Override<a name="line.979"></a>
+<span class="sourceLineNo">980</span>      public HColumnDescriptor bulkFamily(final byte[] familyName) {<a name="line.980"></a>
+<span class="sourceLineNo">981</span>        HColumnDescriptor hcd = new HColumnDescriptor(familyName);<a name="line.981"></a>
+<span class="sourceLineNo">982</span>        htd.addFamily(hcd);<a name="line.982"></a>
+<span class="sourceLineNo">983</span>        return hcd;<a name="line.983"></a>
+<span class="sourceLineNo">984</span>      }<a name="line.984"></a>
+<span class="sourceLineNo">985</span>      @Override<a name="line.985"></a>
+<span class="sourceLineNo">986</span>      public void bulkHFile(final HColumnDescriptor hcd, final FileStatus hfileStatus)<a name="line.986"></a>
+<span class="sourceLineNo">987</span>          throws IOException {<a name="line.987"></a>
+<span class="sourceLineNo">988</span>        Path hfile = hfileStatus.getPath();<a name="line.988"></a>
+<span class="sourceLineNo">989</span>        HFile.Reader reader = HFile.createReader(fs, hfile,<a name="line.989"></a>
+<span class="sourceLineNo">990</span>            new CacheConfig(getConf()), getConf());<a name="line.990"></a>
+<span class="sourceLineNo">991</span>        try {<a name="line.991"></a>
+<span class="sourceLineNo">992</span>          if (hcd.getCompressionType() != reader.getFileContext().getCompression()) {<a name="line.992"></a>
+<span class="sourceLineNo">993</span>            hcd.setCompressionType(reader.getFileContext().getCompression());<a name="line.993"></a>
+<span class="sourceLineNo">994</span>            LOG.info("Setting compression " + hcd.getCompressionType().name() +<a name="line.994"></a>
+<span class="sourceLineNo">995</span>                     " for family " + hcd.toString());<a name="line.995"></a>
+<span class="sourceLineNo">996</span>          }<a name="line.996"></a>
+<span class="sourceLineNo">997</span>          reader.loadFileInfo();<a name="line.997"></a>
+<span class="sourceLineNo">998</span>          byte[] first = reader.getFirstRowKey();<a name="line.998"></a>
+<span class="sourceLineNo">999</span>          byte[] last  = reader.getLastRowKey();<a name="line.999"></a>
+<span class="sourceLineNo">1000</span><a name="line.1000"></a>
+<span class="sourceLineNo">1001</span>          LOG.info("Trying to figure out region boundaries hfile=" + hfile +<a name="line.1001"></a>
+<span class="sourceLineNo">1002</span>            " first=" + Bytes.toStringBinary(first) +<a name="line.1002"></a>
+<span class="sourceLineNo">1003</span>            " last="  + Bytes.toStringBinary(last));<a name="line.1003"></a>
+<span class="sourceLineNo">1004</span><a name="line.1004"></a>
+<span class="sourceLineNo">1005</span>          // To eventually infer start key-end key boundaries<a name="line.1005"></a>
+<span class="sourceLineNo">1006</span>          Integer value = map.containsKey(first)? map.get(first):0;<a name="line.1006"></a>
+<span class="sourceLineNo">1007</span>          map.put(first, value+1);<a name="line.1007"></a>
+<span class="sourceLineNo">1008</span><a name="line.1008"></a>
+<span class="sourceLineNo">1009</span>          value = map.containsKey(last)? map.get(last):0;<a name="line.1009"></a>
+<span class="sourceLineNo">1010</span>          map.put(last, value-1);<a name="line.1010"></a>
+<span class="sourceLineNo">1011</span>        } finally {<a name="line.1011"></a>
+<span class="sourceLineNo">1012</span>          reader.close();<a name="line.1012"></a>
+<span class="sourceLineNo">1013</span>        }<a name="line.1013"></a>
+<span class="sourceLineNo">1014</span>      }<a name="line.1014"></a>
+<span class="sourceLineNo">1015</span>    });<a name="line.1015"></a>
+<span class="sourceLineNo">1016</span><a name="line.1016"></a>
+<span class="sourceLineNo">1017</span>    byte[][] keys = LoadIncrementalHFiles.inferBoundaries(map);<a name="line.1017"></a>
+<span class="sourceLineNo">1018</span>    admin.createTable(htd, keys);<a name="line.1018"></a>
+<span class="sourceLineNo">1019</span><a name="line.1019"></a>
+<span class="sourceLineNo">1020</span>    LOG.info("Table "+ tableName +" is available!!");<a name="line.1020"></a>
+<span class="sourceLineNo">1021</span>  }<a name="line.1021"></a>
+<span class="sourceLineNo">1022</span><a name="line.1022"></a>
+<span class="sourceLineNo">1023</span>  @Override<a name="line.1023"></a>
+<span class="sourceLineNo">1024</span>  public int run(String[] args) throws Exception {<a name="line.1024"></a>
+<span class="sourceLineNo">1025</span>    if (args.length != 2) {<a name="line.1025"></a>
+<span class="sourceLineNo">1026</span>      usage();<a name="line.1026"></a>
+<span class="sourceLineNo">1027</span>      return -1;<a name="line.1027"></a>
+<span class="sourceLineNo">1028</span>    }<a name="line.1028"></a>
+<span class="sourceLineNo">1029</span><a name="line.1029"></a>
+<span class="sourceLineNo">1030</span>    initialize();<a name="line.1030"></a>
+<span class="sourceLineNo">1031</span>    try (Connection connection = ConnectionFactory.createConnection(getConf());<a name="line.1031"></a>
+<span class="sourceLineNo">1032</span>        Admin admin = connection.getAdmin()) {<a name="line.1032"></a>
+<span class="sourceLineNo">1033</span>      String dirPath = args[0];<a name="line.1033"></a>
+<span class="sourceLineNo">1034</span>      TableName tableName = TableName.valueOf(args[1]);<a name="line.1034"></a>
+<span class="sourceLineNo">1035</span><a name="line.1035"></a>
+<span class="sourceLineNo">1036</span>      boolean tableExists = admin.tableExists(tableName);<a name="line.1036"></a>
+<span class="sourceLineNo">1037</span>      if (!tableExists) {<a name="line.1037"></a>
+<span class="sourceLineNo">1038</span>        if ("yes".equalsIgnoreCase(getConf().get(CREATE_TABLE_CONF_KEY, "yes"))) {<a name="line.1038"></a>
+<span class="sourceLineNo">1039</span>          this.createTable(tableName, dirPath, admin);<a name="line.1039"></a>
+<span class="sourceLineNo">1040</span>        } else {<a name="line.1040"></a>
+<span class="sourceLineNo">1041</span>          String errorMsg = format("Table '%s' does not exist.", tableName);<a name="line.1041"></a>
+<span class="sourceLineNo">1042</span>          LOG.error(errorMsg);<a name="line.1042"></a>
+<span class="sourceLineNo">1043</span>          throw new TableNotFoundException(errorMsg);<a name="line.1043"></a>
+<span class="sourceLineNo">1044</span>        }<a name="line.1044"></a>
+<span class="sourceLineNo">1045</span>      }<a name="line.1045"></a>
+<span class="sourceLineNo">1046</span><a name="line.1046"></a>
+<span class="sourceLineNo">1047</span>      Path hfofDir = new Path(dirPath);<a name="line.1047"></a>
+<span class="sourceLineNo">1048</span><a name="line.1048"></a>
+<span class="sourceLineNo">1049</span>      try (Table table = connection.getTable(tableName);<a name="line.1049"></a>
+<span class="sourceLineNo">1050</span>          RegionLocator locator = connection.getRegionLocator(tableName)) {<a name="line.1050"></a>
+<span class="sourceLineNo">1051</span>          doBulkLoad(hfofDir, admin, table, locator);<a name="line.1051"></a>
+<span class="sourceLineNo">1052</span>      }<a name="line.1052"></a>
+<span class="sourceLineNo">1053</span>    }<a name="line.1053"></a>
+<span class="sourceLineNo">1054</span><a name="line.1054"></a>
+<span class="sourceLineNo">1055</span>    return 0;<a name="line.1055"></a>
+<span class="sourceLineNo">1056</span>  }<a name="line.1056"></a>
+<span class="sourceLineNo">1057</span><a name="line.1057"></a>
+<span class="sourceLineNo">1058</span>  public static void main(String[] args) throws Exception {<a name="line.1058"></a>
+<span class="sourceLineNo">1059</span>    Configuration conf = HBaseConfiguration.create();<a name="line.1059"></a>
+<span class="sourceLineNo">1060</span>    int ret = ToolRunner.run(conf, new LoadIncrementalHFiles(), args);<a name="line.1060"></a>
+<span class="sourceLineNo">1061</span>    System.exit(ret);<a name="line.1061"></a>
+<span class="sourceLineNo">1062</span>  }<a name="line.1062"></a>
+<span class="sourceLineNo">1063</span><a name="line.1063"></a>
+<span class="sourceLineNo">1064</span>  /**<a name="line.1064"></a>
+<span class="sourceLineNo">1065</span>   * Called from replication sink, where it manages bulkToken(staging directory) by itself. This is<a name="line.1065"></a>
+<span class="sourceLineNo">1066</span>   * used only when {@link SecureBulkLoadEndpoint} is configured in hbase.coprocessor.region.classes<a name="line.1066"></a>
+<span class="sourceLineNo">1067</span>   * property. This directory is used as a temporary directory where all files are initially<a name="line.1067"></a>
+<span class="sourceLineNo">1068</span>   * copied/moved from user given directory, set all the required file permissions and then from<a name="line.1068"></a>
+<span class="sourceLineNo">1069</span>   * their it is finally loaded into a table. This should be set only when, one would like to manage<a name="line.1069"></a>
+<span class="sourceLineNo">1070</span>   * the staging directory by itself. Otherwise this tool will handle this by itself.<a name="line.1070"></a>
+<span class="sourceLineNo">1071</span>   * @param stagingDir staging directory path<a name="line.1071"></a>
+<span class="sourceLineNo">1072</span>   */<a name="line.1072"></a>
+<span class="sourceLineNo">1073</span>  public void setBulkToken(String stagingDir) {<a name="line.1073"></a>
+<span class="sourceLineNo">1074</span>    this.bulkToken = stagingDir;<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>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e5c3dcd1/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 7c00453..f955098 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.html
@@ -911,177 +911,178 @@
 <span class="sourceLineNo">903</span>                                  .withBytesPerCheckSum(HStore.getBytesPerChecksum(conf))<a name="line.903"></a>
 <span class="sourceLineNo">904</span>                                  .withBlockSize(blocksize)<a name="line.904"></a>
 <span class="sourceLineNo">905</span>                                  .withDataBlockEncoding(familyDescriptor.getDataBlockEncoding())<a name="line.905"></a>
-<span class="sourceLineNo">906</span>                                  .build();<a name="line.906"></a>
-<span class="sourceLineNo">907</span>      halfWriter = new StoreFile.WriterBuilder(conf, cacheConf,<a name="line.907"></a>
-<span class="sourceLineNo">908</span>          fs)<a name="line.908"></a>
-<span class="sourceLineNo">909</span>              .withFilePath(outFile)<a name="line.909"></a>
-<span class="sourceLineNo">910</span>              .withBloomType(bloomFilterType)<a name="line.910"></a>
-<span class="sourceLineNo">911</span>              .withFileContext(hFileContext)<a name="line.911"></a>
-<span class="sourceLineNo">912</span>              .build();<a name="line.912"></a>
-<span class="sourceLineNo">913</span>      HFileScanner scanner = halfReader.getScanner(false, false, false);<a name="line.913"></a>
-<span class="sourceLineNo">914</span>      scanner.seekTo();<a name="line.914"></a>
-<span class="sourceLineNo">915</span>      do {<a name="line.915"></a>
-<span class="sourceLineNo">916</span>        halfWriter.append(scanner.getCell());<a name="line.916"></a>
-<span class="sourceLineNo">917</span>      } while (scanner.next());<a name="line.917"></a>
-<span class="sourceLineNo">918</span><a name="line.918"></a>
-<span class="sourceLineNo">919</span>      for (Map.Entry&lt;byte[],byte[]&gt; entry : fileInfo.entrySet()) {<a name="line.919"></a>
-<span class="sourceLineNo">920</span>        if (shouldCopyHFileMetaKey(entry.getKey())) {<a name="line.920"></a>
-<span class="sourceLineNo">921</span>          halfWriter.appendFileInfo(entry.getKey(), entry.getValue());<a name="line.921"></a>
-<span class="sourceLineNo">922</span>        }<a name="line.922"></a>
-<span class="sourceLineNo">923</span>      }<a name="line.923"></a>
-<span class="sourceLineNo">924</span>    } finally {<a name="line.924"></a>
-<span class="sourceLineNo">925</span>      if (halfWriter != null) halfWriter.close();<a name="line.925"></a>
-<span class="sourceLineNo">926</span>      if (halfReader != null) halfReader.close(cacheConf.shouldEvictOnClose());<a name="line.926"></a>
-<span class="sourceLineNo">927</span>    }<a name="line.927"></a>
-<span class="sourceLineNo">928</span>  }<a name="line.928"></a>
-<span class="sourceLineNo">929</span><a name="line.929"></a>
-<span class="sourceLineNo">930</span>  private static boolean shouldCopyHFileMetaKey(byte[] key) {<a name="line.930"></a>
-<span class="sourceLineNo">931</span>    return !HFile.isReservedFileInfoKey(key);<a name="line.931"></a>
-<span class="sourceLineNo">932</span>  }<a name="line.932"></a>
-<span class="sourceLineNo">933</span><a name="line.933"></a>
-<span class="sourceLineNo">934</span>  /*<a name="line.934"></a>
-<span class="sourceLineNo">935</span>   * Infers region boundaries for a new table.<a name="line.935"></a>
-<span class="sourceLineNo">936</span>   * Parameter:<a name="line.936"></a>
-<span class="sourceLineNo">937</span>   *   bdryMap is a map between keys to an integer belonging to {+1, -1}<a name="line.937"></a>
-<span class="sourceLineNo">938</span>   *     If a key is a start key of a file, then it maps to +1<a name="line.938"></a>
-<span class="sourceLineNo">939</span>   *     If a key is an end key of a file, then it maps to -1<a name="line.939"></a>
-<span class="sourceLineNo">940</span>   * Algo:<a name="line.940"></a>
-<span class="sourceLineNo">941</span>   * 1) Poll on the keys in order:<a name="line.941"></a>
-<span class="sourceLineNo">942</span>   *    a) Keep adding the mapped values to these keys (runningSum)<a name="line.942"></a>
-<span class="sourceLineNo">943</span>   *    b) Each time runningSum reaches 0, add the start Key from when the runningSum had started to<a name="line.943"></a>
-<span class="sourceLineNo">944</span>   *       a boundary list.<a name="line.944"></a>
-<span class="sourceLineNo">945</span>   * 2) Return the boundary list.<a name="line.945"></a>
-<span class="sourceLineNo">946</span>   */<a name="line.946"></a>
-<span class="sourceLineNo">947</span>  public static byte[][] inferBoundaries(TreeMap&lt;byte[], Integer&gt; bdryMap) {<a name="line.947"></a>
-<span class="sourceLineNo">948</span>    ArrayList&lt;byte[]&gt; keysArray = new ArrayList&lt;byte[]&gt;();<a name="line.948"></a>
-<span class="sourceLineNo">949</span>    int runningValue = 0;<a name="line.949"></a>
-<span class="sourceLineNo">950</span>    byte[] currStartKey = null;<a name="line.950"></a>
-<span class="sourceLineNo">951</span>    boolean firstBoundary = true;<a name="line.951"></a>
-<span class="sourceLineNo">952</span><a name="line.952"></a>
-<span class="sourceLineNo">953</span>    for (Map.Entry&lt;byte[], Integer&gt; item: bdryMap.entrySet()) {<a name="line.953"></a>
-<span class="sourceLineNo">954</span>      if (runningValue == 0) currStartKey = item.getKey();<a name="line.954"></a>
-<span class="sourceLineNo">955</span>      runningValue += item.getValue();<a name="line.955"></a>
-<span class="sourceLineNo">956</span>      if (runningValue == 0) {<a name="line.956"></a>
-<span class="sourceLineNo">957</span>        if (!firstBoundary) keysArray.add(currStartKey);<a name="line.957"></a>
-<span class="sourceLineNo">958</span>        firstBoundary = false;<a name="line.958"></a>
-<span class="sourceLineNo">959</span>      }<a name="line.959"></a>
-<span class="sourceLineNo">960</span>    }<a name="line.960"></a>
-<span class="sourceLineNo">961</span><a name="line.961"></a>
-<span class="sourceLineNo">962</span>    return keysArray.toArray(new byte[0][0]);<a name="line.962"></a>
-<span class="sourceLineNo">963</span>  }<a name="line.963"></a>
-<span class="sourceLineNo">964</span><a name="line.964"></a>
-<span class="sourceLineNo">965</span>  /*<a name="line.965"></a>
-<span class="sourceLineNo">966</span>   * If the table is created for the first time, then "completebulkload" reads the files twice.<a name="line.966"></a>
-<span class="sourceLineNo">967</span>   * More modifications necessary if we want to avoid doing it.<a name="line.967"></a>
-<span class="sourceLineNo">968</span>   */<a name="line.968"></a>
-<span class="sourceLineNo">969</span>  private void createTable(TableName tableName, String dirPath, Admin admin) throws Exception {<a name="line.969"></a>
-<span class="sourceLineNo">970</span>    final Path hfofDir = new Path(dirPath);<a name="line.970"></a>
-<span class="sourceLineNo">971</span>    final FileSystem fs = hfofDir.getFileSystem(getConf());<a name="line.971"></a>
-<span class="sourceLineNo">972</span><a name="line.972"></a>
-<span class="sourceLineNo">973</span>    // Add column families<a name="line.973"></a>
-<span class="sourceLineNo">974</span>    // Build a set of keys<a name="line.974"></a>
-<span class="sourceLineNo">975</span>    final HTableDescriptor htd = new HTableDescriptor(tableName);<a name="line.975"></a>
-<span class="sourceLineNo">976</span>    final TreeMap&lt;byte[], Integer&gt; map = new TreeMap&lt;byte[], Integer&gt;(Bytes.BYTES_COMPARATOR);<a name="line.976"></a>
-<span class="sourceLineNo">977</span>    visitBulkHFiles(fs, hfofDir, new BulkHFileVisitor&lt;HColumnDescriptor&gt;() {<a name="line.977"></a>
-<span class="sourceLineNo">978</span>      @Override<a name="line.978"></a>
-<span class="sourceLineNo">979</span>      public HColumnDescriptor bulkFamily(final byte[] familyName) {<a name="line.979"></a>
-<span class="sourceLineNo">980</span>        HColumnDescriptor hcd = new HColumnDescriptor(familyName);<a name="line.980"></a>
-<span class="sourceLineNo">981</span>        htd.addFamily(hcd);<a name="line.981"></a>
-<span class="sourceLineNo">982</span>        return hcd;<a name="line.982"></a>
-<span class="sourceLineNo">983</span>      }<a name="line.983"></a>
-<span class="sourceLineNo">984</span>      @Override<a name="line.984"></a>
-<span class="sourceLineNo">985</span>      public void bulkHFile(final HColumnDescriptor hcd, final FileStatus hfileStatus)<a name="line.985"></a>
-<span class="sourceLineNo">986</span>          throws IOException {<a name="line.986"></a>
-<span class="sourceLineNo">987</span>        Path hfile = hfileStatus.getPath();<a name="line.987"></a>
-<span class="sourceLineNo">988</span>        HFile.Reader reader = HFile.createReader(fs, hfile,<a name="line.988"></a>
-<span class="sourceLineNo">989</span>            new CacheConfig(getConf()), getConf());<a name="line.989"></a>
-<span class="sourceLineNo">990</span>        try {<a name="line.990"></a>
-<span class="sourceLineNo">991</span>          if (hcd.getCompressionType() != reader.getFileContext().getCompression()) {<a name="line.991"></a>
-<span class="sourceLineNo">992</span>            hcd.setCompressionType(reader.getFileContext().getCompression());<a name="line.992"></a>
-<span class="sourceLineNo">993</span>            LOG.info("Setting compression " + hcd.getCompressionType().name() +<a name="line.993"></a>
-<span class="sourceLineNo">994</span>                     " for family " + hcd.toString());<a name="line.994"></a>
-<span class="sourceLineNo">995</span>          }<a name="line.995"></a>
-<span class="sourceLineNo">996</span>          reader.loadFileInfo();<a name="line.996"></a>
-<span class="sourceLineNo">997</span>          byte[] first = reader.getFirstRowKey();<a name="line.997"></a>
-<span class="sourceLineNo">998</span>          byte[] last  = reader.getLastRowKey();<a name="line.998"></a>
-<span class="sourceLineNo">999</span><a name="line.999"></a>
-<span class="sourceLineNo">1000</span>          LOG.info("Trying to figure out region boundaries hfile=" + hfile +<a name="line.1000"></a>
-<span class="sourceLineNo">1001</span>            " first=" + Bytes.toStringBinary(first) +<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>            " last="  + Bytes.toStringBinary(last));<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span><a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>          // To eventually infer start key-end key boundaries<a name="line.1004"></a>
-<span class="sourceLineNo">1005</span>          Integer value = map.containsKey(first)? map.get(first):0;<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>          map.put(first, value+1);<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span><a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>          value = map.containsKey(last)? map.get(last):0;<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>          map.put(last, value-1);<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>        } finally {<a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>          reader.close();<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>        }<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>      }<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>    });<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span><a name="line.1015"></a>
-<span class="sourceLineNo">1016</span>    byte[][] keys = LoadIncrementalHFiles.inferBoundaries(map);<a name="line.1016"></a>
-<span class="sourceLineNo">1017</span>    admin.createTable(htd, keys);<a name="line.1017"></a>
-<span class="sourceLineNo">1018</span><a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>    LOG.info("Table "+ tableName +" is available!!");<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>  }<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span><a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>  @Override<a name="line.1022"></a>
-<span class="sourceLineNo">1023</span>  public int run(String[] args) throws Exception {<a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>    if (args.length != 2) {<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>      usage();<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span>      return -1;<a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>    }<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span><a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>    initialize();<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>    try (Connection connection = ConnectionFactory.createConnection(getConf());<a name="line.1030"></a>
-<span class="sourceLineNo">1031</span>        Admin admin = connection.getAdmin()) {<a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>      String dirPath = args[0];<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>      TableName tableName = TableName.valueOf(args[1]);<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span><a name="line.1034"></a>
-<span class="sourceLineNo">1035</span>      boolean tableExists = admin.tableExists(tableName);<a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>      if (!tableExists) {<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span>        if ("yes".equalsIgnoreCase(getConf().get(CREATE_TABLE_CONF_KEY, "yes"))) {<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>          this.createTable(tableName, dirPath, admin);<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>        } else {<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>          String errorMsg = format("Table '%s' does not exist.", tableName);<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>          LOG.error(errorMsg);<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>          throw new TableNotFoundException(errorMsg);<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>        }<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>      }<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span><a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>      Path hfofDir = new Path(dirPath);<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span><a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>      try (Table table = connection.getTable(tableName);<a name="line.1048"></a>
-<span class="sourceLineNo">1049</span>          RegionLocator locator = connection.getRegionLocator(tableName)) {<a name="line.1049"></a>
-<span class="sourceLineNo">1050</span>          doBulkLoad(hfofDir, admin, table, locator);<a name="line.1050"></a>
-<span class="sourceLineNo">1051</span>      }<a name="line.1051"></a>
-<span class="sourceLineNo">1052</span>    }<a name="line.1052"></a>
-<span class="sourceLineNo">1053</span><a name="line.1053"></a>
-<span class="sourceLineNo">1054</span>    return 0;<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>  public static void main(String[] args) throws Exception {<a name="line.1057"></a>
-<span class="sourceLineNo">1058</span>    Configuration conf = HBaseConfiguration.create();<a name="line.1058"></a>
-<span class="sourceLineNo">1059</span>    int ret = ToolRunner.run(conf, new LoadIncrementalHFiles(), args);<a name="line.1059"></a>
-<span class="sourceLineNo">1060</span>    System.exit(ret);<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>  /**<a name="line.1063"></a>
-<span class="sourceLineNo">1064</span>   * Called from replication sink, where it manages bulkToken(staging directory) by itself. This is<a name="line.1064"></a>
-<span class="sourceLineNo">1065</span>   * used only when {@link SecureBulkLoadEndpoint} is configured in hbase.coprocessor.region.classes<a name="line.1065"></a>
-<span class="sourceLineNo">1066</span>   * property. This directory is used as a temporary directory where all files are initially<a name="line.1066"></a>
-<span class="sourceLineNo">1067</span>   * copied/moved from user given directory, set all the required file permissions and then from<a name="line.1067"></a>
-<span class="sourceLineNo">1068</span>   * their it is finally loaded into a table. This should be set only when, one would like to manage<a name="line.1068"></a>
-<span class="sourceLineNo">1069</span>   * the staging directory by itself. Otherwise this tool will handle this by itself.<a name="line.1069"></a>
-<span class="sourceLineNo">1070</span>   * @param stagingDir staging directory path<a name="line.1070"></a>
-<span class="sourceLineNo">1071</span>   */<a name="line.1071"></a>
-<span class="sourceLineNo">1072</span>  public void setBulkToken(String stagingDir) {<a name="line.1072"></a>
-<span class="sourceLineNo">1073</span>    this.bulkToken = stagingDir;<a name="line.1073"></a>
-<span class="sourceLineNo">1074</span>  }<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">906</span>                                  .withIncludesTags(true)<a name="line.906"></a>
+<span class="sourceLineNo">907</span>                                  .build();<a name="line.907"></a>
+<span class="sourceLineNo">908</span>      halfWriter = new StoreFile.WriterBuilder(conf, cacheConf,<a name="line.908"></a>
+<span class="sourceLineNo">909</span>          fs)<a name="line.909"></a>
+<span class="sourceLineNo">910</span>              .withFilePath(outFile)<a name="line.910"></a>
+<span class="sourceLineNo">911</span>              .withBloomType(bloomFilterType)<a name="line.911"></a>
+<span class="sourceLineNo">912</span>              .withFileContext(hFileContext)<a name="line.912"></a>
+<span class="sourceLineNo">913</span>              .build();<a name="line.913"></a>
+<span class="sourceLineNo">914</span>      HFileScanner scanner = halfReader.getScanner(false, false, false);<a name="line.914"></a>
+<span class="sourceLineNo">915</span>      scanner.seekTo();<a name="line.915"></a>
+<span class="sourceLineNo">916</span>      do {<a name="line.916"></a>
+<span class="sourceLineNo">917</span>        halfWriter.append(scanner.getCell());<a name="line.917"></a>
+<span class="sourceLineNo">918</span>      } while (scanner.next());<a name="line.918"></a>
+<span class="sourceLineNo">919</span><a name="line.919"></a>
+<span class="sourceLineNo">920</span>      for (Map.Entry&lt;byte[],byte[]&gt; entry : fileInfo.entrySet()) {<a name="line.920"></a>
+<span class="sourceLineNo">921</span>        if (shouldCopyHFileMetaKey(entry.getKey())) {<a name="line.921"></a>
+<span class="sourceLineNo">922</span>          halfWriter.appendFileInfo(entry.getKey(), entry.getValue());<a name="line.922"></a>
+<span class="sourceLineNo">923</span>        }<a name="line.923"></a>
+<span class="sourceLineNo">924</span>      }<a name="line.924"></a>
+<span class="sourceLineNo">925</span>    } finally {<a name="line.925"></a>
+<span class="sourceLineNo">926</span>      if (halfWriter != null) halfWriter.close();<a name="line.926"></a>
+<span class="sourceLineNo">927</span>      if (halfReader != null) halfReader.close(cacheConf.shouldEvictOnClose());<a name="line.927"></a>
+<span class="sourceLineNo">928</span>    }<a name="line.928"></a>
+<span class="sourceLineNo">929</span>  }<a name="line.929"></a>
+<span class="sourceLineNo">930</span><a name="line.930"></a>
+<span class="sourceLineNo">931</span>  private static boolean shouldCopyHFileMetaKey(byte[] key) {<a name="line.931"></a>
+<span class="sourceLineNo">932</span>    return !HFile.isReservedFileInfoKey(key);<a name="line.932"></a>
+<span class="sourceLineNo">933</span>  }<a name="line.933"></a>
+<span class="sourceLineNo">934</span><a name="line.934"></a>
+<span class="sourceLineNo">935</span>  /*<a name="line.935"></a>
+<span class="sourceLineNo">936</span>   * Infers region boundaries for a new table.<a name="line.936"></a>
+<span class="sourceLineNo">937</span>   * Parameter:<a name="line.937"></a>
+<span class="sourceLineNo">938</span>   *   bdryMap is a map between keys to an integer belonging to {+1, -1}<a name="line.938"></a>
+<span class="sourceLineNo">939</span>   *     If a key is a start key of a file, then it maps to +1<a name="line.939"></a>
+<span class="sourceLineNo">940</span>   *     If a key is an end key of a file, then it maps to -1<a name="line.940"></a>
+<span class="sourceLineNo">941</span>   * Algo:<a name="line.941"></a>
+<span class="sourceLineNo">942</span>   * 1) Poll on the keys in order:<a name="line.942"></a>
+<span class="sourceLineNo">943</span>   *    a) Keep adding the mapped values to these keys (runningSum)<a name="line.943"></a>
+<span class="sourceLineNo">944</span>   *    b) Each time runningSum reaches 0, add the start Key from when the runningSum had started to<a name="line.944"></a>
+<span class="sourceLineNo">945</span>   *       a boundary list.<a name="line.945"></a>
+<span class="sourceLineNo">946</span>   * 2) Return the boundary list.<a name="line.946"></a>
+<span class="sourceLineNo">947</span>   */<a name="line.947"></a>
+<span class="sourceLineNo">948</span>  public static byte[][] inferBoundaries(TreeMap&lt;byte[], Integer&gt; bdryMap) {<a name="line.948"></a>
+<span class="sourceLineNo">949</span>    ArrayList&lt;byte[]&gt; keysArray = new ArrayList&lt;byte[]&gt;();<a name="line.949"></a>
+<span class="sourceLineNo">950</span>    int runningValue = 0;<a name="line.950"></a>
+<span class="sourceLineNo">951</span>    byte[] currStartKey = null;<a name="line.951"></a>
+<span class="sourceLineNo">952</span>    boolean firstBoundary = true;<a name="line.952"></a>
+<span class="sourceLineNo">953</span><a name="line.953"></a>
+<span class="sourceLineNo">954</span>    for (Map.Entry&lt;byte[], Integer&gt; item: bdryMap.entrySet()) {<a name="line.954"></a>
+<span class="sourceLineNo">955</span>      if (runningValue == 0) currStartKey = item.getKey();<a name="line.955"></a>
+<span class="sourceLineNo">956</span>      runningValue += item.getValue();<a name="line.956"></a>
+<span class="sourceLineNo">957</span>      if (runningValue == 0) {<a name="line.957"></a>
+<span class="sourceLineNo">958</span>        if (!firstBoundary) keysArray.add(currStartKey);<a name="line.958"></a>
+<span class="sourceLineNo">959</span>        firstBoundary = false;<a name="line.959"></a>
+<span class="sourceLineNo">960</span>      }<a name="line.960"></a>
+<span class="sourceLineNo">961</span>    }<a name="line.961"></a>
+<span class="sourceLineNo">962</span><a name="line.962"></a>
+<span class="sourceLineNo">963</span>    return keysArray.toArray(new byte[0][0]);<a name="line.963"></a>
+<span class="sourceLineNo">964</span>  }<a name="line.964"></a>
+<span class="sourceLineNo">965</span><a name="line.965"></a>
+<span class="sourceLineNo">966</span>  /*<a name="line.966"></a>
+<span class="sourceLineNo">967</span>   * If the table is created for the first time, then "completebulkload" reads the files twice.<a name="line.967"></a>
+<span class="sourceLineNo">968</span>   * More modifications necessary if we want to avoid doing it.<a name="line.968"></a>
+<span class="sourceLineNo">969</span>   */<a name="line.969"></a>
+<span class="sourceLineNo">970</span>  private void createTable(TableName tableName, String dirPath, Admin admin) throws Exception {<a name="line.970"></a>
+<span class="sourceLineNo">971</span>    final Path hfofDir = new Path(dirPath);<a name="line.971"></a>
+<span class="sourceLineNo">972</span>    final FileSystem fs = hfofDir.getFileSystem(getConf());<a name="line.972"></a>
+<span class="sourceLineNo">973</span><a name="line.973"></a>
+<span class="sourceLineNo">974</span>    // Add column families<a name="line.974"></a>
+<span class="sourceLineNo">975</span>    // Build a set of keys<a name="line.975"></a>
+<span class="sourceLineNo">976</span>    final HTableDescriptor htd = new HTableDescriptor(tableName);<a name="line.976"></a>
+<span class="sourceLineNo">977</span>    final TreeMap&lt;byte[], Integer&gt; map = new TreeMap&lt;byte[], Integer&gt;(Bytes.BYTES_COMPARATOR);<a name="line.977"></a>
+<span class="sourceLineNo">978</span>    visitBulkHFiles(fs, hfofDir, new BulkHFileVisitor&lt;HColumnDescriptor&gt;() {<a name="line.978"></a>
+<span class="sourceLineNo">979</span>      @Override<a name="line.979"></a>
+<span class="sourceLineNo">980</span>      public HColumnDescriptor bulkFamily(final byte[] familyName) {<a name="line.980"></a>
+<span class="sourceLineNo">981</span>        HColumnDescriptor hcd = new HColumnDescriptor(familyName);<a name="line.981"></a>
+<span class="sourceLineNo">982</span>        htd.addFamily(hcd);<a name="line.982"></a>
+<span class="sourceLineNo">983</span>        return hcd;<a name="line.983"></a>
+<span class="sourceLineNo">984</span>      }<a name="line.984"></a>
+<span class="sourceLineNo">985</span>      @Override<a name="line.985"></a>
+<span class="sourceLineNo">986</span>      public void bulkHFile(final HColumnDescriptor hcd, final FileStatus hfileStatus)<a name="line.986"></a>
+<span class="sourceLineNo">987</span>          throws IOException {<a name="line.987"></a>
+<span class="sourceLineNo">988</span>        Path hfile = hfileStatus.getPath();<a name="line.988"></a>
+<span class="sourceLineNo">989</span>        HFile.Reader reader = HFile.createReader(fs, hfile,<a name="line.989"></a>
+<span class="sourceLineNo">990</span>            new CacheConfig(getConf()), getConf());<a name="line.990"></a>
+<span class="sourceLineNo">991</span>        try {<a name="line.991"></a>
+<span class="sourceLineNo">992</span>          if (hcd.getCompressionType() != reader.getFileContext().getCompression()) {<a name="line.992"></a>
+<span class="sourceLineNo">993</span>            hcd.setCompressionType(reader.getFileContext().getCompression());<a name="line.993"></a>
+<span class="sourceLineNo">994</span>            LOG.info("Setting compression " + hcd.getCompressionType().name() +<a name="line.994"></a>
+<span class="sourceLineNo">995</span>                     " for family " + hcd.toString());<a name="line.995"></a>
+<span class="sourceLineNo">996</span>          }<a name="line.996"></a>
+<span class="sourceLineNo">997</span>          reader.loadFileInfo();<a name="line.997"></a>
+<span class="sourceLineNo">998</span>          byte[] first = reader.getFirstRowKey();<a name="line.998"></a>
+<span class="sourceLineNo">999</span>          byte[] last  = reader.getLastRowKey();<a name="line.999"></a>
+<span class="sourceLineNo">1000</span><a name="line.1000"></a>
+<span class="sourceLineNo">1001</span>          LOG.info("Trying to figure out region boundaries hfile=" + hfile +<a name="line.1001"></a>
+<span class="sourceLineNo">1002</span>            " first=" + Bytes.toStringBinary(first) +<a name="line.1002"></a>
+<span class="sourceLineNo">1003</span>            " last="  + Bytes.toStringBinary(last));<a name="line.1003"></a>
+<span class="sourceLineNo">1004</span><a name="line.1004"></a>
+<span class="sourceLineNo">1005</span>          // To eventually infer start key-end key boundaries<a name="line.1005"></a>
+<span class="sourceLineNo">1006</span>          Integer value = map.containsKey(first)? map.get(first):0;<a name="line.1006"></a>
+<span class="sourceLineNo">1007</span>          map.put(first, value+1);<a name="line.1007"></a>
+<span class="sourceLineNo">1008</span><a name="line.1008"></a>
+<span class="sourceLineNo">1009</span>          value = map.containsKey(last)? map.get(last):0;<a name="line.1009"></a>
+<span class="sourceLineNo">1010</span>          map.put(last, value-1);<a name="line.1010"></a>
+<span class="sourceLineNo">1011</span>        } finally {<a name="line.1011"></a>
+<span class="sourceLineNo">1012</span>          reader.close();<a name="line.1012"></a>
+<span class="sourceLineNo">1013</span>        }<a name="line.1013"></a>
+<span class="sourceLineNo">1014</span>      }<a name="line.1014"></a>
+<span class="sourceLineNo">1015</span>    });<a name="line.1015"></a>
+<span class="sourceLineNo">1016</span><a name="line.1016"></a>
+<span class="sourceLineNo">1017</span>    byte[][] keys = LoadIncrementalHFiles.inferBoundaries(map);<a name="line.1017"></a>
+<span class="sourceLineNo">1018</span>    admin.createTable(htd, keys);<a name="line.1018"></a>
+<span class="sourceLineNo">1019</span><a name="line.1019"></a>
+<span class="sourceLineNo">1020</span>    LOG.info("Table "+ tableName +" is available!!");<a name="line.1020"></a>
+<span class="sourceLineNo">1021</span>  }<a name="line.1021"></a>
+<span class="sourceLineNo">1022</span><a name="line.1022"></a>
+<span class="sourceLineNo">1023</span>  @Override<a name="line.1023"></a>
+<span class="sourceLineNo">1024</span>  public int run(String[] args) throws Exception {<a name="line.1024"></a>
+<span class="sourceLineNo">1025</span>    if (args.length != 2) {<a name="line.1025"></a>
+<span class="sourceLineNo">1026</span>      usage();<a name="line.1026"></a>
+<span class="sourceLineNo">1027</span>      return -1;<a name="line.1027"></a>
+<span class="sourceLineNo">1028</span>    }<a name="line.1028"></a>
+<span class="sourceLineNo">1029</span><a name="line.1029"></a>
+<span class="sourceLineNo">1030</span>    initialize();<a name="line.1030"></a>
+<span class="sourceLineNo">1031</span>    try (Connection connection = ConnectionFactory.createConnection(getConf());<a name="line.1031"></a>
+<span class="sourceLineNo">1032</span>        Admin admin = connection.getAdmin()) {<a name="line.1032"></a>
+<span class="sourceLineNo">1033</span>      String dirPath = args[0];<a name="line.1033"></a>
+<span class="sourceLineNo">1034</span>      TableName tableName = TableName.valueOf(args[1]);<a name="line.1034"></a>
+<span class="sourceLineNo">1035</span><a name="line.1035"></a>
+<span class="sourceLineNo">1036</span>      boolean tableExists = admin.tableExists(tableName);<a name="line.1036"></a>
+<span class="sourceLineNo">1037</span>      if (!tableExists) {<a name="line.1037"></a>
+<span class="sourceLineNo">1038</span>        if ("yes".equalsIgnoreCase(getConf().get(CREATE_TABLE_CONF_KEY, "yes"))) {<a name="line.1038"></a>
+<span class="sourceLineNo">1039</span>          this.createTable(tableName, dirPath, admin);<a name="line.1039"></a>
+<span class="sourceLineNo">1040</span>        } else {<a name="line.1040"></a>
+<span class="sourceLineNo">1041</span>          String errorMsg = format("Table '%s' does not exist.", tableName);<a name="line.1041"></a>
+<span class="sourceLineNo">1042</span>          LOG.error(errorMsg);<a name="line.1042"></a>
+<span class="sourceLineNo">1043</span>          throw new TableNotFoundException(errorMsg);<a name="line.1043"></a>
+<span class="sourceLineNo">1044</span>        }<a name="line.1044"></a>
+<span class="sourceLineNo">1045</span>      }<a name="line.1045"></a>
+<span class="sourceLineNo">1046</span><a name="line.1046"></a>
+<span class="sourceLineNo">1047</span>      Path hfofDir = new Path(dirPath);<a name="line.1047"></a>
+<span class="sourceLineNo">1048</span><a name="line.1048"></a>
+<span class="sourceLineNo">1049</span>      try (Table table = connection.getTable(tableName);<a name="line.1049"></a>
+<span class="sourceLineNo">1050</span>          RegionLocator locator = connection.getRegionLocator(tableName)) {<a name="line.1050"></a>
+<span class="sourceLineNo">1051</span>          doBulkLoad(hfofDir, admin, table, locator);<a name="line.1051"></a>
+<span class="sourceLineNo">1052</span>      }<a name="line.1052"></a>
+<span class="sourceLineNo">1053</span>    }<a name="line.1053"></a>
+<span class="sourceLineNo">1054</span><a name="line.1054"></a>
+<span class="sourceLineNo">1055</span>    return 0;<a name="line.1055"></a>
+<span class="sourceLineNo">1056</span>  }<a name="line.1056"></a>
+<span class="sourceLineNo">1057</span><a name="line.1057"></a>
+<span class="sourceLineNo">1058</span>  public static void main(String[] args) throws Exception {<a name="line.1058"></a>
+<span class="sourceLineNo">1059</span>    Configuration conf = HBaseConfiguration.create();<a name="line.1059"></a>
+<span class="sourceLineNo">1060</span>    int ret = ToolRunner.run(conf, new LoadIncrementalHFiles(), args);<a name="line.1060"></a>
+<span class="sourceLineNo">1061</span>    System.exit(ret);<a name="line.1061"></a>
+<span class="sourceLineNo">1062</span>  }<a name="line.1062"></a>
+<span class="sourceLineNo">1063</span><a name="line.1063"></a>
+<span class="sourceLineNo">1064</span>  /**<a name="line.1064"></a>
+<span class="sourceLineNo">1065</span>   * Called from replication sink, where it manages bulkToken(staging directory) by itself. This is<a name="line.1065"></a>
+<span class="sourceLineNo">1066</span>   * used only when {@link SecureBulkLoadEndpoint} is configured in hbase.coprocessor.region.classes<a name="line.1066"></a>
+<span class="sourceLineNo">1067</span>   * property. This directory is used as a temporary directory where all files are initially<a name="line.1067"></a>
+<span class="sourceLineNo">1068</span>   * copied/moved from user given directory, set all the required file permissions and then from<a name="line.1068"></a>
+<span class="sourceLineNo">1069</span>   * their it is finally loaded into a table. This should be set only when, one would like to manage<a name="line.1069"></a>
+<span class="sourceLineNo">1070</span>   * the staging directory by itself. Otherwise this tool will handle this by itself.<a name="line.1070"></a>
+<span class="sourceLineNo">1071</span>   * @param stagingDir staging directory path<a name="line.1071"></a>
+<span class="sourceLineNo">1072</span>   */<a name="line.1072"></a>
+<span class="sourceLineNo">1073</span>  public void setBulkToken(String stagingDir) {<a name="line.1073"></a>
+<span class="sourceLineNo">1074</span>    this.bulkToken = stagingDir;<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>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/e5c3dcd1/devapidocs/src-html/org/apache/hadoop/hbase/master/TableNamespaceManager.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/master/TableNamespaceManager.html b/devapidocs/src-html/org/apache/hadoop/hbase/master/TableNamespaceManager.html
index fd73c9a..f7807eb 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/master/TableNamespaceManager.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/master/TableNamespaceManager.html
@@ -141,7 +141,7 @@
 <span class="sourceLineNo">133</span>    return nsTable;<a name="line.133"></a>
 <span class="sourceLineNo">134</span>  }<a name="line.134"></a>
 <span class="sourceLineNo">135</span><a name="line.135"></a>
-<span class="sourceLineNo">136</span>  private synchronized boolean acquireSharedLock() throws IOException {<a name="line.136"></a>
+<span class="sourceLineNo">136</span>  private boolean acquireSharedLock() throws IOException {<a name="line.136"></a>
 <span class="sourceLineNo">137</span>    try {<a name="line.137"></a>
 <span class="sourceLineNo">138</span>      return rwLock.readLock().tryLock(sharedLockTimeoutMs, TimeUnit.MILLISECONDS);<a name="line.138"></a>
 <span class="sourceLineNo">139</span>    } catch (InterruptedException e) {<a name="line.139"></a>
@@ -149,11 +149,11 @@
 <span class="sourceLineNo">141</span>    }<a name="line.141"></a>
 <span class="sourceLineNo">142</span>  }<a name="line.142"></a>
 <span class="sourceLineNo">143</span><a name="line.143"></a>
-<span class="sourceLineNo">144</span>  public synchronized void releaseSharedLock() {<a name="line.144"></a>
+<span class="sourceLineNo">144</span>  public void releaseSharedLock() {<a name="line.144"></a>
 <span class="sourceLineNo">145</span>    rwLock.readLock().unlock();<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 boolean acquireExclusiveLock() {<a name="line.148"></a>
+<span class="sourceLineNo">148</span>  public boolean acquireExclusiveLock() {<a name="line.148"></a>
 <span class="sourceLineNo">149</span>    try {<a name="line.149"></a>
 <span class="sourceLineNo">150</span>      return rwLock.writeLock().tryLock(exclusiveLockTimeoutMs, TimeUnit.MILLISECONDS);<a name="line.150"></a>
 <span class="sourceLineNo">151</span>    } catch (InterruptedException e) {<a name="line.151"></a>
@@ -161,7 +161,7 @@
 <span class="sourceLineNo">153</span>    }<a name="line.153"></a>
 <span class="sourceLineNo">154</span>  }<a name="line.154"></a>
 <span class="sourceLineNo">155</span><a name="line.155"></a>
-<span class="sourceLineNo">156</span>  public synchronized void releaseExclusiveLock() {<a name="line.156"></a>
+<span class="sourceLineNo">156</span>  public void releaseExclusiveLock() {<a name="line.156"></a>
 <span class="sourceLineNo">157</span>    rwLock.writeLock().unlock();<a name="line.157"></a>
 <span class="sourceLineNo">158</span>  }<a name="line.158"></a>
 <span class="sourceLineNo">159</span><a name="line.159"></a>


Mime
View raw message