Package org.apache.ignite.example.util
Class DeployComputeUnit
java.lang.Object
org.apache.ignite.example.util.DeployComputeUnit
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddeployIfNotExist(String deploymentUnitName, String deploymentUnitVersion) Checks if a deployment unit exists with DEPLOYED status.static voidundeployUnit(String unitId, String version) Undeploys the given deployment unit from the cluster and waits for it to be removed.
-
Constructor Details
-
DeployComputeUnit
public DeployComputeUnit()
-
-
Method Details
-
undeployUnit
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.
-