Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug][Service][Major]存算分离架构不启用HDFS组件情况下,HADOOP_HOME变量会丢失 #601

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,27 @@ public void run(ApplicationArguments args) throws Exception {
}
}
}
checkHadoopHomeVariable(frameCode,clusters);
}
}

/**
* 检查HADOOP_HOME变量,避免变量丢失
* @param frameCode
* @param clusters
*/
private void checkHadoopHomeVariable(String frameCode,
List<ClusterInfoEntity> clusters) {
for (ClusterInfoEntity cluster : clusters) {
if (cluster.getClusterFrame().equals(frameCode)) {
Map<String, String> globalVariables = GlobalVariables.get(cluster.getId());
// load global variable, 加载 frame
boolean containsHadoopHome = globalVariables.containsKey("HADOOP_HOME");
if (!containsHadoopHome) {
// 如果Map中包含"HADOOP_HOME",则执行相关操作
globalVariables.put("${HADOOP_HOME}",Constants.INSTALL_PATH + Constants.SLASH + "hadoop");
}
}
}
}

Expand Down