hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From te...@apache.org
Subject hbase git commit: HBASE-17092 Both LoadIncrementalHFiles#doBulkLoad() methods should set return value
Date Sun, 20 Nov 2016 17:22:06 GMT
Repository: hbase
Updated Branches:
  refs/heads/14123 2725fb25b -> 2ad6a9477


HBASE-17092 Both LoadIncrementalHFiles#doBulkLoad() methods should set return value


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/2ad6a947
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/2ad6a947
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/2ad6a947

Branch: refs/heads/14123
Commit: 2ad6a9477e13c74a6097a984f83c887be2bc47ba
Parents: 2725fb2
Author: tedyu <yuzhihong@gmail.com>
Authored: Sun Nov 20 09:21:46 2016 -0800
Committer: tedyu <yuzhihong@gmail.com>
Committed: Sun Nov 20 09:21:46 2016 -0800

----------------------------------------------------------------------
 .../hbase/mapreduce/LoadIncrementalHFiles.java       | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/2ad6a947/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
index 064d649..ae4d02e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/LoadIncrementalHFiles.java
@@ -134,6 +134,8 @@ public class LoadIncrementalHFiles extends Configured implements Tool
{
   private int nrThreads;
   private RpcControllerFactory rpcControllerFactory;
 
+  private Map<LoadQueueItem, ByteBuffer> retValue = null;
+
   public LoadIncrementalHFiles(Configuration conf) throws Exception {
     super(conf);
     this.rpcControllerFactory = new RpcControllerFactory(conf);
@@ -362,10 +364,9 @@ public class LoadIncrementalHFiles extends Configured implements Tool
{
    * @param regionLocator region locator
    * @param silence true to ignore unmatched column families
    * @param copyFile always copy hfiles if true
-   * @return Map of LoadQueueItem to region
    * @throws TableNotFoundException if table does not yet exist
    */
-  public Map<LoadQueueItem, ByteBuffer> doBulkLoad(Map<byte[], List<Path>>
map, final Admin admin,
+  public void doBulkLoad(Map<byte[], List<Path>> map, final Admin admin,
       Table table, RegionLocator regionLocator, boolean silence, boolean copyFile)
           throws TableNotFoundException, IOException {
     if (!admin.isTableAvailable(regionLocator.getName())) {
@@ -380,7 +381,7 @@ public class LoadIncrementalHFiles extends Configured implements Tool
{
       prepareHFileQueue(map, table, queue, silence);
       if (queue.isEmpty()) {
         LOG.warn("Bulk load operation did not get any files to load");
-        return null;
+        return;
       }
       pool = createExecutorService();
       secureClient = new SecureBulkLoadClient(table.getConfiguration(), table);
@@ -390,7 +391,7 @@ public class LoadIncrementalHFiles extends Configured implements Tool
{
           break;
         }
       }
-      return performBulkLoad(admin, table, regionLocator, queue, pool, secureClient, copyFile);
+      retValue = performBulkLoad(admin, table, regionLocator, queue, pool, secureClient,
copyFile);
     } finally {
       cleanup(admin, queue, pool, secureClient);
     }
@@ -443,7 +444,7 @@ public class LoadIncrementalHFiles extends Configured implements Tool
{
       }
       pool = createExecutorService();
       secureClient = new SecureBulkLoadClient(table.getConfiguration(), table);
-      performBulkLoad(admin, table, regionLocator, queue, pool, secureClient, copyFile);
+      retValue = performBulkLoad(admin, table, regionLocator, queue, pool, secureClient,
copyFile);
     } finally {
       cleanup(admin, queue, pool, secureClient);
     }
@@ -1232,10 +1233,10 @@ public class LoadIncrementalHFiles extends Configured implements Tool
{
         boolean copyFiles = "yes".equalsIgnoreCase(getConf().get(ALWAYS_COPY_FILES, ""));
         if (dirPath != null) {
           doBulkLoad(hfofDir, admin, table, locator, silence, copyFiles);
-          return null;
         } else {
-          return doBulkLoad(map, admin, table, locator, silence, copyFiles);
+          doBulkLoad(map, admin, table, locator, silence, copyFiles);
         }
+        return retValue;
       }
     }
   }


Mime
View raw message