Class ProcessingUnitDeployment

java.lang.Object
org.openspaces.admin.pu.ProcessingUnitDeployment
All Implemented Interfaces:
ProcessingUnitDeploymentTopology

public class ProcessingUnitDeployment extends Object implements ProcessingUnitDeploymentTopology
A deployment of processing unit.
Author:
kimchy
See Also:
  • Constructor Details

    • ProcessingUnitDeployment

      public ProcessingUnitDeployment(String processingUnitName)
      Constructs a processing unit deployment based on the specified processing unit name (should exists under the [GS ROOT]/deploy directory.
    • ProcessingUnitDeployment

      public ProcessingUnitDeployment(File processingUnit)
      Constructs a processing unit deployment based on the specified processing unit file path (points either to a processing unit jar/zip file or a directory).
  • Method Details

    • getProcessingUnit

      @Deprecated public String getProcessingUnit()
      Deprecated.
      Returns the processing unit that will be deployed. Use ProcessingUnitConfig.getProcessingUnit() instead
    • name

      public ProcessingUnitDeployment name(String name)
      Sets the processing unit name that will be deployed. By default it will be based on the parameter passed in the constructor.
    • partitioned

      public ProcessingUnitDeployment partitioned(int numberOfParitions, int numberOfBackups)
      A convenient method allowing to easily configure the space deployment to deploy a partitioned topology with numberOfParitions instances each with numberOfBackups.

      Exactly the same like calling clusterSchema("partitioned"), followed by numberOfInstances(numberOfParitions) and numberOfBackups(numberOfBackups).

      Parameters:
      numberOfParitions - The number of partitions
      numberOfBackups - The number of backups
      Returns:
      This space deployment
    • replicated

      public ProcessingUnitDeployment replicated(boolean async, int numberOfInstances)
      A convenient method allowing to easily configure the space deployment to deploy a replicated (either sync or async) topology with numberOfInstances instances.

      Exactly the same like calling clusterSchema("sync_replicated") or clusterSchema("async_replicated"), followed by numberOfInstances(numberOfInstances) and numberOfBackups(0).

      Parameters:
      numberOfInstances - The number of instances to form the replicated space
      Returns:
      This space deployment
    • clusterSchema

      public ProcessingUnitDeployment clusterSchema(String clusterSchema)
      Controls the cluster schema of the deployment. Only make sense to set it when there is an embedded space defined within the processing unit.
    • numberOfInstances

      public ProcessingUnitDeployment numberOfInstances(int numberOfInstances)
      Sets the number of instances that will be deployed as part of this processing unit instance. In case of partitioned, defines the number of partitions.
    • numberOfBackups

      public ProcessingUnitDeployment numberOfBackups(int numberOfBackups)
      Sets the number of backups that will be deployed as part of this processing unit. Only applicable when the processing unit has an embedded space.
    • requiresIsolation

      public ProcessingUnitDeployment requiresIsolation(boolean requiresIsolation)
      Parameters:
      requiresIsolation - set true if isolation is required per virtual machine. No processing unit instances can run on the same virtual machine. Default false.
      Since:
      10.1.0
    • maxInstancesPerVM

      public ProcessingUnitDeployment maxInstancesPerVM(int maxInstancesPerVM)
      Sets the maximum number of instances per java virtual machine.

      On partitioned topology with backups topology, controls that a primary and a backup won't run on the same java virtual machine if set to 1.

      On a non partitioned with backups topology, controls the maximum number of instances running on the same java virtual machine.

    • maxInstancesPerMachine

      public ProcessingUnitDeployment maxInstancesPerMachine(int maxInstancesPerMachine)
      Sets the maximum number of instances per machine.

      On partitioned topology with backups topology, controls that a primary and a backup won't run on the same machine if set to 1.

      On a non partitioned with backups topology, controls the maximum number of instances running on the same machine.

    • maxInstancesPerZone

      public ProcessingUnitDeployment maxInstancesPerZone(String zone, int maxInstancesPerZone)
      Sets the maximum number of instances per zone.

      On partitioned topology with backups topology, controls that a primary and a backup won't run on the same zone if set to 1. Note, for each zone this will have to be set.

      On a non partitioned with backups topology, controls the maximum number of instances running on the same zone.

    • addZone

      public ProcessingUnitDeployment addZone(String zone)
      Adds a zone where the processing unit is allowed to be deployed on.
    • primaryZone

      public ProcessingUnitDeployment primaryZone(String zone)
      Set the preferred zones for primary instances.
    • addPrimaryZone

      public ProcessingUnitDeployment addPrimaryZone(String primaryZone)
      Adds a preferred zone for primary instances.
    • setContextProperty

      public ProcessingUnitDeployment setContextProperty(String key, String value)
      Sets a context deploy time property overriding any ${...} defined within a processing unit configuration.
    • setEnvironmentVariable

      public ProcessingUnitDeployment setEnvironmentVariable(String key, String value)
    • secured

      public ProcessingUnitDeployment secured(boolean secured)
      Will deploy a secured processing unit. Note, by setting user details the processing unit will be secured automatically.
      Specified by:
      secured in interface ProcessingUnitDeploymentTopology
    • userDetails

      public ProcessingUnitDeployment userDetails(UserDetails userDetails)
      Sets the security user details for authentication and authorization of the processing unit.
      Specified by:
      userDetails in interface ProcessingUnitDeploymentTopology
    • slaLocation

      public ProcessingUnitDeployment slaLocation(String slaLocation)
      Sets an external SLA definition location to be loaded.
    • slaLocation

      public ProcessingUnitDeployment slaLocation(File slaLocation)
      Sets an external SLA definition location to be loaded.
    • userDetails

      public ProcessingUnitDeployment userDetails(String userName, String password)
      Sets the username and password (effectively making the processing unit secured) for the processing unit deployment.
      Specified by:
      userDetails in interface ProcessingUnitDeploymentTopology
    • isSecured

      public Boolean isSecured()
    • getUserDetails

      @Deprecated public UserDetails getUserDetails()
      Deprecated.
    • addDependencies

      public ProcessingUnitDeployment addDependencies(ProcessingUnitDetailedDependencies<? extends ProcessingUnitDependency> detailedDependencies)
      Postpones deployment of processing unit instances until the specified dependencies are met. The following example postpones the deployment of this processing unit until B has completed the deployment and C has at least one instance deployed. deployment.addDependencies(new ProcessingUnitDeploymentDependenciesConfigurer().dependsOnDeployment("B").dependsOnMinimumNumberOfDeployedInstances("C",1).create())
      Specified by:
      addDependencies in interface ProcessingUnitDeploymentTopology
      Since:
      8.0.6
      See Also:
    • addDependency

      public ProcessingUnitDeployment addDependency(String requiredProcessingUnitName)
      Postpones deployment of processing unit instances deployment until the specified processing unit deployment is complete. Same as: deployment.addDependencies(new ProcessingUnitDeploymentDependenciesConfigurer().dependsOnDeployment(requiredProcessingUnitName).create())
      Specified by:
      addDependency in interface ProcessingUnitDeploymentTopology
      Since:
      8.0.6
    • getDeploymentOptions

      @Deprecated public String[] getDeploymentOptions()
      Deprecated.
      Transforms this deployment into a set of deployment options. Use ProcessingUnitConfig.toDeploymentOptions()
    • setDependencies

      public void setDependencies(ProcessingUnitDependencies<ProcessingUnitDependency> dependencies)
    • create

      public ProcessingUnitConfigHolder create()
      Description copied from interface: ProcessingUnitDeploymentTopology
      Converts this fluent API object to a lazy implementation of ProcessingUnitConfig
      Specified by:
      create in interface ProcessingUnitDeploymentTopology