Package org.apache.ambari.server.state

Examples of org.apache.ambari.server.state.AutoDeployInfo


          if (dependency.getName().equals("HDFS/HDFS_CLIENT")) {
            Assert.assertEquals("host", dependency.getScope());
            Assert.assertEquals(true, dependency.getAutoDeploy().isEnabled());
          } else if (dependency.getName().equals("ZOOKEEPER/ZOOKEEPER_SERVER")) {
            Assert.assertEquals("cluster", dependency.getScope());
            AutoDeployInfo autoDeploy = dependency.getAutoDeploy();
            Assert.assertEquals(true, autoDeploy.isEnabled());
            Assert.assertEquals("HBASE/HBASE_MASTER", autoDeploy.getCoLocate());
          } else {
            Assert.fail("Unexpected dependency");
          }
        }
        // component auto deploy
View Full Code Here


      String name = component.getName();
      if (name.equals("HIVE_METASTORE")) {
        // dependencies
        Assert.assertEquals(0, component.getDependencies().size());
        // component auto deploy
        AutoDeployInfo autoDeploy = component.getAutoDeploy();
        Assert.assertTrue(autoDeploy.isEnabled());
        Assert.assertEquals("HIVE/HIVE_SERVER", autoDeploy.getCoLocate());
        // cardinality
        Assert.assertEquals("1", component.getCardinality());
      }
      if (name.equals("HIVE_SERVER")) {
        // dependencies
        List<DependencyInfo> dependencyList = component.getDependencies();
        Assert.assertEquals(1, dependencyList.size());
        DependencyInfo dependency = dependencyList.get(0);
        Assert.assertEquals("ZOOKEEPER/ZOOKEEPER_SERVER", dependency.getName());
        Assert.assertEquals("cluster", dependency.getScope());
        AutoDeployInfo autoDeploy = dependency.getAutoDeploy();
        Assert.assertTrue(autoDeploy.isEnabled());
        Assert.assertEquals("HIVE/HIVE_SERVER", autoDeploy.getCoLocate());
        // component auto deploy
        Assert.assertNull(component.getAutoDeploy());
        // cardinality
        Assert.assertEquals("1", component.getCardinality());
      }
      if (name.equals("MYSQL_SERVER")) {
        // dependencies
        Assert.assertEquals(0, component.getDependencies().size());
        // component auto deploy
        AutoDeployInfo autoDeploy = component.getAutoDeploy();
        Assert.assertTrue(autoDeploy.isEnabled());
        Assert.assertEquals("HIVE/HIVE_SERVER", autoDeploy.getCoLocate());
        // cardinality
        Assert.assertEquals("1", component.getCardinality());
      }
      if (name.equals("HIVE_CLIENT")) {
        Assert.assertEquals(0, component.getDependencies().size());
View Full Code Here

      }
      if (name.equals("HISTORYSERVER")) {
        // dependencies
        Assert.assertEquals(0, component.getDependencies().size());
        // component auto deploy
        AutoDeployInfo autoDeploy = component.getAutoDeploy();
        Assert.assertTrue(autoDeploy.isEnabled());
        Assert.assertEquals("MAPREDUCE/JOBTRACKER", autoDeploy.getCoLocate());
        // cardinality
        Assert.assertEquals("1", component.getCardinality());
      }
      if (name.equals("MAPREDUCE_CLIENT")) {
        // dependencies
View Full Code Here

      } else if (dependency.getName().equals("MAPREDUCE/MAPREDUCE_CLIENT")) {
        Assert.assertEquals("host", dependency.getScope());
        Assert.assertEquals(true, dependency.getAutoDeploy().isEnabled());
      } else if (dependency.getName().equals("ZOOKEEPER/ZOOKEEPER_SERVER")) {
        Assert.assertEquals("cluster", dependency.getScope());
        AutoDeployInfo autoDeploy = dependency.getAutoDeploy();
        Assert.assertEquals(true, autoDeploy.isEnabled());
        Assert.assertEquals("WEBHCAT/WEBHCAT_SERVER", autoDeploy.getCoLocate());
      }else if (dependency.getName().equals("ZOOKEEPER/ZOOKEEPER_CLIENT")) {
        Assert.assertEquals("host", dependency.getScope());
        Assert.assertEquals(true, dependency.getAutoDeploy().isEnabled());
      }else {
        Assert.fail("Unexpected dependency");
View Full Code Here

          response.isMaster(), requestedIds);

      setResourceProperty(resource, CARDINALITY_ID,
          response.getCardinality(), requestedIds);

      AutoDeployInfo autoDeployInfo = response.getAutoDeploy();
      if (autoDeployInfo != null) {
        setResourceProperty(resource, AUTO_DEPLOY_ENABLED_ID,
            autoDeployInfo.isEnabled(), requestedIds);

        if (autoDeployInfo.getCoLocate() != null) {
          setResourceProperty(resource, AUTO_DEPLOY_LOCATION_ID,
              autoDeployInfo.getCoLocate(), requestedIds);
        }
      }
      resources.add(resource);
    }
