GigaSpaces XAP 9.7.2 API

org.openspaces.admin.pu.elastic
Class ElasticStatefulProcessingUnitDeployment

java.lang.Object
  extended by org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
      extended by org.openspaces.admin.pu.elastic.ElasticStatefulProcessingUnitDeployment
All Implemented Interfaces:
AdvancedStatefulDeploymentTopology, EagerScaleTopology, ElasticDeploymentTopology, ElasticStatefulDeploymentTopology, ManualCapacityScaleTopology, ProcessingUnitDeploymentTopology

public class ElasticStatefulProcessingUnitDeployment
extends org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
implements ElasticStatefulDeploymentTopology, AdvancedStatefulDeploymentTopology

Defines an elastic deployment of a processing unit that with an embedded space.. The advantage of this topology is that the code can access the data without the network/serialization overhead and that space events can be used as code triggers. The disadvantage compared to a stateless processing unit is that the ratio between the minimum and maximum number of containers is limited.

Author:
itaif
See Also:
ElasticStatefulProcessingUnitDeployment

Constructor Summary
ElasticStatefulProcessingUnitDeployment(File processingUnit)
          Constructs a stateful processing unit deployment based on the specified processing unit file path (points either to a processing unit jar/zip file or a directory).
ElasticStatefulProcessingUnitDeployment(String processingUnit)
          Constructs a stateful processing unit deployment based on the specified processing unit name (should exists under the [GS ROOT]/deploy directory.
 
Method Summary
 ElasticStatefulProcessingUnitDeployment addCommandLineArgument(String vmInputArgument)
          Will add a JVM level argument when the process is executed using pure JVM.
 ElasticStatefulProcessingUnitDeployment addContextProperty(String key, String value)
          Defines a context deploy time property overriding any ${...}
 ElasticStatefulProcessingUnitDeployment addDependencies(org.openspaces.admin.internal.pu.dependency.ProcessingUnitDetailedDependencies<? extends ProcessingUnitDependency> detailedDependencies)
          Postpones deployment of processing unit instances until the specified dependencies are met.
 ElasticStatefulProcessingUnitDeployment addDependency(String requiredProcessingUnitName)
          Postpones deployment of processing unit instances deployment until the specified processing unit deployment is complete.
 ElasticStatefulProcessingUnitDeployment addEnvironmentVariable(String name, String value)
          Defines an environment variable that will be passed to forked process.
 ElasticStatefulProcessingUnitDeployment commandLineArgument(String vmInputArgument)
          Will add a JVM level argument when the process is executed using pure JVM.
 ElasticStatefulProcessingUnitConfig create()
          Converts this fluent API object to a lazy implementation of ProcessingUnitConfig
 ElasticStatefulProcessingUnitDeployment dedicatedMachineProvisioning(ElasticMachineProvisioningConfig config)
          Configure the server side bean that starts and stops machines automatically.
 ElasticStatefulProcessingUnitDeployment environmentVariable(String name, String value)
          Sets an environment variable that will be passed to forked process.
protected  ElasticStatefulProcessingUnitConfig getConfig()
           
 ElasticStatefulProcessingUnitDeployment highlyAvailable(boolean highlyAvailable)
          Specifies if the space should duplicate each information on two different machines.
 ElasticStatefulProcessingUnitDeployment maxMemoryCapacity(int maxMemoryCapacity, MemoryUnit unit)
          Specifies an estimate of the maximum memory capacity for this processing unit.
 ElasticStatefulProcessingUnitDeployment maxMemoryCapacity(String maxMemoryCapacity)
          Specifies an estimate of the minimum memory capacity for this processing unit.
 ElasticStatefulProcessingUnitDeployment maxNumberOfCpuCores(int maxNumberOfCpuCores)
          Specifies an estimate for the maximum total number of cpu cores used by this processing unit.
protected  ElasticStatefulProcessingUnitDeployment maxProcessingUnitInstancesFromSamePartitionPerMachine(int maxProcessingUnitInstancesFromSamePartitionPerMachine)
           
 ElasticStatefulProcessingUnitDeployment memoryCapacityPerContainer(int memoryCapacityPerContainer, MemoryUnit unit)
          Specifies the the heap size per container (operating system process) For example: memoryCapacityPerContainer(256,MemoryUnit.MEGABYTES) is equivalent to commandLineArgument("-Xmx256m").commandLineArgument("-Xms256m")
 ElasticStatefulProcessingUnitDeployment memoryCapacityPerContainer(String memoryCapacityPerContainer)
          Specifies the the heap size per container (operating system process) For example: memoryCapacityPerContainer("256m") is equivalent to commandLineArgument("-Xmx256m").commandLineArgument("-Xms256m")
 ElasticStatefulProcessingUnitDeployment minNumberOfCpuCoresPerMachine(double minNumberOfCpuCoresPerMachine)
          Deprecated. 
 ElasticStatefulProcessingUnitDeployment name(String name)
          Sets the processing unit name that will be deployed.
 ElasticStatefulProcessingUnitDeployment numberOfBackupsPerPartition(int numberOfBackupsPerPartition)
          Overrides the number of backup processing unit instances per partition.
 ElasticStatefulProcessingUnitDeployment numberOfPartitions(int numberOfPartitions)
          Defines the number of processing unit partitions.
 ElasticStatefulProcessingUnitDeployment overrideCommandLineArguments()
          Will cause JVM options added using AbstractElasticProcessingUnitDeployment.commandLineArgument(String) to override all the vm arguments that the JVM will start by default with.
 ElasticStatefulProcessingUnitDeployment publicMachineProvisioning(ElasticMachineProvisioningConfig config)
          Configure the server side bean that starts and stops machines automatically.
 ElasticStatefulProcessingUnitDeployment scale(EagerScaleConfig strategy)
          Enables the specified scale strategy, and disables all other scale strategies.
 ElasticStatefulProcessingUnitDeployment scale(ManualCapacityScaleConfig strategy)
          Enables the specified scale strategy, and disables all other scale strategies.
 ElasticStatefulProcessingUnitDeployment secured(boolean secured)
          Will deploy a secured processing unit.
 ElasticStatefulProcessingUnitDeployment sharedMachineProvisioning(String sharingId, ElasticMachineProvisioningConfig config)
          Configure the server side bean that starts and stops machines automatically.
 ElasticStatefulProcessingUnitDeployment singleMachineDeployment()
          Allows deployment of the processing unit on a single machine, by lifting the limitation for primary and backup processing unit instances from the same partition to be deployed on different machines.
 ElasticStatefulProcessingUnitDeployment userDetails(String userName, String password)
          Advanced: Sets the security user details for authentication and authorization of the processing unit.
 ElasticStatefulProcessingUnitDeployment userDetails(UserDetails userDetails)
          Advanced: Sets the security user details for authentication and authorization of the processing unit.
 ElasticStatefulProcessingUnitDeployment useScriptToStartContainer()
          Will cause the GridServiceContainer to be started using a script and not a pure Java process.
 
Methods inherited from class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
addContextPropertyDefault, getElasticProperties, scale, sharedMachineProvisioning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElasticStatefulProcessingUnitDeployment

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


ElasticStatefulProcessingUnitDeployment

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

Method Detail

maxMemoryCapacity

public ElasticStatefulProcessingUnitDeployment maxMemoryCapacity(int maxMemoryCapacity,
                                                                 MemoryUnit unit)
Description copied from interface: ElasticStatefulDeploymentTopology
Specifies an estimate of the maximum memory capacity for this processing unit. The actual maximum memory capacity will be at least the specified maximum. Requires the memoryCapacityPerContainer() property. The memory capacity value is the sum of both the primary and backup instances memory capacity.

Specified by:
maxMemoryCapacity in interface ElasticStatefulDeploymentTopology

maxMemoryCapacity

public ElasticStatefulProcessingUnitDeployment maxMemoryCapacity(String maxMemoryCapacity)
Description copied from interface: ElasticStatefulDeploymentTopology
Specifies an estimate of the minimum memory capacity for this processing unit. The actual maximum memory capacity will be at least the specified maximum. Requires the memoryCapacityPerContainer() property. The memory capacity value is the sum of both the primary and backup instances memory capacity.

Specified by:
maxMemoryCapacity in interface ElasticStatefulDeploymentTopology

highlyAvailable

public ElasticStatefulProcessingUnitDeployment highlyAvailable(boolean highlyAvailable)
Description copied from interface: ElasticStatefulDeploymentTopology
Specifies if the space should duplicate each information on two different machines. If set to false then partition data is lost each time fail-over or scaling occurs. By default highlyAvailable is true

Specified by:
highlyAvailable in interface ElasticStatefulDeploymentTopology

numberOfBackupsPerPartition

public ElasticStatefulProcessingUnitDeployment numberOfBackupsPerPartition(int numberOfBackupsPerPartition)
Description copied from interface: AdvancedStatefulDeploymentTopology
Overrides the number of backup processing unit instances per partition. Default is 1 This is an advanced property.

Specified by:
numberOfBackupsPerPartition in interface AdvancedStatefulDeploymentTopology

numberOfPartitions

public ElasticStatefulProcessingUnitDeployment numberOfPartitions(int numberOfPartitions)
Description copied from interface: AdvancedStatefulDeploymentTopology
Defines the number of processing unit partitions. This property cannot be used with ElasticStatefulDeploymentTopology.maxMemoryCapacity(String) and ElasticStatefulDeploymentTopology.maxNumberOfCpuCores(int). This is an advanced property.

Specified by:
numberOfPartitions in interface AdvancedStatefulDeploymentTopology

maxProcessingUnitInstancesFromSamePartitionPerMachine

protected ElasticStatefulProcessingUnitDeployment maxProcessingUnitInstancesFromSamePartitionPerMachine(int maxProcessingUnitInstancesFromSamePartitionPerMachine)

maxNumberOfCpuCores

public ElasticStatefulProcessingUnitDeployment maxNumberOfCpuCores(int maxNumberOfCpuCores)
Description copied from interface: ElasticStatefulDeploymentTopology
Specifies an estimate for the maximum total number of cpu cores used by this processing unit.

Specified by:
maxNumberOfCpuCores in interface ElasticStatefulDeploymentTopology

minNumberOfCpuCoresPerMachine

@Deprecated
public ElasticStatefulProcessingUnitDeployment minNumberOfCpuCoresPerMachine(double minNumberOfCpuCoresPerMachine)
Deprecated. 

See Also:
ElasticMachineProvisioningConfig.getMinimumNumberOfCpuCoresPerMachine()

memoryCapacityPerContainer

public ElasticStatefulProcessingUnitDeployment memoryCapacityPerContainer(int memoryCapacityPerContainer,
                                                                          MemoryUnit unit)
Description copied from interface: ElasticDeploymentTopology
Specifies the the heap size per container (operating system process) For example: memoryCapacityPerContainer(256,MemoryUnit.MEGABYTES) is equivalent to commandLineArgument("-Xmx256m").commandLineArgument("-Xms256m")

Specified by:
memoryCapacityPerContainer in interface ElasticDeploymentTopology
Overrides:
memoryCapacityPerContainer in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

memoryCapacityPerContainer

public ElasticStatefulProcessingUnitDeployment memoryCapacityPerContainer(String memoryCapacityPerContainer)
Description copied from interface: ElasticDeploymentTopology
Specifies the the heap size per container (operating system process) For example: memoryCapacityPerContainer("256m") is equivalent to commandLineArgument("-Xmx256m").commandLineArgument("-Xms256m")

Specified by:
memoryCapacityPerContainer in interface ElasticDeploymentTopology
Overrides:
memoryCapacityPerContainer in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

singleMachineDeployment

public ElasticStatefulProcessingUnitDeployment singleMachineDeployment()
Description copied from interface: AdvancedStatefulDeploymentTopology
Allows deployment of the processing unit on a single machine, by lifting the limitation for primary and backup processing unit instances from the same partition to be deployed on different machines. Default value is false (by default primary instances and backup instances need separate machines). This is an advanced property.

Specified by:
singleMachineDeployment in interface AdvancedStatefulDeploymentTopology

scale

public ElasticStatefulProcessingUnitDeployment scale(EagerScaleConfig strategy)
Description copied from interface: EagerScaleTopology
Enables the specified scale strategy, and disables all other scale strategies. Eager scale starts new containers on any available agent. Scale strategies can also be reconfigured after deployment.

Specified by:
scale in interface EagerScaleTopology
See Also:
EagerScaleConfig, EagerScaleConfigurer

scale

public ElasticStatefulProcessingUnitDeployment scale(ManualCapacityScaleConfig strategy)
Description copied from interface: ManualCapacityScaleTopology
Enables the specified scale strategy, and disables all other scale strategies. Manual scale, starts containers until the specified capacity is reached. Scale strategies can also be reconfigured after deployment.

Specified by:
scale in interface ManualCapacityScaleTopology
See Also:
ManualCapacityScaleConfig, ManualCapacityScaleConfigurer

name

public ElasticStatefulProcessingUnitDeployment name(String name)
Description copied from interface: ElasticDeploymentTopology
Sets the processing unit name that will be deployed. By default it will be based on the parameter passed in the constructor.

Specified by:
name in interface ElasticDeploymentTopology
Overrides:
name in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

addContextProperty

public ElasticStatefulProcessingUnitDeployment addContextProperty(String key,
                                                                  String value)
Description copied from interface: ElasticDeploymentTopology
Defines a context deploy time property overriding any ${...} defined within a processing unit configuration.

Specified by:
addContextProperty in interface ElasticDeploymentTopology
Overrides:
addContextProperty in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

secured

public ElasticStatefulProcessingUnitDeployment secured(boolean secured)
Description copied from interface: ProcessingUnitDeploymentTopology
Will deploy a secured processing unit. Note, by setting user details the processing unit will be secured automatically.

Specified by:
secured in interface ProcessingUnitDeploymentTopology
Overrides:
secured in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

userDetails

public ElasticStatefulProcessingUnitDeployment userDetails(UserDetails userDetails)
Description copied from interface: ProcessingUnitDeploymentTopology
Advanced: Sets the security user details for authentication and authorization of the processing unit.

Specified by:
userDetails in interface ProcessingUnitDeploymentTopology
Overrides:
userDetails in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

userDetails

public ElasticStatefulProcessingUnitDeployment userDetails(String userName,
                                                           String password)
Description copied from interface: ProcessingUnitDeploymentTopology
Advanced: Sets the security user details for authentication and authorization of the processing unit.

Specified by:
userDetails in interface ProcessingUnitDeploymentTopology
Overrides:
userDetails in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

useScriptToStartContainer

public ElasticStatefulProcessingUnitDeployment useScriptToStartContainer()
Description copied from class: org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
Will cause the GridServiceContainer to be started using a script and not a pure Java process.

Specified by:
useScriptToStartContainer in interface ElasticDeploymentTopology
Overrides:
useScriptToStartContainer in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

overrideCommandLineArguments

public ElasticStatefulProcessingUnitDeployment overrideCommandLineArguments()
Description copied from class: org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
Will cause JVM options added using AbstractElasticProcessingUnitDeployment.commandLineArgument(String) to override all the vm arguments that the JVM will start by default with.

Specified by:
overrideCommandLineArguments in interface ElasticDeploymentTopology
Overrides:
overrideCommandLineArguments in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

commandLineArgument

public ElasticStatefulProcessingUnitDeployment commandLineArgument(String vmInputArgument)
Description copied from class: org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
Will add a JVM level argument when the process is executed using pure JVM. For example, the memory can be controlled using -Xmx512m.

Specified by:
commandLineArgument in interface ElasticDeploymentTopology
Overrides:
commandLineArgument in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

addCommandLineArgument

public ElasticStatefulProcessingUnitDeployment addCommandLineArgument(String vmInputArgument)
Description copied from interface: ElasticDeploymentTopology
Will add a JVM level argument when the process is executed using pure JVM. For example, the memory can be controlled using -Xmx512m.

Specified by:
addCommandLineArgument in interface ElasticDeploymentTopology

environmentVariable

public ElasticStatefulProcessingUnitDeployment environmentVariable(String name,
                                                                   String value)
Description copied from class: org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
Sets an environment variable that will be passed to forked process.

Specified by:
environmentVariable in interface ElasticDeploymentTopology
Overrides:
environmentVariable in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

addEnvironmentVariable

public ElasticStatefulProcessingUnitDeployment addEnvironmentVariable(String name,
                                                                      String value)
Description copied from interface: ElasticDeploymentTopology
Defines an environment variable that will be passed to forked process.

Specified by:
addEnvironmentVariable in interface ElasticDeploymentTopology

dedicatedMachineProvisioning

public ElasticStatefulProcessingUnitDeployment dedicatedMachineProvisioning(ElasticMachineProvisioningConfig config)
Description copied from interface: ElasticDeploymentTopology
Configure the server side bean that starts and stops machines automatically. For example, the bean could delegate the request to a cloud provider.

The machines returned by the 'machine provisioner' will be dedicated to the instances of this processing unit. In other words, this processing unit will not share the machines with other processing units.

See also DiscoveredMachineProvisioningConfig for configuring deployment on a non-virtualized environment. Machines are discovered if 'Grid Service Agents' are running on them.

Specified by:
dedicatedMachineProvisioning in interface ElasticDeploymentTopology
Overrides:
dedicatedMachineProvisioning in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
See Also:
ElasticDeploymentTopology.sharedMachineProvisioning(String, ElasticMachineProvisioningConfig)

publicMachineProvisioning

public ElasticStatefulProcessingUnitDeployment publicMachineProvisioning(ElasticMachineProvisioningConfig config)
Description copied from interface: ElasticDeploymentTopology
Configure the server side bean that starts and stops machines automatically. For example, the bean could delegate the request to a cloud provider.

The machines returned by the 'machine provisioner' will be shared by any other instance using publicMachineProvisioning or any non-elastic processing unit instance.

Specified by:
publicMachineProvisioning in interface ElasticDeploymentTopology
Overrides:
publicMachineProvisioning in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

sharedMachineProvisioning

public ElasticStatefulProcessingUnitDeployment sharedMachineProvisioning(String sharingId,
                                                                         ElasticMachineProvisioningConfig config)
Description copied from interface: ElasticDeploymentTopology
Configure the server side bean that starts and stops machines automatically. For example, the bean could delegate the request to a cloud provider.

The machines returned by the 'machine provisioner' will be shared by other processing unit instances with the same sharingId.

See also DiscoveredMachineProvisioningConfig for configuring deployment on a non-virtualized environment. Machines are discovered if 'Grid Service Agents' are running on them.

Specified by:
sharedMachineProvisioning in interface ElasticDeploymentTopology
See Also:
ElasticDeploymentTopology.dedicatedMachineProvisioning(ElasticMachineProvisioningConfig)

addDependency

public ElasticStatefulProcessingUnitDeployment addDependency(String requiredProcessingUnitName)
Description copied from interface: ProcessingUnitDeploymentTopology
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

addDependencies

public ElasticStatefulProcessingUnitDeployment addDependencies(org.openspaces.admin.internal.pu.dependency.ProcessingUnitDetailedDependencies<? extends ProcessingUnitDependency> detailedDependencies)
Description copied from interface: ProcessingUnitDeploymentTopology
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
Overrides:
addDependencies in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
See Also:
ProcessingUnitDeploymentDependenciesConfigurer

create

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

Specified by:
create in interface ProcessingUnitDeploymentTopology

getConfig

protected ElasticStatefulProcessingUnitConfig getConfig()
Overrides:
getConfig in class org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.