You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nd...@apache.org on 2020/06/26 16:12:49 UTC

[hbase] branch branch-2.3 updated: HBASE-24221 addendum to restore public interface on LoadIncrementalHFiles

This is an automated email from the ASF dual-hosted git repository.

ndimiduk pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.3 by this push:
     new dfed1fe  HBASE-24221 addendum to restore public interface on LoadIncrementalHFiles
dfed1fe is described below

commit dfed1febd605857a92d9ab21369a2e0dc430c417
Author: Nick Dimiduk <nd...@apache.org>
AuthorDate: Thu Jun 25 15:03:06 2020 -0700

    HBASE-24221 addendum to restore public interface on LoadIncrementalHFiles
    
    Signed-off-by: niuyulin <ny...@163.com>
    Signed-off-by: Wellington Ramos Chevreuil <wc...@apache.org>
    Signed-off-by: Viraj Jasani <vj...@apache.org>
---
 .../hadoop/hbase/tool/LoadIncrementalHFiles.java   | 29 +++++++++++++++++++---
 1 file changed, 25 insertions(+), 4 deletions(-)

diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java
index 8e63443..d89756e 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/LoadIncrementalHFiles.java
@@ -803,14 +803,35 @@ public class LoadIncrementalHFiles extends Configured implements Tool {
    * <p>
    * Protected for testing.
    * @return empty list if success, list of items to retry on recoverable failure
+   * @deprecated as of release 2.3.0. Use {@link BulkLoadHFiles} instead.
    */
+  @Deprecated
   @VisibleForTesting
   protected List<LoadQueueItem> tryAtomicRegionLoad(final Connection conn,
-      final TableName tableName, final byte[] first, final Collection<LoadQueueItem> lqis,
-      boolean copyFile) throws IOException {
-    List<LoadQueueItem> toRetry = new ArrayList<>();
+    final TableName tableName, final byte[] first, final Collection<LoadQueueItem> lqis,
+    boolean copyFile) throws IOException {
     ClientServiceCallable<byte[]> serviceCallable =
-        buildClientServiceCallable(conn, tableName, first, lqis, copyFile);
+      buildClientServiceCallable(conn, tableName, first, lqis, copyFile);
+    return tryAtomicRegionLoad(serviceCallable, tableName, first, lqis);
+  }
+
+  /**
+   * Attempts to do an atomic load of many hfiles into a region. If it fails, it returns a list of
+   * hfiles that need to be retried. If it is successful it will return an empty list.
+   * <p>
+   * NOTE: To maintain row atomicity guarantees, region server callable should succeed atomically
+   * and fails atomically.
+   * <p>
+   * Protected for testing.
+   * @return empty list if success, list of items to retry on recoverable failure
+   * @deprecated as of release 2.3.0. Use {@link BulkLoadHFiles} instead.
+   */
+  @Deprecated
+  @VisibleForTesting
+  protected List<LoadQueueItem> tryAtomicRegionLoad(ClientServiceCallable<byte[]> serviceCallable,
+    final TableName tableName, final byte[] first, final Collection<LoadQueueItem> lqis)
+    throws IOException {
+    List<LoadQueueItem> toRetry = new ArrayList<>();
     try {
       Configuration conf = getConf();
       byte[] region = RpcRetryingCallerFactory.instantiate(conf, null).<byte[]> newCaller()