View Full Code Here

    setResourceProperty(resource, STACK_VERSION_ID, version, requestedIds);
    setResourceProperty(resource, DEPENDENT_SERVICE_NAME_ID, dependentService, requestedIds);
    setResourceProperty(resource, DEPENDENT_COMPONENT_NAME_ID, dependentComponent, requestedIds);
    setResourceProperty(resource, SCOPE_ID, dependency.getScope(), requestedIds);

    AutoDeployInfo autoDeployInfo = dependency.getAutoDeploy();
    if (autoDeployInfo != null) {
      setResourceProperty(resource, AUTO_DEPLOY_ENABLED_ID,
          autoDeployInfo.isEnabled(), requestedIds);

      if (autoDeployInfo.getCoLocate() != null) {
        setResourceProperty(resource, AUTO_DEPLOY_LOCATION_ID,
            autoDeployInfo.getCoLocate(), requestedIds);
      }
    }
    return resource;
  }
View Full Code Here

    Collection<String> cardinalityFailures = new HashSet<String>();
    for (String service : services) {
      for (String component : stack.getComponents(service)) {
        Cardinality cardinality = stack.getCardinality(component);
        AutoDeployInfo autoDeploy = stack.getAutoDeployInfo(component);
        if (cardinality.isAll()) {
          cardinalityFailures.addAll(verifyComponentInAllHostGroups(
              blueprint, hostGroups, component, autoDeploy));
        } else {
          cardinalityFailures.addAll(verifyComponentCardinalityCount(
View Full Code Here

        componentService.put(componentName, service);
        String cardinality = component.getCardinality();
        if (cardinality != null) {
          cardinalityRequirements.put(componentName, cardinality);
        }
        AutoDeployInfo autoDeploy = component.getAutoDeploy();
        if (autoDeploy != null) {
          componentAutoDeployInfo.put(componentName, autoDeploy);
        }

        // populate component dependencies
View Full Code Here

          }

          BlueprintEntity   entity          = hostGroup.getBlueprintEntity();
          String            dependencyScope = dependency.getScope();
          String            componentName   = dependency.getComponentName();
          AutoDeployInfo    autoDeployInfo  = dependency.getAutoDeploy();
          boolean           resolved        = false;

          if (dependencyScope.equals("cluster")) {
            Collection<String> missingDependencyInfo = verifyComponentCardinalityCount(entity, hostGroups,
                componentName, new Cardinality("1+"), autoDeployInfo, stack, clusterConfig);
            resolved = missingDependencyInfo.isEmpty();
          } else if (dependencyScope.equals("host")) {
            if (components.contains(component) || (autoDeployInfo != null && autoDeployInfo.isEnabled())) {
              resolved = true;
              if (addComponent(componentName)) {
                addComponentToBlueprint(hostGroup.getBlueprintEntity(), getEntity().getName(), componentName);
              }
            }
View Full Code Here

    Set<StackServiceComponentResponse> setServiceComponents = new HashSet<StackServiceComponentResponse>();
    setServiceComponents.add(stackServiceComponentResponse);
    setServiceComponents.add(stackServiceComponentResponse2);

    DependencyInfo dependencyInfo = new DependencyInfo();
    AutoDeployInfo autoDeployInfo = new AutoDeployInfo();
    autoDeployInfo.setEnabled(false);
    dependencyInfo.setAutoDeploy(autoDeployInfo);
    dependencyInfo.setScope("cluster");
    dependencyInfo.setName("test-service/component1");

    Map<String, ServiceInfo> services = new HashMap<String, ServiceInfo>();
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.state.AutoDeployInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.