[bug-3480][server]fix ds muti-level directory in zk, which lead to fa… (#3532)

* [bug-3480][server]fix ds muti-level directory in zk, which lead to fail to assign work

* miss whitespace for if statement
This commit is contained in:
XiaotaoYi 2020-08-18 07:09:39 +08:00 committed by GitHub
parent ad89f433f1
commit 0b7b6d4e2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -151,10 +151,10 @@ public class ZookeeperNodeManager implements InitializingBean {
private String parseGroup(String path){
String[] parts = path.split("\\/");
if(parts.length != 6){
if (parts.length < 6) {
throw new IllegalArgumentException(String.format("worker group path : %s is not valid, ignore", path));
}
String group = parts[4];
String group = parts[parts.length - 2];
return group;
}
}