Class EPDeploymentServiceImpl
java.lang.Object
com.espertech.esper.runtime.internal.kernel.service.EPDeploymentServiceImpl
- All Implemented Interfaces:
EPDeploymentService
,EPDeploymentServiceSPI
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a deployment state listenerdeploy
(com.espertech.esper.common.client.EPCompiled compiled) Deploy a compiled module and with the default options.deploy
(com.espertech.esper.common.client.EPCompiled compiled, DeploymentOptions options) Deploy a compiled module and with the provided options.void
destroy()
getDeployment
(String deploymentId) Returns the deployment.getDeploymentDependenciesConsumed
(String selfDeploymentId) Obtain information about the dependencies that the given deployment has on other deployments, i.e.getDeploymentDependenciesProvided
(String selfDeploymentId) Obtain information about other deployments that are depending on the given deployment, i.e.String[]
Returns the deployment ids of all deployments.Returns an iterator of deployment state listeners (read-only)getStatement
(String deploymentId, String statementName) Returns the statement of a given deployment.boolean
isDeployed
(String deploymentId) Returns indicator whether a deployment for this deployment id existsvoid
Removes all deployment state listenervoid
Remove a deployment state listenerRoll-out multiple deployments.rollout
(Collection<EPDeploymentRolloutCompiled> items, RolloutOptions options) Roll-out multiple deployments.void
Undeploy a deployment and with the default options.void
undeploy
(String deploymentId, UndeploymentOptions options) Undeploy a deployment and with the provided optionsvoid
Undeploy all deployments and with the default options.void
undeployAll
(UndeploymentOptions options) Undeploy all deployments and with the provided options.
-
Method Details
-
rollout
public EPDeploymentRollout rollout(Collection<EPDeploymentRolloutCompiled> items) throws EPDeployException Description copied from interface:EPDeploymentService
Roll-out multiple deployments. SeeEPDeploymentService.rollout(Collection, RolloutOptions)
.- Specified by:
rollout
in interfaceEPDeploymentService
- Parameters:
items
- compiled units and deployment options- Returns:
- deployment
- Throws:
EPDeployException
- when any of the deployments failed
-
rollout
public EPDeploymentRollout rollout(Collection<EPDeploymentRolloutCompiled> items, RolloutOptions options) throws EPDeployException Description copied from interface:EPDeploymentService
Roll-out multiple deployments.Deploys each compiled module, either deploying all compilation units or deploying none of the compilation units.
Does not reorder compilation units and expects compilation units to be ordered according to module dependencies (if any).
The step-by-step is as allows:
- For each compilation unit, determine the deployment id or use the deployment id when provided in the deployment options; Check that all deployment ids do not already exist
- For each compilation unit, load compilation unit via classloader and validate basic class-related information such as manifest information and version
- For each compilation unit, check deployment preconditions and resolve deployment dependencies on EPL objects
- For each compilation unit, initialize statement-internal objects
- For each compilation unit, perform internal deployment of each statement of each module
In case any of the above steps fail the runtime completely rolls back all changes.
- Specified by:
rollout
in interfaceEPDeploymentService
- Parameters:
items
- compiled units and deployment optionsoptions
- rollout options- Returns:
- deployment
- Throws:
EPDeployException
- when any of the deployments failed
-
deploy
public EPDeployment deploy(com.espertech.esper.common.client.EPCompiled compiled) throws EPDeployException Description copied from interface:EPDeploymentService
Deploy a compiled module and with the default options.- Specified by:
deploy
in interfaceEPDeploymentService
- Parameters:
compiled
- byte code- Returns:
- deployment
- Throws:
EPDeployException
- when the deployment failed
-
deploy
public EPDeployment deploy(com.espertech.esper.common.client.EPCompiled compiled, DeploymentOptions options) throws EPDeployException Description copied from interface:EPDeploymentService
Deploy a compiled module and with the provided options.- Specified by:
deploy
in interfaceEPDeploymentService
- Parameters:
compiled
- byte codeoptions
- deployment options- Returns:
- deployment
- Throws:
EPDeployException
- when the deployment failed
-
getStatement
Description copied from interface:EPDeploymentService
Returns the statement of a given deployment.A statement is uniquely identified by the deployment id that deployed the statement and by the statement name.
- Specified by:
getStatement
in interfaceEPDeploymentService
- Parameters:
deploymentId
- deployment id of the statementstatementName
- statement name- Returns:
- statement or null if the statement could not be found
-
getDeployments
Description copied from interface:EPDeploymentService
Returns the deployment ids of all deployments.- Specified by:
getDeployments
in interfaceEPDeploymentService
- Returns:
- deployment ids
-
getDeploymentMap
- Specified by:
getDeploymentMap
in interfaceEPDeploymentServiceSPI
-
getDeployment
Description copied from interface:EPDeploymentService
Returns the deployment.A deployment is uniquely identified by its deployment id.
- Specified by:
getDeployment
in interfaceEPDeploymentService
- Parameters:
deploymentId
- the deployment id of the deployment- Returns:
- deployment or null if the deployment could not be found
-
isDeployed
Description copied from interface:EPDeploymentService
Returns indicator whether a deployment for this deployment id exists- Specified by:
isDeployed
in interfaceEPDeploymentService
- Parameters:
deploymentId
- deployment id- Returns:
- true for deployed, false for not deployed
-
undeployAll
Description copied from interface:EPDeploymentService
Undeploy all deployments and with the default options.Does not un-deploy staged deployments.
- Specified by:
undeployAll
in interfaceEPDeploymentService
- Throws:
EPUndeployException
- when the undeployment failed, of the deployments may remain deployed
-
undeployAll
Description copied from interface:EPDeploymentService
Undeploy all deployments and with the provided options.- Specified by:
undeployAll
in interfaceEPDeploymentService
- Parameters:
options
- undeployment options or null if none provided- Throws:
EPUndeployException
- when the undeployment failed, of the deployments may remain deployed
-
undeploy
Description copied from interface:EPDeploymentService
Undeploy a deployment and with the default options.- Specified by:
undeploy
in interfaceEPDeploymentService
- Parameters:
deploymentId
- of the deployment to undeploy- Throws:
EPUndeployException
- when the deployment does not exist or the undeployment failed and the deployment remains deployed
-
undeploy
Description copied from interface:EPDeploymentService
Undeploy a deployment and with the provided options- Specified by:
undeploy
in interfaceEPDeploymentService
- Parameters:
deploymentId
- of the deployment to undeployoptions
- undeployment options- Throws:
EPUndeployException
- when the deployment does not exist or the undeployment failed and the deployment remains deployed
-
destroy
public void destroy()- Specified by:
destroy
in interfaceEPDeploymentServiceSPI
-
addDeploymentStateListener
Description copied from interface:EPDeploymentService
Add a deployment state listener- Specified by:
addDeploymentStateListener
in interfaceEPDeploymentService
- Parameters:
listener
- to add
-
removeDeploymentStateListener
Description copied from interface:EPDeploymentService
Remove a deployment state listener- Specified by:
removeDeploymentStateListener
in interfaceEPDeploymentService
- Parameters:
listener
- to remove
-
getDeploymentStateListeners
Description copied from interface:EPDeploymentService
Returns an iterator of deployment state listeners (read-only)- Specified by:
getDeploymentStateListeners
in interfaceEPDeploymentService
- Returns:
- listeners
-
removeAllDeploymentStateListeners
public void removeAllDeploymentStateListeners()Description copied from interface:EPDeploymentService
Removes all deployment state listener- Specified by:
removeAllDeploymentStateListeners
in interfaceEPDeploymentService
-
getDeploymentDependenciesProvided
Description copied from interface:EPDeploymentService
Obtain information about other deployments that are depending on the given deployment, i.e. EPL objects that this deployment provides to other deployments. This method acquires the runtime-wide event processing read lock for the duration. Does not return dependencies on predefined EPL objects such as configured event types or variables. Does not return deployment-internal dependencies i.e. dependencies on EPL objects that are defined by the same deployment.- Specified by:
getDeploymentDependenciesProvided
in interfaceEPDeploymentService
- Parameters:
selfDeploymentId
- deployment id- Returns:
- dependencies or null if the deployment is not found
-
getDeploymentDependenciesConsumed
Description copied from interface:EPDeploymentService
Obtain information about the dependencies that the given deployment has on other deployments, i.e. EPL objects that this deployment consumes from other deployments. This method acquires the runtime-wide event processing read lock for the duration. Does not return dependencies on predefined EPL objects such as configured event types or variables. Does not return deployment-internal dependencies i.e. dependencies on EPL objects that are defined by the same deployment.- Specified by:
getDeploymentDependenciesConsumed
in interfaceEPDeploymentService
- Parameters:
selfDeploymentId
- deployment id- Returns:
- dependencies or null if the deployment is not found
-