diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java index 05891df..ac72684 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java @@ -1042,31 +1042,6 @@ public class HTableDescriptor implements Comparable { } /** - * Detects whether replication has been already enabled on any of the column families of this - * table descriptor. - * @return true if any of the column families has replication enabled. - */ - public boolean isReplicationEnabled() { - // Go through each Column-Family descriptor and check if the - // Replication has been enabled already. - // Return 'true' if replication has been enabled on any CF, - // otherwise return 'false'. - // - boolean result = false; - Iterator it = this.families.values().iterator(); - - while (it.hasNext()) { - HColumnDescriptor tempHcd = it.next(); - if (tempHcd.getScope() != HConstants.REPLICATION_SCOPE_LOCAL) { - result = true; - break; - } - } - - return result; - } - - /** * @see java.lang.Object#hashCode() */ @Override diff --git hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index c68d3bb..1924fdc 100644 --- hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ hbase-client/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -4187,23 +4187,12 @@ public class HBaseAdmin implements Admin { if (peerHtd == null) { throw new IllegalArgumentException("Failed to get table descriptor for table " + tableName.getNameAsString() + " from peer cluster " + peerDesc.getPeerId()); - } else { - // To support cyclic replication (HBASE-17460), we need to match the - // REPLICATION_SCOPE of table on both the clusters. We should do this - // only when the replication is not already enabled on local HTD (local - // table on this cluster). - // - if (localHtd.isReplicationEnabled()) { - throw new IllegalArgumentException("Table " + tableName.getNameAsString() - + " has replication already enabled for at least one Column Family."); - } else { - if (!compareForReplication(peerHtd, localHtd)) { - throw new IllegalArgumentException("Table " + tableName.getNameAsString() - + " exists in peer cluster " + peerDesc.getPeerId() - + ", but the table descriptors are not same when compared with source cluster." - + " Thus can not enable the table's replication switch."); - } - } + } + if (!compareForReplication(peerHtd, localHtd)) { + throw new IllegalArgumentException("Table " + tableName.getNameAsString() + + " exists in peer cluster " + peerDesc.getPeerId() + + ", but the table descriptors are not same when compared with source cluster." + + " Thus can not enable the table's replication switch."); } } } diff --git hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java index ee32887..ea881a7 100644 --- hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java +++ hbase-server/src/main/java/org/apache/hadoop/hbase/backup/HFileArchiver.java @@ -51,7 +51,7 @@ import com.google.common.collect.Lists; /** * Utility class to handle the removal of HFiles (or the respective {@link StoreFile StoreFiles}) * for a HRegion from the {@link FileSystem}. The hfiles will be archived or deleted, depending on - * the state of the system. + * the state of the system. */ @InterfaceAudience.Private public class HFileArchiver {