Skip to content

Commit

Permalink
HBASE-23128 Restore Region interface compatibility
Browse files Browse the repository at this point in the history
Restore and deprecate Region#bulkLoadHFiles(Collection<Pair<byte[],String>>, boolean,
  Region.BulkLoadListener).
Warn if invoked.
  • Loading branch information
apurtell committed Oct 7, 2019
1 parent 3966d0f commit 0e8e5a3
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,8 @@ void sawNoSuchFamily() {
private final Durability durability;
private final boolean regionStatsEnabled;

private static final List<String> EMPTY_CLUSTERID_LIST = new ArrayList<String>();

/**
* HRegion constructor. This constructor should only be used for testing and
* extensions. Instances of HRegion should be instantiated with the
Expand Down Expand Up @@ -6037,6 +6039,15 @@ public boolean bulkLoadHFiles(Collection<Pair<byte[], String>> familyPaths, bool
return isSuccessful;
}

@Override
@Deprecated
public boolean bulkLoadHFiles(Collection<Pair<byte[], String>> familyPaths, boolean assignSeqId,
BulkLoadListener bulkLoadListener) throws IOException {
LOG.warn("Deprecated bulkLoadHFiles invoked. This does not pass through source cluster ids." +
" This is probably not what you want. See HBASE-22380.");
return bulkLoadHFiles(familyPaths, assignSeqId, bulkLoadListener, EMPTY_CLUSTERID_LIST);
}

@Override
public boolean equals(Object o) {
return o instanceof HRegion && Bytes.equals(getRegionInfo().getRegionName(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,22 @@ interface BulkLoadListener {
boolean bulkLoadHFiles(Collection<Pair<byte[], String>> familyPaths, boolean assignSeqId,
BulkLoadListener bulkLoadListener, List<String> clusterIds) throws IOException;

/**
* Attempts to atomically load a group of hfiles. This is critical for loading
* rows with multiple column families atomically. Deprecated - do not use.
*
* @param familyPaths List of Pair&lt;byte[] column family, String hfilePath&gt;
* @param assignSeqId
* @param bulkLoadListener Internal hooks enabling massaging/preparation of a
* file about to be bulk loaded
* @return true if successful, false if failed recoverably
* @throws IOException if failed unrecoverably.
* @deprecated Do not use, see HBASE-22380
*/
@Deprecated
boolean bulkLoadHFiles(Collection<Pair<byte[], String>> familyPaths, boolean assignSeqId,
BulkLoadListener bulkLoadListener) throws IOException;

///////////////////////////////////////////////////////////////////////////
// Coprocessors

Expand Down

0 comments on commit 0e8e5a3

Please sign in to comment.