Skip to content

Streams Instance Manager

Rohit Wagle edited this page Aug 20, 2014 · 5 revisions

Each Streams Instance is encapsulated within a Streams Instance Manager object. It is in charge of starting all Streams services for that instance. It exposes multiple interfaces that abstract away Streams instance management from cluster manager specific artefacts. In essence, this encapsulation allows the same Streams Instance Manager to work with other cluster managers, such as Apache Mesos, along with Apache YARN.

Download Link

Here

ICommand

Represents the command that needs to be executed on a container along with its environment variables.

  1. Map<String, String> getEnvironmentVariables(): Returns the environment variables for the command
  2. List<String> getCommand(): Returns the command to execute

IContainer

Basic interface that represents a container type.

Container State: NEW, ASSIGNED, DEPLOYING, RUNNING, STOPPING, STOPPED

  1. ICommand getStartupCommand(): Returns the command to execute in this container
  2. long getId(): Returns the container ID
  3. String getHost(): Returns the hostname for the machine on which this container resides
  4. State getState(): Returns the current state of the container
  5. State getPreviousState(): Returns the previous state of the container

Container

Helper class that implements the IContainer interface. We expect that most cluster managers will directly use this class without the need to implement the IContainer interface.

ServiceType

Streams Service type: NSR, SAM, SRM, SCH, AAS, SWS, HC

IContainerRequest

Encapsulates a container request.

  1. long getId(): Returns the ID of the request
  2. List<String> getHost(): Returns the list of hosts on which the container must reside
  3. ServiceType getServiceType(): Returns the type of the associated Streams service
  4. setAssignedContainer(IContainer container): Sets the container for this request
  5. String getInstanceId(): Returns the ID of the associated instance

IContainerManager

Needs to be implemented by each cluster manager to enable container management:

  1. requestContainer(IContainerRequest request): Requests a container from the cluster manager
  2. deployContainer(IContainer container): Deploys an assigned container
  3. stopContainer(IContainer container): Stops a deployed container
  4. releaseContainer(IContainer container): Releases a container back to the cluster manager