From dcf88bed643104777dcaf39bc64fb1be0b9f92b6 Mon Sep 17 00:00:00 2001 From: Wellington Chevreuil Date: Fri, 21 Jan 2022 21:31:59 +0000 Subject: [PATCH 1/3] HBASE-25955 Setting NAMESPACES when adding a replication peer doesn't have any effect --- .../ReplicationPeerConfigUtil.java | 9 +++ .../replication/ReplicationPeerConfig.java | 17 +++++- .../ReplicationPeerConfigBuilder.java | 8 +++ .../protobuf/server/master/Replication.proto | 1 + .../replication/BaseReplicationEndpoint.java | 3 +- .../replication/ChainWALEntryFilter.java | 55 ++++++++++++++----- .../NamespaceTableCfWALEntryFilter.java | 3 +- .../regionserver/ReplicationSource.java | 3 +- .../TestReplicationWALEntryFilters.java | 46 +++++++++++++++- .../src/main/ruby/hbase/replication_admin.rb | 9 +++ hbase-shell/src/main/ruby/hbase_constants.rb | 1 + .../src/main/ruby/shell/commands/add_peer.rb | 7 ++- .../test/ruby/hbase/replication_admin_test.rb | 33 +++++++++++ 13 files changed, 176 insertions(+), 19 deletions(-) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java index 05343eae4ccd..66efa2a52294 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/replication/ReplicationPeerConfigUtil.java @@ -290,12 +290,14 @@ public static ReplicationPeerConfig convert(ReplicationProtos.ReplicationPeer pe peer.getTableCfsList().toArray(new ReplicationProtos.TableCF[peer.getTableCfsCount()])); if (tableCFsMap != null) { builder.setTableCFsMap(tableCFsMap); + builder.setChainedFiltersOperation(peer.getChainOperator()); } List namespacesList = peer.getNamespacesList(); if (namespacesList != null && namespacesList.size() != 0) { builder.setNamespaces( namespacesList.stream().map(ByteString::toStringUtf8).collect(Collectors.toSet())); + builder.setChainedFiltersOperation(peer.getChainOperator()); } if (peer.hasBandwidth()) { @@ -357,12 +359,19 @@ public static ReplicationProtos.ReplicationPeer convert(ReplicationPeerConfig pe for (int i = 0; i < tableCFs.length; i++) { builder.addTableCfs(tableCFs[i]); } + if (peerConfig.getChainedFiltersOperator() != null) { + builder.setChainOperator(peerConfig.getChainedFiltersOperator()); + } + } Set namespaces = peerConfig.getNamespaces(); if (namespaces != null) { for (String namespace : namespaces) { builder.addNamespaces(ByteString.copyFromUtf8(namespace)); } + if (peerConfig.getChainedFiltersOperator() != null) { + builder.setChainOperator(peerConfig.getChainedFiltersOperator()); + } } builder.setBandwidth(peerConfig.getBandwidth()); diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java index ae987b600c5a..340e537b052a 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfig.java @@ -51,6 +51,7 @@ public class ReplicationPeerConfig { private final boolean serial; // Used by synchronous replication private String remoteWALDir; + private String chainedFiltersOperator; private ReplicationPeerConfig(ReplicationPeerConfigBuilderImpl builder) { this.clusterKey = builder.clusterKey; @@ -71,6 +72,7 @@ private ReplicationPeerConfig(ReplicationPeerConfigBuilderImpl builder) { this.bandwidth = builder.bandwidth; this.serial = builder.serial; this.remoteWALDir = builder.remoteWALDir; + this.chainedFiltersOperator = builder.chainedFilterOperatorName; } private Map> @@ -140,6 +142,10 @@ public boolean isSerial() { return serial; } + public String getChainedFiltersOperator() { + return chainedFiltersOperator; + } + public static ReplicationPeerConfigBuilder newBuilder(ReplicationPeerConfig peerConfig) { ReplicationPeerConfigBuilderImpl builder = new ReplicationPeerConfigBuilderImpl(); builder.setClusterKey(peerConfig.getClusterKey()) @@ -150,7 +156,8 @@ public static ReplicationPeerConfigBuilder newBuilder(ReplicationPeerConfig peer .setExcludeTableCFsMap(peerConfig.getExcludeTableCFsMap()) .setExcludeNamespaces(peerConfig.getExcludeNamespaces()) .setBandwidth(peerConfig.getBandwidth()).setSerial(peerConfig.isSerial()) - .setRemoteWALDir(peerConfig.getRemoteWALDir()); + .setRemoteWALDir(peerConfig.getRemoteWALDir()) + .setChainedFiltersOperation(peerConfig.getChainedFiltersOperator()); return builder; } @@ -181,6 +188,8 @@ static class ReplicationPeerConfigBuilderImpl implements ReplicationPeerConfigBu private String remoteWALDir = null; + private String chainedFilterOperatorName; + @Override public ReplicationPeerConfigBuilder setClusterKey(String clusterKey) { this.clusterKey = clusterKey != null ? clusterKey.trim() : null; @@ -261,6 +270,12 @@ public ReplicationPeerConfigBuilder setRemoteWALDir(String dir) { return this; } + @Override public ReplicationPeerConfigBuilder setChainedFiltersOperation( + String chainedFilterOperation) { + this.chainedFilterOperatorName = chainedFilterOperation; + return this; + } + @Override public ReplicationPeerConfig build() { // It would be nice to validate the configuration, but we have to work with "old" data diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.java index c6a97fad9e81..cbffbb7009e8 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationPeerConfigBuilder.java @@ -165,6 +165,14 @@ default ReplicationPeerConfigBuilder putAllPeerData(Map peerData */ ReplicationPeerConfigBuilder setRemoteWALDir(String dir); + /** + * Specifies the boolean operator for the chain of WALEntry filters. The "AND" value enforces all + * filters on a given entry. The "OR" value needs only one filter to be valid. + * @param chainedFiltersOperation the ChainWALEntryFilter operator name. + * @return {@code this} + */ + ReplicationPeerConfigBuilder setChainedFiltersOperation(String chainedFiltersOperation); + /** * Builds the configuration object from the current state of {@code this}. * @return A {@link ReplicationPeerConfig} instance. diff --git a/hbase-protocol-shaded/src/main/protobuf/server/master/Replication.proto b/hbase-protocol-shaded/src/main/protobuf/server/master/Replication.proto index 6619c9694a46..210b8179bbf5 100644 --- a/hbase-protocol-shaded/src/main/protobuf/server/master/Replication.proto +++ b/hbase-protocol-shaded/src/main/protobuf/server/master/Replication.proto @@ -50,6 +50,7 @@ message ReplicationPeer { repeated bytes exclude_namespaces = 10; optional bool serial = 11; optional string remoteWALDir = 12; + optional string chain_operator = 13; } /** diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/BaseReplicationEndpoint.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/BaseReplicationEndpoint.java index 56576a6cf3e1..dd8f7ef3cdd6 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/BaseReplicationEndpoint.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/BaseReplicationEndpoint.java @@ -91,7 +91,8 @@ public WALEntryFilter getWALEntryfilter() { } } } - return filters.isEmpty() ? null : new ChainWALEntryFilter(filters); + return filters.isEmpty() ? null : + new ChainWALEntryFilter(filters, ctx.getPeerConfig().getChainedFiltersOperator()); } /** Returns a WALEntryFilter for checking the scope. Subclasses can diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ChainWALEntryFilter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ChainWALEntryFilter.java index ae3c74ad4753..784b7825c6b0 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ChainWALEntryFilter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/ChainWALEntryFilter.java @@ -21,6 +21,9 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.function.Function; + +import org.apache.commons.lang3.StringUtils; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.regionserver.wal.WALUtil; @@ -33,9 +36,9 @@ */ @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.REPLICATION) public class ChainWALEntryFilter implements WALEntryFilter { - private final WALEntryFilter[] filters; private WALCellFilter[] cellFilters; + private Operator operator = Operator.AND; public ChainWALEntryFilter(WALEntryFilter...filters) { this.filters = filters; @@ -56,6 +59,13 @@ public ChainWALEntryFilter(List filters) { initCellFilters(); } + public ChainWALEntryFilter(List filters, String operatorName) { + this(filters); + if (!StringUtils.isEmpty(operatorName)) { + this.operator = Operator.valueOf(operatorName); + } + } + public void initCellFilters() { ArrayList cellFilters = new ArrayList<>(filters.length); for (WALEntryFilter filter : filters) { @@ -68,7 +78,7 @@ public void initCellFilters() { @Override public Entry filter(Entry entry) { - entry = filterEntry(entry); + entry = filterEntry(entry, operator.entryOp); if (entry == null) { return null; } @@ -77,30 +87,49 @@ public Entry filter(Entry entry) { return entry; } - protected Entry filterEntry(Entry entry) { + protected Entry filterEntry(Entry entry, Function op) { + Entry filteredEntry = null; for (WALEntryFilter filter : filters) { - if (entry == null) { - return null; + filteredEntry = filter.filter(entry); + if(op.apply(filteredEntry)){ + return filteredEntry; } - entry = filter.filter(entry); } - return entry; + return filteredEntry; } protected void filterCells(Entry entry) { if (entry == null || cellFilters.length == 0) { return; } - WALUtil.filterCells(entry.getEdit(), c -> filterCell(entry, c)); + WALUtil.filterCells(entry.getEdit(), c -> filterCell(entry, c, operator.cellOp)); } - private Cell filterCell(Entry entry, Cell cell) { + private Cell filterCell(Entry entry, Cell cell, Function op) { + if (cell == null) { + return null; + } + Cell filteredCell = null; for (WALCellFilter filter : cellFilters) { - cell = filter.filterCell(entry, cell); - if (cell == null) { - break; + filteredCell = filter.filterCell(entry, cell); + if (op.apply(filteredCell)) { + return filteredCell; } } - return cell; + return filteredCell; } + + public enum Operator { + AND(e -> e == null, c -> c == null), + OR(e -> e != null, c -> c != null); + + Function entryOp; + Function cellOp; + + Operator(Function entryOp, Function cellOp) { + this.entryOp = entryOp; + this.cellOp = cellOp; + } + } + } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java index 4fe04cd6ee5a..1389e65c7798 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java @@ -56,8 +56,9 @@ public Cell filterCell(final Entry entry, Cell cell) { if (CellUtil.matchingColumn(cell, WALEdit.METAFAMILY, WALEdit.BULK_LOAD)) { // If the cell is about BULKLOAD event, unpack and filter it by BulkLoadCellFilter. return bulkLoadFilter.filterCell(cell, fam -> !peerConfig.needToReplicate(tableName, fam)); - } else { + } else if ((!CellUtil.matchingFamily(cell, WALEdit.METAFAMILY))){ return peerConfig.needToReplicate(tableName, CellUtil.cloneFamily(cell)) ? cell : null; } + return null; } } diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java index fb13abb8da04..e8e4db08d4d5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java @@ -333,7 +333,8 @@ private void initializeWALEntryFilter(UUID peerClusterId) { filters.add(filterFromEndpoint); } filters.add(new ClusterMarkingEntryFilter(clusterId, peerClusterId, replicationEndpoint)); - this.walEntryFilter = new ChainWALEntryFilter(filters); + this.walEntryFilter = new ChainWALEntryFilter(filters, + getPeer().getPeerConfig().getChainedFiltersOperator()); } private void tryStartNewShipper(String walGroupId) { diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWALEntryFilters.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWALEntryFilters.java index a0d5cc961453..8de34aed2121 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWALEntryFilters.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationWALEntryFilters.java @@ -40,6 +40,7 @@ import org.apache.hadoop.hbase.testclassification.SmallTests; import org.apache.hadoop.hbase.util.Bytes; import org.apache.hadoop.hbase.util.EnvironmentEdgeManager; +import org.apache.hadoop.hbase.wal.WAL; import org.apache.hadoop.hbase.wal.WAL.Entry; import org.apache.hadoop.hbase.wal.WALEdit; import org.apache.hadoop.hbase.wal.WALKeyImpl; @@ -272,6 +273,49 @@ public void testChainWALEntryFilter() { assertEquals(null, filter.filter(userEntry)); } + @Test + public void testChainWALEntryFilterOROperator() { + Entry userEntry = createEntry(null, a, b, c); + assertEquals(userEntry, testChainOperator(userEntry, "OR")); + } + + @Test + public void testChainWALEntryFilterANDOperator() { + Entry userEntry = createEntry(null, a, b, c); + assertEquals(null, testChainOperator(userEntry, "AND")); + } + + @Test + public void testChainWALEntryFilterNullOperator() { + Entry userEntry = createEntry(null, a, b, c); + assertEquals(null, testChainOperator(userEntry, null)); + } + + @Test + public void testChainWALEntryFilterEmptyOperator() { + Entry userEntry = createEntry(null, a, b, c); + assertEquals(null, testChainOperator(userEntry, "")); + } + + @Test + public void testChainWALEntryFilterNoOperator() { + Entry userEntry = createEntry(null, a, b, c); + List filters = new ArrayList<>(); + filters.add(passFilter); + filters.add(nullFilter); + ChainWALEntryFilter filter = new ChainWALEntryFilter(filters); + assertEquals(null, filter.filter(userEntry)); + } + + + private WAL.Entry testChainOperator(Entry userEntry, String operatorName){ + List filters = new ArrayList<>(); + filters.add(passFilter); + filters.add(nullFilter); + ChainWALEntryFilter filter = new ChainWALEntryFilter(filters, operatorName); + return filter.filter(userEntry); + } + @Test public void testNamespaceTableCfWALEntryFilter() { ReplicationPeer peer = mock(ReplicationPeer.class); @@ -350,7 +394,7 @@ public void testNamespaceTableCfWALEntryFilter() { assertEquals(null, filter.filter(userEntry)); // 4. replicate_all flag is false, and config namespaces and table-cfs both - // Namespaces config should not confict with table-cfs config + // Namespaces config should not conflict with table-cfs config namespaces = new HashSet<>(); tableCfs = new HashMap<>(); namespaces.add("ns1"); diff --git a/hbase-shell/src/main/ruby/hbase/replication_admin.rb b/hbase-shell/src/main/ruby/hbase/replication_admin.rb index ce9f4c731cd2..7ae564704437 100644 --- a/hbase-shell/src/main/ruby/hbase/replication_admin.rb +++ b/hbase-shell/src/main/ruby/hbase/replication_admin.rb @@ -67,6 +67,7 @@ def add_peer(id, args = {}, peer_tableCFs = nil) peer_state = args.fetch(STATE, nil) remote_wal_dir = args.fetch(REMOTE_WAL_DIR, nil) serial = args.fetch(SERIAL, nil) + chain_operator = args.fetch(OPERATOR, nil) # Create and populate a ReplicationPeerConfig builder = ReplicationPeerConfig.newBuilder() @@ -114,6 +115,14 @@ def add_peer(id, args = {}, peer_tableCFs = nil) builder.set_table_cfs_map(map) end + unless chain_operator.nil? + if 'AND'.eql?(chain_operator) || 'OR'.eql?(chain_operator) + builder.setChainedFiltersOperation(chain_operator) + else + raise(ArgumentError, 'OPERATOR valid values: [AND|OR]') + end + end + enabled = true unless peer_state.nil? enabled = false if peer_state == 'DISABLED' diff --git a/hbase-shell/src/main/ruby/hbase_constants.rb b/hbase-shell/src/main/ruby/hbase_constants.rb index 5f994c7b5ae0..5cb368ebf330 100644 --- a/hbase-shell/src/main/ruby/hbase_constants.rb +++ b/hbase-shell/src/main/ruby/hbase_constants.rb @@ -72,6 +72,7 @@ module HBaseConstants NAMESPACES = 'NAMESPACES'.freeze NONE = 'NONE'.freeze NUMREGIONS = 'NUMREGIONS'.freeze + OPERATOR = 'OPERATOR'.freeze POLICY = 'POLICY'.freeze PRIORITY = 'PRIORITY'.freeze PROPERTIES = 'PROPERTIES'.freeze diff --git a/hbase-shell/src/main/ruby/shell/commands/add_peer.rb b/hbase-shell/src/main/ruby/shell/commands/add_peer.rb index 9be42ac5e952..94798e45e649 100644 --- a/hbase-shell/src/main/ruby/shell/commands/add_peer.rb +++ b/hbase-shell/src/main/ruby/shell/commands/add_peer.rb @@ -34,11 +34,14 @@ def help to the peer cluster. An optional parameter for table column families identifies which tables and/or column families will be replicated to the peer cluster. +An optional parameter for the boolean operator to be applied over different WAL Entry filters. If +omitted, conjunction (AND) is applied. An optional parameter for serial flag identifies whether or not the replication peer is a serial replication peer. The default serial flag is false. Note: Set a namespace in the peer config means that all tables in this namespace -will be replicated to the peer cluster. So if you already have set a namespace in peer config, +will be replicated to the peer cluster (If the 'OR' operator has been defined). +So if you already have set a namespace in peer config, then you can't set this namespace's tables in the peer config again. Examples: @@ -50,6 +53,8 @@ def help TABLE_CFS => { "table1" => [], "table2" => ["cf1"], "table3" => ["cf1", "cf2"] } hbase> add_peer '2', CLUSTER_KEY => "zk1,zk2,zk3:2182:/hbase-prod", NAMESPACES => ["ns1", "ns2", "ns3"] + hbase> add_peer '2', CLUSTER_KEY => "zk1,zk2,zk3:2182:/hbase-prod", + NAMESPACES => ["ns1", "ns2", "ns3"], OPERATOR => "OR" hbase> add_peer '2', CLUSTER_KEY => "zk1,zk2,zk3:2182:/hbase-prod", NAMESPACES => ["ns1", "ns2"], TABLE_CFS => { "ns3:table1" => [], "ns3:table2" => ["cf1"] } hbase> add_peer '3', CLUSTER_KEY => "zk1,zk2,zk3:2182:/hbase-prod", diff --git a/hbase-shell/src/test/ruby/hbase/replication_admin_test.rb b/hbase-shell/src/test/ruby/hbase/replication_admin_test.rb index c6ed817ad4ea..efadae8dabc3 100644 --- a/hbase-shell/src/test/ruby/hbase/replication_admin_test.rb +++ b/hbase-shell/src/test/ruby/hbase/replication_admin_test.rb @@ -791,6 +791,39 @@ def assert_tablecfs_equal(table_cfs, table_cfs_map) command(:remove_peer, @peer_id) end + define_test "add_peer: 'OR' operator" do + cluster_key = "server1.cie.com:2181:/hbase" + + args = {CLUSTER_KEY => cluster_key, ENDPOINT_CLASSNAME => @dummy_endpoint, OPERATOR => "OR"} + command(:add_peer, @peer_id, args) + + assert_equal(1, command(:list_peers).length) + + # cleanup for future tests + command(:remove_peer, @peer_id) + end + + define_test "add_peer: 'AND' operator" do + cluster_key = "server1.cie.com:2181:/hbase" + + args = {CLUSTER_KEY => cluster_key, ENDPOINT_CLASSNAME => @dummy_endpoint, OPERATOR => "AND"} + command(:add_peer, @peer_id, args) + + assert_equal(1, command(:list_peers).length) + + # cleanup for future tests + command(:remove_peer, @peer_id) + end + + define_test "add_peer: should fail when invalid operator" do + cluster_key = "server1.cie.com:2181:/hbase" + + args = {CLUSTER_KEY => cluster_key, ENDPOINT_CLASSNAME => @dummy_endpoint, OPERATOR => "NAND"} + assert_raise(ArgumentError) do + command(:add_peer, @peer_id, args) + end + end + # assert_raise fails on native exceptions - https://jira.codehaus.org/browse/JRUBY-5279 # Can't catch native Java exception with assert_raise in JRuby 1.6.8 as in the test below. # define_test "add_peer: adding a second peer with same id should error" do From 75d77751f977c3429683290d205fb466a0f41e2a Mon Sep 17 00:00:00 2001 From: Wellington Ramos Chevreuil Date: Mon, 21 Mar 2022 14:46:43 +0000 Subject: [PATCH 2/3] Update hbase-shell/src/main/ruby/hbase/replication_admin.rb Co-authored-by: Josh Elser --- hbase-shell/src/main/ruby/hbase/replication_admin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-shell/src/main/ruby/hbase/replication_admin.rb b/hbase-shell/src/main/ruby/hbase/replication_admin.rb index 7ae564704437..959ec7312a7d 100644 --- a/hbase-shell/src/main/ruby/hbase/replication_admin.rb +++ b/hbase-shell/src/main/ruby/hbase/replication_admin.rb @@ -67,7 +67,7 @@ def add_peer(id, args = {}, peer_tableCFs = nil) peer_state = args.fetch(STATE, nil) remote_wal_dir = args.fetch(REMOTE_WAL_DIR, nil) serial = args.fetch(SERIAL, nil) - chain_operator = args.fetch(OPERATOR, nil) + chain_operator = args.fetch(OPERATOR, nil).upcase # Create and populate a ReplicationPeerConfig builder = ReplicationPeerConfig.newBuilder() From 85d8067c8f4e36e89d7eaba04c28eedeea99308d Mon Sep 17 00:00:00 2001 From: Wellington Ramos Chevreuil Date: Mon, 21 Mar 2022 14:48:50 +0000 Subject: [PATCH 3/3] Update hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java Co-authored-by: Josh Elser --- .../hbase/replication/NamespaceTableCfWALEntryFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java index 1389e65c7798..c3bc59ec117c 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/NamespaceTableCfWALEntryFilter.java @@ -56,7 +56,7 @@ public Cell filterCell(final Entry entry, Cell cell) { if (CellUtil.matchingColumn(cell, WALEdit.METAFAMILY, WALEdit.BULK_LOAD)) { // If the cell is about BULKLOAD event, unpack and filter it by BulkLoadCellFilter. return bulkLoadFilter.filterCell(cell, fam -> !peerConfig.needToReplicate(tableName, fam)); - } else if ((!CellUtil.matchingFamily(cell, WALEdit.METAFAMILY))){ + } else if (!CellUtil.matchingFamily(cell, WALEdit.METAFAMILY)) { return peerConfig.needToReplicate(tableName, CellUtil.cloneFamily(cell)) ? cell : null; } return null;