您的位置:首页 > Web前端 > Node.js

修改oozie action node name的长度限制

2013-08-21 11:01 465 查看
        在使用oozie的过程中,可能会遇到如下问题:

        E0724: Invalid node name, name [your action node name] must be 50 chars or less

        可是去mysql里查看表结构,发现WF_ACTIONS表的name字段长度是varchar(255),于是去查看源代码,发现在core包里的ParamChecker类里有这样一个方法被LiteWorkflowAppParser类调用了

private static final int MAX_NODE_NAME_LEN = 50;

/**
* Check that the given string is a valid action name [a-zA-Z_][0-9a-zA-Z_\-]* and not longer than 50 chars.
*
* @param actionName string to validate is a token.
* @return the given string.
*/
public static String validateActionName(String actionName) {
ParamChecker.notEmpty(actionName, "action name");
if (actionName.length() > MAX_NODE_NAME_LEN) {
throw new IllegalArgumentException(XLog.format("name [{0}] must be {1} chars or less", actionName,
MAX_NODE_NAME_LEN));
}

char c = actionName.charAt(0);
if (!(c >= 'A' && c <= 'Z') && !(c >= 'a' && c <= 'z') && !(c == '_')) {
throw new IllegalArgumentException(XLog.format("name [{0}], must start with [A-Za-z_]", actionName));
}
for (int i = 1; i < actionName.length(); i++) {
c = actionName.charAt(i);
if (!(c >= '0' && c <= '9') && !(c >= 'A' && c <= 'Z') && !(c >= 'a' && c <= 'z')
&& !(c == '_' || c == '-')) {
throw new IllegalArgumentException(XLog.format("name [{0}] must be [A-Za-z_][0-9A-Za-z_]*", actionName));
}
}
return actionName;
}


这里的MAX_NODE_NAME_LEN被写死了50, 于是修改成100重新编译打包,打包时最好跳过测试,mvn install -Dmaven.test.skip=true

打好包之后把 oozie-core-xxx.jar包拷到oozie的安装目录覆盖掉原jar包,重启oozie即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  oozie nodename长度