You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2017/10/11 23:03:35 UTC

[08/50] [abbrv] ambari git commit: AMBARI-14714. add new blueprint schema elements (magyari_sandor)

AMBARI-14714. add new blueprint schema elements (magyari_sandor)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1e90bd57
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1e90bd57
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1e90bd57

Branch: refs/heads/branch-feature-AMBARI-14714-ui
Commit: 1e90bd576a228bea77e4c41f110775af99083c73
Parents: 9c8ed58
Author: Sandor Magyari <sm...@hortonworks.com>
Authored: Fri Oct 6 18:27:31 2017 +0200
Committer: Sandor Magyari <sm...@hortonworks.com>
Committed: Fri Oct 6 18:29:06 2017 +0200

----------------------------------------------------------------------
 .../apache/ambari/server/topology/Service.java  | 81 ++++++++++++++++++++
 .../ambari/server/topology/ServiceGroup.java    | 67 ++++++++++++++++
 2 files changed, 148 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1e90bd57/ambari-server/src/main/java/org/apache/ambari/server/topology/Service.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/Service.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/Service.java
new file mode 100644
index 0000000..66c0dc3
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/Service.java
@@ -0,0 +1,81 @@
+/*
+ * 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.topology;
+
+
+import org.apache.ambari.server.controller.internal.Stack;
+
+import java.util.Set;
+
+public class Service {
+
+  private final String type;
+
+  private final String name;
+
+  private final Stack stack;
+
+  private final Configuration configuration;
+
+  private final Set<Service> dependentServices;
+
+  public Service(String type, Stack stack) {
+    this(type, null, stack, null, null);
+  }
+
+  /**
+   * In case there's no name specified name will be set to type.
+   * @param type
+   * @param name
+   * @param stack
+   * @param configuration
+   */
+  public Service(String type, String name, Stack stack, Configuration configuration, Set<Service> dependentServices) {
+    this.type = type;
+    if (name == null) {
+      this.name = type;
+    } else {
+      this.name = name;
+    }
+    this.stack = stack;
+    this.configuration = configuration;
+    this.dependentServices = dependentServices;
+  }
+
+  /**
+   * Gets the name of this service
+   *
+   * @return component name
+   */
+  public String getName() {
+    return this.name;
+  }
+
+  public String getType() {
+    return type;
+  }
+
+  public Stack getStack() {
+    return stack;
+  }
+
+  public Configuration getConfiguration() {
+    return configuration;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/1e90bd57/ambari-server/src/main/java/org/apache/ambari/server/topology/ServiceGroup.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/topology/ServiceGroup.java b/ambari-server/src/main/java/org/apache/ambari/server/topology/ServiceGroup.java
new file mode 100644
index 0000000..8e66f02
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/topology/ServiceGroup.java
@@ -0,0 +1,67 @@
+/*
+ * 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.topology;
+
+
+import java.util.Collection;
+import java.util.Set;
+
+public class ServiceGroup {
+
+  private final String name;
+
+  private final Collection<Service> services;
+
+  private final Configuration configuration;
+
+  private final Set<ServiceGroup> dependencies;
+
+  public ServiceGroup(String name, Collection<Service> services) {
+    this(name, services, null, null);
+  }
+
+  public ServiceGroup(String name, Collection<Service> services, Configuration configuration, Set<ServiceGroup> dependencies) {
+    this.name = name;
+    this.services = services;
+    this.configuration = configuration;
+    this.dependencies = dependencies;
+  }
+
+  /**
+   * Gets the name of this service group
+   *
+   * @return component name
+   */
+  public String getName() {
+    return this.name;
+  }
+
+
+  public Collection<Service> getServices() {
+    return services;
+  }
+
+  public Configuration getConfiguration() {
+    return configuration;
+  }
+
+  public Set<ServiceGroup> getDependencies() {
+    return dependencies;
+  }
+}