Skip to content

Commit

Permalink
fix int of params
Browse files Browse the repository at this point in the history
  • Loading branch information
xlinliu committed Jan 9, 2025
1 parent 18b94c4 commit 08833b6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,22 @@ private void convertConfiguration(WorkflowNode workflowNode, LinkisJob job){
configuration.forEach((k,v)-> {
if(null!=v) {
v.forEach((k2, v2) -> {
if(AzkabanConstant.AUTO_DISABLED.equals(k2) && null !=v2){job.setAutoDisabled(v2.toString());}
else if(null !=v2) {job.getConf().put(confprefix + k + "." + k2, v2.toString());}
if(v2!=null) {
String vStr;
if (v2 instanceof Number) {
Number numValue = (Number) v2;
vStr = numValue.longValue() == numValue.doubleValue() ?
String.valueOf(numValue.longValue()) :
numValue.toString();
} else {
vStr = v2.toString();
}
if (AzkabanConstant.AUTO_DISABLED.equals(k2) ) {
job.setAutoDisabled(vStr);
} else {
job.getConf().put(confprefix + k + "." + k2, vStr);
}
}
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,21 @@ private void convertConfiguration(WorkflowNode workflowNode, LinkisJob job){
v.forEach((k2, v2) -> {
if(AzkabanConstant.AUTO_DISABLED.equals(k2) && null !=v2){job.setAutoDisabled(v2.toString());}
else if(null !=v2) {
String vStr;
if (v2 instanceof Number) {
Number numValue = (Number) v2;
vStr = numValue.longValue() == numValue.doubleValue() ?
String.valueOf(numValue.longValue()) :
numValue.toString();
} else {
vStr = v2.toString();
}
if("only.receive.today".equals(k2)){
job.getConf().put("msg.rece.today", v2.toString());
job.getConf().put("msg.rece.today", vStr);
}else if("max.receive.hours".equals(k2)){
job.getConf().put("wait.time", v2.toString());
job.getConf().put("wait.time", vStr);
}else{
job.getConf().put(k2, v2.toString());
job.getConf().put(k2, vStr);
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,16 @@ public void saveFlowMetaData(Long flowID, String jsonFlow, Long orchestratorId)
for (Map.Entry<String, Object> paramEntry : paramValue.entrySet()) {
String paramName = paramEntry.getKey();
if (paramEntry.getValue() != null) {
String paramVal = paramEntry.getValue().toString();
String paramVal;
Object value = paramEntry.getValue();
if (value instanceof Number) {
Number numValue = (Number) value;
paramVal = numValue.longValue() == numValue.doubleValue() ?
String.valueOf(numValue.longValue()) :
numValue.toString();
} else {
paramVal = value.toString();
}
logger.info("{}:{}", paramName, paramVal);
String nodeContentType = null;
if (nodeNumberMap.containsKey(jobType) && nodeNumberMap.get(jobType).equals(paramName)) {
Expand Down

0 comments on commit 08833b6

Please sign in to comment.