Interface EPDeploymentService
- All Known Subinterfaces:
EPDeploymentServiceSPI
- All Known Implementing Classes:
EPDeploymentServiceImpl
public interface EPDeploymentService
Service for deploying and undeploying modules and obtaining information about current deployments and statements.
-
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.getDeployment
(String deploymentId) Returns the deployment.getDeploymentDependenciesConsumed
(String deploymentId) Obtain information about the dependencies that the given deployment has on other deployments, i.e.getDeploymentDependenciesProvided
(String deploymentId) 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
-
deploy
Deploy a compiled module and with the default options.- Parameters:
compiled
- byte code- Returns:
- deployment
- Throws:
EPDeployException
- when the deployment failed
-
deploy
EPDeployment deploy(com.espertech.esper.common.client.EPCompiled compiled, DeploymentOptions options) throws EPDeployException Deploy a compiled module and with the provided options.- Parameters:
compiled
- byte codeoptions
- deployment options- Returns:
- deployment
- Throws:
EPDeployException
- when the deployment failed
-
getDeployments
String[] getDeployments()Returns the deployment ids of all deployments.- Returns:
- deployment ids
-
undeploy
Undeploy a deployment and with the default options.- 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
Undeploy a deployment and with the provided options- 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
-
undeployAll
Undeploy all deployments and with the default options.Does not un-deploy staged deployments.
- Throws:
EPUndeployException
- when the undeployment failed, of the deployments may remain deployed
-
undeployAll
Undeploy all deployments and with the provided options.- Parameters:
options
- undeployment options or null if none provided- Throws:
EPUndeployException
- when the undeployment failed, of the deployments may remain deployed
-
getStatement
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.
- Parameters:
deploymentId
- deployment id of the statementstatementName
- statement name- Returns:
- statement or null if the statement could not be found
-
getDeployment
Returns the deployment.A deployment is uniquely identified by its deployment id.
- Parameters:
deploymentId
- the deployment id of the deployment- Returns:
- deployment or null if the deployment could not be found
-
addDeploymentStateListener
Add a deployment state listener- Parameters:
listener
- to add
-
removeDeploymentStateListener
Remove a deployment state listener- Parameters:
listener
- to remove
-
getDeploymentStateListeners
Iterator<DeploymentStateListener> getDeploymentStateListeners()Returns an iterator of deployment state listeners (read-only)- Returns:
- listeners
-
removeAllDeploymentStateListeners
void removeAllDeploymentStateListeners()Removes all deployment state listener -
isDeployed
Returns indicator whether a deployment for this deployment id exists- Parameters:
deploymentId
- deployment id- Returns:
- true for deployed, false for not deployed
-
rollout
Roll-out multiple deployments. Seerollout(Collection, RolloutOptions)
.- Parameters:
items
- compiled units and deployment options- Returns:
- deployment
- Throws:
EPDeployException
- when any of the deployments failed
-
rollout
EPDeploymentRollout rollout(Collection<EPDeploymentRolloutCompiled> items, RolloutOptions options) throws EPDeployException 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.
- Parameters:
items
- compiled units and deployment optionsoptions
- rollout options- Returns:
- deployment
- Throws:
EPDeployException
- when any of the deployments failed
-
getDeploymentDependenciesProvided
EPDeploymentDependencyProvided getDeploymentDependenciesProvided(String deploymentId) throws com.espertech.esper.common.client.EPException 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.- Parameters:
deploymentId
- deployment id- Returns:
- dependencies or null if the deployment is not found
- Throws:
com.espertech.esper.common.client.EPException
- when the required lock cannot be obtained
-
getDeploymentDependenciesConsumed
EPDeploymentDependencyConsumed getDeploymentDependenciesConsumed(String deploymentId) throws com.espertech.esper.common.client.EPException 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.- Parameters:
deploymentId
- deployment id- Returns:
- dependencies or null if the deployment is not found
- Throws:
com.espertech.esper.common.client.EPException
- when the required lock cannot be obtained
-