Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@
</commandScript>

<requiredServices>
<service>HDFS</service>
<service>
<name>HDFS</name>
<scope>INSTALL</scope>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename "scope" to "type" or "dependencyType"? We might end up adding scope in the future to scope to HOST,CLUSTER etc.

</service>
</requiredServices>

<configuration-dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@
</commandScript>

<requiredServices>
<service>HDFS</service>
<service>
<name>HDFS</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<configuration-dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,14 @@
<timeout>50</timeout>
</commandScript>
<requiredServices>
<service>HDFS</service>
<service>TEZ</service>
<service>
<name>HDFS</name>
<scope>INSTALL</scope>
</service>
<service>
<name>TEZ</name>
<scope>INSTALL</scope>
</service>
</requiredServices>
<configuration-dependencies>
<config-type>global</config-type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@
</commandScript>

<requiredServices>
<service>ZOOKEEPER</service>
<service>
<name>ZOOKEEPER</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<configuration-dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Set;

import org.apache.ambari.server.state.CustomCommandDefinition;
import org.apache.ambari.server.state.RequiredService;
import org.apache.ambari.server.state.ServiceInfo;

import io.swagger.annotations.ApiModelProperty;
Expand All @@ -48,7 +49,7 @@ public class StackServiceResponse {

private Set<String> excludedConfigTypes;

private List<String> requiredServices;
private List<RequiredService> requiredServices;

private Map<String, String> serviceProperties;

Expand Down Expand Up @@ -208,11 +209,11 @@ public Set<String> getExcludedConfigTypes() {
}

@ApiModelProperty(name = "required_services")
public List<String> getRequiredServices() {
public List<RequiredService> getRequiredServices() {
return requiredServices;
}

public void setRequiredServices(List<String> requiredServices) {
public void setRequiredServices(List<RequiredService> requiredServices) {
this.requiredServices = requiredServices;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.ambari.server.state;


import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;

/**
* Required service
* Is defined for some services in the service level metainfo.xml
* Specifies required service name and scope
*/
@XmlAccessorType(XmlAccessType.FIELD)
public class RequiredService {

public RequiredService() {
}

public RequiredService(String name) {
this.name = name;
}

public RequiredService(String name, Scope scope) {
this.name = name;
this.scope = scope;
}

/**
* Required service name
*/
private String name;
/**
* Required service scope
* By default is set to INSTALL
*/
private Scope scope = Scope.INSTALL;

public String getName() {
return name;
}

public Scope getScope() {
return scope;
}

/**
* Scope of the required service
* We could have an INSTALL time dependency (i.e. we should also install the dependent service)
* or a RUNTIME dependency (i.e. there should be a running instance of the service in the cluster)
*/
public enum Scope {
/**
* We should also install the dependent service. Is used as a default scope
*/
INSTALL,

/**
* There should be a running instance of the service in the cluster
*/
RUNTIME
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public void addErrors(Collection<String> errors) {

@XmlElementWrapper(name="requiredServices")
@XmlElement(name="service")
private List<String> requiredServices = new ArrayList<>();
private List<RequiredService> requiredServices = new ArrayList<>();

/**
* Meaning: stores subpath from stack root to exact directory, that contains
Expand Down Expand Up @@ -417,7 +417,7 @@ public String getComment() {
public void setComment(String comment) {
this.comment = comment;
}
public List<String> getRequiredServices() {
public List<RequiredService> getRequiredServices() {
return requiredServices;
}

Expand All @@ -437,7 +437,7 @@ public void setMetricsFileName(String metricsFileName) {
this.metricsFileName = metricsFileName;
}

public void setRequiredServices(List<String> requiredServices) {
public void setRequiredServices(List<RequiredService> requiredServices) {
this.requiredServices = requiredServices;
}
public List<PropertyInfo> getProperties() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,14 @@
</commandScript>

<requiredServices>
<service>ZOOKEEPER</service>
<service>HDFS</service>
<service>
<name>ZOOKEEPER</name>
<scope>INSTALL</scope>
</service>
<service>
<name>HDFS</name>
<scope>INSTALL</scope>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep a type=LEGACY for old stack definitions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's necessary, since for old stacks the LEGACY will be the same as the INSTALL type

</service>
</requiredServices>

<configuration-dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@
</commandScript>

<requiredServices>
<service>ZOOKEEPER</service>
<service>
<name>ZOOKEEPER</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<themes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,10 @@
</commandScript>

<requiredServices>
<service>ZOOKEEPER</service>
<service>
<name>ZOOKEEPER</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<configuration-dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
</quickLinksConfigurations>

<requiredServices>
<service>KAFKA</service>
<service>
<name>KAFKA</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<themes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@
</quickLinksConfigurations>

<requiredServices>
<service>KAFKA</service>
<service>
<name>KAFKA</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<themes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@
<timeout>300</timeout>
</commandScript>
<requiredServices>
<service>ZOOKEEPER</service>
<service>
<name>ZOOKEEPER</name>
<scope>INSTALL</scope>
</service>
</requiredServices>
<configuration-dependencies>
<config-type>druid-common</config-type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@
</commandScript>

<requiredServices>
<service>OOZIE</service>
<service>
<name>OOZIE</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<configuration-dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,10 @@
</components>

<requiredServices>
<service>HDFS</service>
<service>
<name>HDFS</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<osSpecifics>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,14 @@
</commandScript>

<requiredServices>
<service>ZOOKEEPER</service>
<service>HDFS</service>
<service>
<name>ZOOKEEPER</name>
<scope>INSTALL</scope>
</service>
<service>
<name>HDFS</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<configuration-dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,14 @@
</commandScript>

<requiredServices>
<service>ZOOKEEPER</service>
<service>HDFS</service>
<service>
<name>ZOOKEEPER</name>
<scope>INSTALL</scope>
</service>
<service>
<name>HDFS</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<configuration-dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,18 @@
</commandScript>

<requiredServices>
<service>ZOOKEEPER</service>
<service>YARN</service>
<service>TEZ</service>
<service>
<name>ZOOKEEPER</name>
<scope>INSTALL</scope>
</service>
<service>
<name>YARN</name>
<scope>INSTALL</scope>
</service>
<service>
<name>TEZ</name>
<scope>INSTALL</scope>
</service>
</requiredServices>

<configuration-dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,15 +487,30 @@
</quickLinksConfigurations>

<requiredServices>
<service>ZOOKEEPER</service>
<service>HDFS</service>
<service>YARN</service>
<service>TEZ</service>
<service>
<name>ZOOKEEPER</name>
<scope>INSTALL</scope>
</service>
<service>
<name>HDFS</name>
<scope>INSTALL</scope>
</service>
<service>
<name>YARN</name>
<scope>INSTALL</scope>
</service>
<service>
<name>TEZ</name>
<scope>INSTALL</scope>
</service>
<service>
<name>SLIDER</name>
<scope>INSTALL</scope>
</service>
<!-- TODO AMBARI-20753
Re-add after Pig service is being packaged.
<service>PIG</service>
-->
<service>SLIDER</service>
</requiredServices>

<configuration-dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
<timeout>300</timeout>
</commandScript>
<requiredServices>
<service>ZOOKEEPER</service>
<service>
<name>ZOOKEEPER</name>
<scope>INSTALL</scope>
</service>
</requiredServices>
<configuration-dependencies>
<config-type>kafka-broker</config-type>
Expand Down
Loading