HBASE-25700 Enhance znode parent validation when add_peer (#3458)
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Pankaj Kumar <pankajkumar@apache.org>
This commit is contained in:
parent
e65fc9226f
commit
bb84892550
|
@ -183,7 +183,7 @@ public class ReplicationPeerConfig {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ReplicationPeerConfigBuilder setClusterKey(String clusterKey) {
|
public ReplicationPeerConfigBuilder setClusterKey(String clusterKey) {
|
||||||
this.clusterKey = clusterKey;
|
this.clusterKey = clusterKey != null ? clusterKey.trim() : null;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -469,6 +469,14 @@ public class TestAsyncReplicationAdminApi extends TestAsyncAdminBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testClusterKeyWithTrailingSpace() throws Exception {
|
||||||
|
admin.addReplicationPeer(ID_ONE,
|
||||||
|
ReplicationPeerConfig.newBuilder().setClusterKey(KEY_ONE + " ").build()).get();
|
||||||
|
String clusterKey = admin.getReplicationPeerConfig(ID_ONE).get().getClusterKey();
|
||||||
|
assertEquals(KEY_ONE, clusterKey);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInvalidReplicationEndpoint() throws InterruptedException {
|
public void testInvalidReplicationEndpoint() throws InterruptedException {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue