Class DeployComputeUnit

java.lang.Object
org.apache.ignite.example.util.DeployComputeUnit

public class DeployComputeUnit extends Object
Utility class for deploying Ignite compute units.

The deployment unit JAR is embedded as a classpath resource at units/deploymentunit-example-1.0.0.jar by the Gradle processResources task (which depends on deploymentUnitJar). This means the JAR is always available on the classpath without requiring any file-system paths or runner-specific workarounds.

  • Constructor Details

    • DeployComputeUnit

      public DeployComputeUnit()
  • Method Details

    • undeployUnit

      public static void undeployUnit(String unitId, String version) throws Exception
      Undeploys the given deployment unit from the cluster and waits for it to be removed.
      Parameters:
      unitId - Deployment unit ID.
      version - Deployment version.
      Throws:
      Exception - If undeployment fails.
    • deployIfNotExist

      public static void deployIfNotExist(String deploymentUnitName, String deploymentUnitVersion) throws Exception
      Checks if a deployment unit exists with DEPLOYED status. If it does not exist or is not deployed, deploys the unit from the embedded classpath JAR and waits for it to reach DEPLOYED status.

      The method uses polling to check the deployment status periodically until it reaches DEPLOYED state. If the unit is already deployed, it skips the deployment process.

      Parameters:
      deploymentUnitName - The name of the deployment unit to check and deploy.
      deploymentUnitVersion - The version of the deployment unit to check and deploy.
      Throws:
      Exception - If an error occurs during the deployment process, such as a failure to deploy the unit.