Skip to content

Conversation

@jasontedor
Copy link
Member

This commit adapts the elasticsearch-hadoop build to an upstream change to make some build globals type safe. In particular, we adapt the usage of Java versions.

Relates elastic/elasticsearch#48778

This commit adapts the elasticsearch-hadoop build to an upstream change
to make some build globals type safe. In particular, we adapt the usage
of Java versions.
Copy link
Member

@jbaiera jbaiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@jakelandis jakelandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@mark-vieira mark-vieira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasontedor thanks for doing this. There's some room for further refactoring to use BuildParams over extra properties. If this PR is just enough to get things to work I'm good with than and would be glad to tackle the more substantial cleanup myself.

project.ext.revHash = project.rootProject.ext.revHash
project.ext.javaVersions = project.rootProject.ext.javaVersions
project.ext.javaVersions = BuildParams.javaVersions
project.ext.isRuntimeJavaHomeSet = project.rootProject.ext.isRuntimeJavaHomeSet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isRuntimeJavaHomeSet has been replaced by a property on BuildParams a well

project.ext.gitHead = project.rootProject.ext.gitHead
project.ext.revHash = project.rootProject.ext.revHash
project.ext.javaVersions = project.rootProject.ext.javaVersions
project.ext.javaVersions = BuildParams.javaVersions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is setting these extra properties strictly necessary? We should be better off replacing their usages with direct usage of BuildParams.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we are overriding these up further in this plugin as well. If hadoop is using it's own logic to set runtime java home we should use BuildParams.init() to set those values instead of continuing the practice of using extra properties.

/** Return the java home used by this node. */
String getJavaHome() {
return javaVersion == null ? project.runtimeJavaHome : project.javaVersions.find { it.version == javaVersion }.javaHome.absolutePath
return javaVersion == null ? project.runtimeJavaHome : BuildParams.javaVersions.find { it.version == javaVersion }.javaHome.absolutePath
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming we refactor out usages of extra properties completely, we can replace project.runtimeJavaHome with the BuildParams variant.

@jasontedor
Copy link
Member Author

@mark-vieira Yes, this is enough to make the build successful. I would be happy if you could pick up the follow-ups.

@jasontedor jasontedor merged commit 6c6e25e into elastic:master Nov 11, 2019
@jasontedor jasontedor deleted the type-safe-java-versions-adaptation branch November 11, 2019 19:10
jbaiera pushed a commit that referenced this pull request May 13, 2020
This commit adapts the elasticsearch-hadoop build to an upstream change
to make some build globals type safe. In particular, we adapt the usage
of Java versions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants