GigaSpaces XAP 9.0 API

org.openspaces.admin.pu.elastic
Class ElasticStatelessProcessingUnitDeployment

java.lang.Object
  extended by org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
      extended by org.openspaces.admin.pu.elastic.ElasticStatelessProcessingUnitDeployment
All Implemented Interfaces:
AutomaticCapacityScaleTopology, EagerScaleTopology, ElasticDeploymentTopology, ElasticStatelessDeploymentTopology<ProcessingUnitDependency>, ManualCapacityScaleTopology, ProcessingUnitDeploymentTopology

public class ElasticStatelessProcessingUnitDeployment
extends org.openspaces.admin.internal.pu.elastic.AbstractElasticProcessingUnitDeployment
implements ElasticStatelessDeploymentTopology<ProcessingUnitDependency>

Defines an elastic processing unit deployment that does not contain a space.

Author:
itaif

Constructor Summary
ElasticStatelessProcessingUnitDeployment(File processingUnit)
          Constructs a stateless processing unit deployment based on the specified processing unit file path (points either to a processing unit jar/zip file or a directory).
ElasticStatelessProcessingUnitDeployment(String processingUnit)
          Constructs a stateless processing unit deployment based on the specified processing unit name (should exists under the [GS ROOT]/deploy directory.
 
Method Summary
 ElasticStatelessProcessingUnitDeployment addCommandLineArgument(String vmInputArgument)
          Will add a JVM level argument when the process is executed using pure JVM.
 ElasticStatelessProcessingUnitDeployment addContextProperty(String key, String value)
          Defines a context deploy time property overriding any ${...}
 ElasticStatelessProcessingUnitDeployment addDependencies(org.openspaces.admin.internal.pu.dependency.ProcessingUnitDetailedDependencies<? extends ProcessingUnitDependency> detailedDependencies)
          Postpones deployment of processing unit instances until the specified dependencies are met.
 ElasticStatelessProcessingUnitDeployment addDependency(String requiredProcessingUnitName)
          Postpones deployment of processing unit instances deployment until the specified processing unit deployment is complete.
 ElasticStatelessProcessingUnitDeployment addEnvironmentVariable(String name, String value)
          Defines an environment variable that will be passed to forked process.
 ElasticStatelessProcessingUnitDeployment commandLineArgument(String vmInputArgument)
          Will add a JVM level argument when the process is executed using pure JVM.
 ElasticStatelessProcessingUnitConfig create()
          Converts this fluent API object to a lazy implementation of ProcessingUnitConfig
 ElasticStatelessProcessingUnitDeployment dedicatedMachineProvisioning(ElasticMachineProvisioningConfig config)
          Configure the server side bean that starts and stops machines automatically.
 ElasticStatelessProcessingUnitDeployment environmentVariable(String name, String value)
          Sets an environment variable that will be passed to forked process.
protected  ElasticStatelessProcessingUnitConfig getConfig()
           
 ElasticStatelessProcessingUnitDeployment 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")
 ElasticStatelessProcessingUnitDeployment memoryCapacityPerContainer(String memoryCapacityPerContainer)
          Specifies the the heap size per container (operating system process) For example: memoryCapacityPerContainer("256m") is equivalent to commandLineArgument("-Xmx256m").commandLineArgument("-Xms256m")
 ElasticStatelessProcessingUnitDeployment name(String name)
          Sets the processing unit name that will be deployed.
 ElasticStatelessProcessingUnitDeployment overrideCommandLineArguments()
          Will cause JVM options added using AbstractElasticProcessingUnitDeployment.commandLineArgument(String) to override all the vm arguments that the JVM will start by default with.
 ElasticStatelessProcessingUnitDeployment scale(AutomaticCapacityScaleConfig strategy)
          Enables the specified scale strategy, and disables all other scale strategies.
 ElasticStatelessProcessingUnitDeployment scale(EagerScaleConfig strategy)
          Enables the specified scale strategy, and disables all other scale strategies.
 ElasticStatelessProcessingUnitDeployment scale(ManualCapacityScaleConfig strategy)
          Enables the specified scale strategy, and disables all other scale strategies.
 ElasticStatelessProcessingUnitDeployment secured(boolean secured)
          Will deploy a secured processing unit.
 ElasticStatelessProcessingUnitDeployment setContextProperty(String key, String value)
          Deprecated. 
 ElasticStatelessProcessingUnitDeployment sharedMachineProvisioning(String sharingId, ElasticMachineProvisioningConfig config)
          Configure the server side bean that starts and stops machines automatically.
 ElasticStatelessProcessingUnitDeployment userDetails(String userName, String password)
          Advanced: Sets the security user details for authentication and authorization of the processing unit.
 ElasticStatelessProcessingUnitDeployment userDetails(UserDetails userDetails)
          Advanced: Sets the security user details for authentication and authorization of the processing unit.
 ElasticStatelessProcessingUnitDeployment 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, machineProvisioning, scale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElasticStatelessProcessingUnitDeployment

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


ElasticStatelessProcessingUnitDeployment

public ElasticStatelessProcessingUnitDeployment(File processingUnit)
Constructs a stateless 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

scale

public ElasticStatelessProcessingUnitDeployment 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

scale

public ElasticStatelessProcessingUnitDeployment 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 ElasticStatelessProcessingUnitDeployment scale(AutomaticCapacityScaleConfig strategy)
Description copied from interface: AutomaticCapacityScaleTopology
Enables the specified scale strategy, and disables all other scale strategies. Automatic scale, starts and stops containers to maintain monitored statistics between predefined thresholds. Scale strategies can also be reconfigured after deployment.

Specified by:
scale in interface AutomaticCapacityScaleTopology
See Also:
AutomaticCapacityScaleConfig, AutomaticCapacityScaleConfigurer

name

public ElasticStatelessProcessingUnitDeployment 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

setContextProperty

@Deprecated
public ElasticStatelessProcessingUnitDeployment setContextProperty(String key,
                                                                              String value)
Deprecated. 

See Also:
addContextProperty(String,String)

secured

public ElasticStatelessProcessingUnitDeployment 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 ElasticStatelessProcessingUnitDeployment 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 ElasticStatelessProcessingUnitDeployment 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 ElasticStatelessProcessingUnitDeployment 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 ElasticStatelessProcessingUnitDeployment 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 ElasticStatelessProcessingUnitDeployment 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

environmentVariable

public ElasticStatelessProcessingUnitDeployment 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

addCommandLineArgument

public ElasticStatelessProcessingUnitDeployment 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

addEnvironmentVariable

public ElasticStatelessProcessingUnitDeployment 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

addContextProperty

public ElasticStatelessProcessingUnitDeployment 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

dedicatedMachineProvisioning

public ElasticStatelessProcessingUnitDeployment 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
See Also:
ElasticDeploymentTopology.sharedMachineProvisioning(String, ElasticMachineProvisioningConfig)

sharedMachineProvisioning

public ElasticStatelessProcessingUnitDeployment 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)

memoryCapacityPerContainer

public ElasticStatelessProcessingUnitDeployment 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 ElasticStatelessProcessingUnitDeployment 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

addDependency

public ElasticStatelessProcessingUnitDeployment 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 ElasticStatelessProcessingUnitDeployment 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

getConfig

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

create

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

Specified by:
create in interface ProcessingUnitDeploymentTopology

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.