Skip to content

Commit

Permalink
[apache/helix] -- Enable JDK 1.8 (backward) compatibility for depende…
Browse files Browse the repository at this point in the history
…nt 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
  • Loading branch information
himanshukandwal authored Jun 5, 2024
1 parent e0e30a7 commit 17f2df6
Show file tree
Hide file tree
Showing 5 changed files with 197 additions and 3 deletions.
48 changes: 48 additions & 0 deletions helix-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

import java.util.Set;

import com.google.common.collect.ImmutableSet;

public class InstanceConstants {
public static final String INSTANCE_NOT_DISABLED = "INSTANCE_NOT_DISABLED";

/**
* 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);


/**
Expand All @@ -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,
Expand Down
48 changes: 48 additions & 0 deletions metadata-store-directory-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
48 changes: 48 additions & 0 deletions metrics-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
48 changes: 48 additions & 0 deletions zookeeper-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 17f2df6

Please sign in to comment.