You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@helix.apache.org by jx...@apache.org on 2024/06/05 16:50:22 UTC
(helix) branch master updated: [apache/helix] -- Enable JDK 1.8 (backward) compatibility for dependent modules of meta-client and helix-core (#2806)
This is an automated email from the ASF dual-hosted git repository.
jxue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/helix.git
The following commit(s) were added to refs/heads/master by this push:
new 17f2df6f6 [apache/helix] -- Enable JDK 1.8 (backward) compatibility for dependent modules of meta-client and helix-core (#2806)
17f2df6f6 is described below
commit 17f2df6f6e2ee453668e4cd8a562a93434d531d8
Author: Himanshu Kandwal <hk...@linkedin.com>
AuthorDate: Wed Jun 5 09:50:17 2024 -0700
[apache/helix] -- Enable JDK 1.8 (backward) compatibility for dependent modules of meta-client and helix-core (#2806)
We would like to provide a backward compatible support to our consumers where they also have an option to use JDK-8 compiled meta-client jar, if they have such a requirement. By default we will generate JDK-11 jars and JDK-8 jars using a classifier. In this PR, we are enabling the JDK* build of full sub-tree of the helix-core and meta-client modules. This includes:
helix-common, zookeeper-api, metadata-store-directory-common, metrics-common
---
helix-common/pom.xml | 48 ++++++++++++++++++++++
.../apache/helix/constants/InstanceConstants.java | 8 ++--
metadata-store-directory-common/pom.xml | 48 ++++++++++++++++++++++
metrics-common/pom.xml | 48 ++++++++++++++++++++++
zookeeper-api/pom.xml | 48 ++++++++++++++++++++++
5 files changed, 197 insertions(+), 3 deletions(-)
diff --git a/helix-common/pom.xml b/helix-common/pom.xml
index 40f64043b..82e35c86d 100644
--- a/helix-common/pom.xml
+++ b/helix-common/pom.xml
@@ -89,6 +89,54 @@
</resource>
</resources>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.12.1</version>
+ <executions>
+ <execution>
+ <id>JDK 8</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}_jdk8</outputDirectory>
+ <release>8</release>
+ <fork>true</fork>
+ </configuration>
+ </execution>
+ <execution>
+ <id>JDK 11</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <release>11</release>
+ <fork>true</fork>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.3.0</version>
+ <executions>
+ <execution>
+ <id>default-package-jdk11</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classesDirectory>${project.build.outputDirectory}_jdk8</classesDirectory>
+ <classifier>jdk8</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
diff --git a/helix-common/src/main/java/org/apache/helix/constants/InstanceConstants.java b/helix-common/src/main/java/org/apache/helix/constants/InstanceConstants.java
index 07eb4989d..85c22c460 100644
--- a/helix-common/src/main/java/org/apache/helix/constants/InstanceConstants.java
+++ b/helix-common/src/main/java/org/apache/helix/constants/InstanceConstants.java
@@ -2,6 +2,8 @@ package org.apache.helix.constants;
import java.util.Set;
+import com.google.common.collect.ImmutableSet;
+
public class InstanceConstants {
public static final String INSTANCE_NOT_DISABLED = "INSTANCE_NOT_DISABLED";
@@ -9,7 +11,7 @@ public class InstanceConstants {
* The set contains the InstanceOperations that are allowed to be assigned replicas by the rebalancer.
*/
public static final Set<InstanceOperation> ASSIGNABLE_INSTANCE_OPERATIONS =
- Set.of(InstanceOperation.ENABLE, InstanceOperation.DISABLE);
+ ImmutableSet.of(InstanceOperation.ENABLE, InstanceOperation.DISABLE);
/**
@@ -18,14 +20,14 @@ public class InstanceConstants {
* TODO: Remove this when the deprecated HELIX_ENABLED is removed.
*/
public static final Set<InstanceOperation> INSTANCE_DISABLED_OVERRIDABLE_OPERATIONS =
- Set.of(InstanceOperation.ENABLE, InstanceOperation.DISABLE, InstanceOperation.EVACUATE);
+ ImmutableSet.of(InstanceOperation.ENABLE, InstanceOperation.DISABLE, InstanceOperation.EVACUATE);
/**
* The set of InstanceOperations that are not allowed to be populated in the RoutingTableProvider.
*/
public static final Set<InstanceOperation> UNSERVABLE_INSTANCE_OPERATIONS =
- Set.of(InstanceOperation.SWAP_IN, InstanceOperation.UNKNOWN);
+ ImmutableSet.of(InstanceOperation.SWAP_IN, InstanceOperation.UNKNOWN);
public enum InstanceDisabledType {
CLOUD_EVENT,
diff --git a/metadata-store-directory-common/pom.xml b/metadata-store-directory-common/pom.xml
index f173397cc..98e2e5cb0 100644
--- a/metadata-store-directory-common/pom.xml
+++ b/metadata-store-directory-common/pom.xml
@@ -113,6 +113,54 @@
</resource>
</resources>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.12.1</version>
+ <executions>
+ <execution>
+ <id>JDK 8</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}_jdk8</outputDirectory>
+ <release>8</release>
+ <fork>true</fork>
+ </configuration>
+ </execution>
+ <execution>
+ <id>JDK 11</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <release>11</release>
+ <fork>true</fork>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.3.0</version>
+ <executions>
+ <execution>
+ <id>default-package-jdk11</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classesDirectory>${project.build.outputDirectory}_jdk8</classesDirectory>
+ <classifier>jdk8</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
diff --git a/metrics-common/pom.xml b/metrics-common/pom.xml
index 2dbe016cb..433c575aa 100644
--- a/metrics-common/pom.xml
+++ b/metrics-common/pom.xml
@@ -84,6 +84,54 @@
</resource>
</resources>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.12.1</version>
+ <executions>
+ <execution>
+ <id>JDK 8</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}_jdk8</outputDirectory>
+ <release>8</release>
+ <fork>true</fork>
+ </configuration>
+ </execution>
+ <execution>
+ <id>JDK 11</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <release>11</release>
+ <fork>true</fork>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.3.0</version>
+ <executions>
+ <execution>
+ <id>default-package-jdk11</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classesDirectory>${project.build.outputDirectory}_jdk8</classesDirectory>
+ <classifier>jdk8</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
diff --git a/zookeeper-api/pom.xml b/zookeeper-api/pom.xml
index d44160fdb..bfb993fee 100644
--- a/zookeeper-api/pom.xml
+++ b/zookeeper-api/pom.xml
@@ -133,6 +133,54 @@
</resource>
</resources>
<plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.12.1</version>
+ <executions>
+ <execution>
+ <id>JDK 8</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>${project.build.outputDirectory}_jdk8</outputDirectory>
+ <release>8</release>
+ <fork>true</fork>
+ </configuration>
+ </execution>
+ <execution>
+ <id>JDK 11</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>compile</goal>
+ </goals>
+ <configuration>
+ <release>11</release>
+ <fork>true</fork>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>3.3.0</version>
+ <executions>
+ <execution>
+ <id>default-package-jdk11</id>
+ <phase>package</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ <configuration>
+ <classesDirectory>${project.build.outputDirectory}_jdk8</classesDirectory>
+ <classifier>jdk8</classifier>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>