HBASE-20209 Do Not Use Both Map containsKey and get Methods in Replication Sink
Signed-off-by: Sean Busbey <busbey@apache.org>
This commit is contained in:
parent
594341d6fe
commit
3e92cd5771
|
@ -279,13 +279,11 @@ public class ReplicationSink {
|
|||
|
||||
// Build hfile relative path from its namespace
|
||||
String pathToHfileFromNS = getHFilePath(table, bld, storeFileList.get(k), family);
|
||||
|
||||
String tableName = table.getNameWithNamespaceInclAsString();
|
||||
if (bulkLoadHFileMap.containsKey(tableName)) {
|
||||
List<Pair<byte[], List<String>>> familyHFilePathsList = bulkLoadHFileMap.get(tableName);
|
||||
if (familyHFilePathsList != null) {
|
||||
boolean foundFamily = false;
|
||||
for (int i = 0; i < familyHFilePathsList.size(); i++) {
|
||||
Pair<byte[], List<String>> familyHFilePathsPair = familyHFilePathsList.get(i);
|
||||
for (Pair<byte[], List<String>> familyHFilePathsPair : familyHFilePathsList) {
|
||||
if (Bytes.equals(familyHFilePathsPair.getFirst(), family)) {
|
||||
// Found family already present, just add the path to the existing list
|
||||
familyHFilePathsPair.getSecond().add(pathToHfileFromNS);
|
||||
|
|
Loading…
Reference in New Issue