Package org.apache.ambari.server.state

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


      }
      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
View Full Code Here


  public void testGetResources() throws SystemException, UnsupportedPropertyException,
      NoSuchParentResourceException, NoSuchResourceException, AmbariException {

    Request request = createNiceMock(Request.class);

    DependencyInfo dependencyInfo = new DependencyInfo();
    dependencyInfo.setName("service_name/comp_name");
    dependencyInfo.setScope("cluster");

    Predicate namePredicate = new EqualsPredicate<String>(
        StackDependencyResourceProvider.COMPONENT_NAME_ID, "comp_name");
    Predicate depServicePredicate = new EqualsPredicate<String>(
        StackDependencyResourceProvider.DEPENDENT_SERVICE_NAME_ID, "dep_service_name");
View Full Code Here

  public void testGetResources_Query() throws SystemException, UnsupportedPropertyException,
      NoSuchParentResourceException, NoSuchResourceException, AmbariException {

    Request request = createNiceMock(Request.class);

    DependencyInfo dependencyInfo = new DependencyInfo();
    dependencyInfo.setName("service_name/comp_name");
    dependencyInfo.setScope("cluster");

    Predicate namePredicate = new EqualsPredicate<String>(
        StackDependencyResourceProvider.COMPONENT_NAME_ID, "comp_name");
    Predicate name2Predicate = new EqualsPredicate<String>(
        StackDependencyResourceProvider.COMPONENT_NAME_ID, "comp_name2");
View Full Code Here

   * @throws AmbariException if unable to obtain the requested dependency
   */
  public DependencyInfo getComponentDependency(String stackName, String version, String service,
                                               String component, String dependencyName) throws AmbariException {

    DependencyInfo foundDependency = null;
    List<DependencyInfo> componentDependencies = getComponentDependencies(
        stackName, version, service, component);
    Iterator<DependencyInfo> iter = componentDependencies.iterator();
    while (foundDependency == null && iter.hasNext()) {
      DependencyInfo dependency = iter.next();
      if (dependencyName.equals(dependency.getComponentName())) {
        foundDependency = dependency;
      }
    }
    if (foundDependency == null) {
      throw new StackAccessException("stackName=" + stackName
View Full Code Here

    StackServiceComponentResponse stackServiceComponentResponse2 = createNiceMock(StackServiceComponentResponse.class);
    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>();
    ServiceInfo service = new ServiceInfo();
    service.setName("test-service");
    services.put("test-service", service);
View Full Code Here

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

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

    Map<String, ServiceInfo> services = new HashMap<String, ServiceInfo>();
    ServiceInfo service = new ServiceInfo();
    service.setName("test-service");
    services.put("test-service", service);
View Full Code Here

      }
      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
View Full Code Here

    }
  }

  @Test
  public void testGetComponentDependency() throws AmbariException {
    DependencyInfo dependency = metaInfo.getComponentDependency("HDP", "1.3.4", "HIVE", "HIVE_SERVER", "ZOOKEEPER_SERVER");
    assertEquals("ZOOKEEPER/ZOOKEEPER_SERVER", dependency.getName());
    assertEquals("ZOOKEEPER_SERVER", dependency.getComponentName());
    assertEquals("ZOOKEEPER", dependency.getServiceName());
    assertEquals("cluster", dependency.getScope());
  }
View Full Code Here

  @Test
  public void testGetComponentDependencies() throws AmbariException {
    List<DependencyInfo> dependencies = metaInfo.getComponentDependencies("HDP", "1.3.4", "HBASE", "HBASE_MASTER");
    assertEquals(2, dependencies.size());

    DependencyInfo dependency = dependencies.get(0);
    assertEquals("HDFS/HDFS_CLIENT", dependency.getName());
    assertEquals("HDFS_CLIENT", dependency.getComponentName());
    assertEquals("HDFS", dependency.getServiceName());
    assertEquals("host", dependency.getScope());

    dependency = dependencies.get(1);
    assertEquals("ZOOKEEPER/ZOOKEEPER_SERVER", dependency.getName());
    assertEquals("ZOOKEEPER_SERVER", dependency.getComponentName());
    assertEquals("ZOOKEEPER", dependency.getServiceName());
    assertEquals("cluster", dependency.getScope());
  }
View Full Code Here

      }
      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
View Full Code Here

TOP

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

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.