Package org.apache.ambari.server.state

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


    Map<String, ServiceInfo> services = getServices(stackName, version);

    if (services.size() == 0)
      throw new StackAccessException("stackName=" + stackName + ", stackVersion=" + version + ", serviceName=" + serviceName);

    ServiceInfo serviceInfo = services.get(serviceName);

    if (serviceInfo == null)
      throw new StackAccessException("stackName=" + stackName + ", stackVersion=" + version + ", serviceName=" + serviceName);

    return serviceInfo;
View Full Code Here


  }

  public ServiceInfo getServiceInfo(String stackName, String version,
                                    String serviceName) throws AmbariException {
    ServiceInfo serviceInfoResult = null;
    List<ServiceInfo> services;
    StackInfo stack;
    try {
      stack = getStackInfo(stackName, version);
    } catch (StackAccessException e) {
View Full Code Here

  }

  public Set<PropertyInfo> getProperties(String stackName, String version, String serviceName)
      throws AmbariException {

    ServiceInfo serviceInfo = getServiceInfo(stackName, version, serviceName);
    List<PropertyInfo> properties = serviceInfo.getProperties();
    Set<PropertyInfo> propertiesResult = new HashSet<PropertyInfo>(properties);

    return propertiesResult;
  }
View Full Code Here

   */
  public List<MetricDefinition> getMetrics(String stackName, String stackVersion,
      String serviceName, String componentName, String metricType)
  throws AmbariException {

    ServiceInfo svc = getService(stackName, stackVersion, serviceName);

    if (null == svc.getMetricsFile() || !svc.getMetricsFile().exists()) {
      LOG.debug("Metrics file for " + stackName + "/" + stackVersion + "/" + serviceName + " not found.");
      return null;
    }

    Map<String, Map<String, List<MetricDefinition>>> map = svc.getMetrics();

    // check for cached
    if (null == map) {
      // data layout:
      // "DATANODE" -> "Component" -> [ MetricDefinition, MetricDefinition, ... ]
      //           \-> "HostComponent" -> [ MetricDefinition, ... ]
      Type type = new TypeToken<Map<String, Map<String, List<MetricDefinition>>>>(){}.getType();

      Gson gson = new Gson();

      try {
        map = gson.fromJson(new FileReader(svc.getMetricsFile()), type);

        svc.setMetrics(map);

      } catch (Exception e) {
        LOG.error ("Could not read the metrics file", e);
        throw new AmbariException("Could not read metrics file", e);
      }
View Full Code Here

    AmbariManagementController managementController = createMock(AmbariManagementController.class);
    Request request = createMock(Request.class);
    Capture<Set<StackServiceRequest>> stackServiceRequestCapture = new Capture<Set<StackServiceRequest>>();

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

    List<ComponentInfo> serviceComponents = new ArrayList<ComponentInfo>();
    ComponentInfo component1 = new ComponentInfo();
    component1.setName("component1");
View Full Code Here

    AmbariManagementController managementController = createMock(AmbariManagementController.class);
    Request request = createMock(Request.class);

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

    List<ComponentInfo> serviceComponents = new ArrayList<ComponentInfo>();
    ComponentInfo component1 = new ComponentInfo();
    component1.setName("component1");
View Full Code Here

    AmbariManagementController managementController = createMock(AmbariManagementController.class);
    Capture<Set<StackServiceRequest>> stackServiceRequestCapture = new Capture<Set<StackServiceRequest>>();
    Request request = createMock(Request.class);

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

    List<ComponentInfo> serviceComponents = new ArrayList<ComponentInfo>();
    ComponentInfo component1 = new ComponentInfo();
    component1.setName("component1");
View Full Code Here

      SystemException, UnsupportedPropertyException, NoSuchParentResourceException
  {
    Request request = createMock(Request.class);

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

    List<ComponentInfo> serviceComponents = new ArrayList<ComponentInfo>();
    ComponentInfo component1 = new ComponentInfo();
    component1.setName("component1");
View Full Code Here

      SystemException, UnsupportedPropertyException, NoSuchParentResourceException
  {
    Request request = createMock(Request.class);

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

    List<ComponentInfo> serviceComponents = new ArrayList<ComponentInfo>();
    ComponentInfo component1 = new ComponentInfo();
    component1.setName("component1");
View Full Code Here

      SystemException, UnsupportedPropertyException, NoSuchParentResourceException
  {
    Request request = createMock(Request.class);

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

    List<ComponentInfo> serviceComponents = new ArrayList<ComponentInfo>();
    ComponentInfo component1 = new ComponentInfo();
    component1.setName("component1");
View Full Code Here

TOP

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

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.