org.apache.s4.deploy
Class DistributedDeploymentManager
java.lang.Object
org.apache.s4.deploy.DistributedDeploymentManager
- All Implemented Interfaces:
- DeploymentManager
public class DistributedDeploymentManager
- extends java.lang.Object
- implements DeploymentManager
Monitors application availability on a given s4 cluster. Starts the application when available.
More specifically, this class observes the children of /<s4-cluster-name>/apps
. Children
correspond to S4 applications. A child's metadata contains a URI that refers to the s4r file that contains the s4
application code.
At startup, existing applications are loaded by, for each detected application:
- reading the associated URI
- fetching the s4r archive from that URI, through the protocol specified in the URI, and copying the s4r to a local
directory. Protocol handlers are not currently pluggable and must be implemented in this class.
- loading and starting the application
Then, whenever new app children are detected, the deployment manager re-executes the above steps for those new
applications
Field Summary |
static java.lang.String |
S4R_URI
|
Constructor Summary |
DistributedDeploymentManager(java.lang.String clusterName,
java.lang.String zookeeperAddress,
int sessionTimeout,
int connectionTimeout,
Server server)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
S4R_URI
public static final java.lang.String S4R_URI
- See Also:
- Constant Field Values
DistributedDeploymentManager
@Inject
public DistributedDeploymentManager(java.lang.String clusterName,
java.lang.String zookeeperAddress,
int sessionTimeout,
int connectionTimeout,
Server server)
deployApplication
public void deployApplication()
throws DeploymentFailedException
- Throws:
DeploymentFailedException
fetchS4App
public java.io.InputStream fetchS4App(java.net.URI uri)
throws DeploymentFailedException
- Throws:
DeploymentFailedException
start
public void start()
- Specified by:
start
in interface DeploymentManager