You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@heron.apache.org by sa...@apache.org on 2022/07/19 19:46:58 UTC

[incubator-heron] branch saadurrahman/3846-Refactoring-K8s-Shim-dev updated (6c50e98092d -> 713f83faa6f)

This is an automated email from the ASF dual-hosted git repository.

saadurrahman pushed a change to branch saadurrahman/3846-Refactoring-K8s-Shim-dev
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


 discard 6c50e98092d [StatefulSet] added stubs for the Executor and Manager factory entry points.
     new 713f83faa6f [StatefulSet] added stubs for the Executor and Manager factory entry points.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (6c50e98092d)
            \
             N -- N -- N   refs/heads/saadurrahman/3846-Refactoring-K8s-Shim-dev (713f83faa6f)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/heron/scheduler/kubernetes/StatefulSet.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)


[incubator-heron] 01/01: [StatefulSet] added stubs for the Executor and Manager factory entry points.

Posted by sa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

saadurrahman pushed a commit to branch saadurrahman/3846-Refactoring-K8s-Shim-dev
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git

commit 713f83faa6ff0a15354667422c74cdb6de1f73ec
Author: Saad Ur Rahman <sa...@apache.org>
AuthorDate: Tue Jul 19 15:46:34 2022 -0400

    [StatefulSet] added stubs for the Executor and Manager factory entry points.
---
 .../heron/scheduler/kubernetes/StatefulSet.java    | 41 ++++++++++++++++++++--
 1 file changed, 38 insertions(+), 3 deletions(-)

diff --git a/heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/StatefulSet.java b/heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/StatefulSet.java
index ee763e97aea..4a1893918e1 100644
--- a/heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/StatefulSet.java
+++ b/heron/schedulers/src/java/org/apache/heron/scheduler/kubernetes/StatefulSet.java
@@ -27,14 +27,49 @@ import org.apache.heron.spi.packing.Resource;
 import io.kubernetes.client.openapi.models.V1StatefulSet;
 
 final class StatefulSet {
-  private final Map<String, StatefulSetFactory> statefulsets = new HashMap<>();
+  private final Map<Type, IStatefulSetFactory> statefulsets = new HashMap<>();
 
   public enum Type {
     Executor,
     Manager
   }
 
-  interface StatefulSetFactory {
-    V1StatefulSet create(Type type, Resource containerResources, int numberOfInstances);
+  private StatefulSet() {
+    statefulsets.put(Type.Executor, new ExecutorFactory());
+    statefulsets.put(Type.Manager, new ManagerFactory());
+  }
+
+  interface IStatefulSetFactory {
+    V1StatefulSet create(Resource containerResources, int numberOfInstances);
+  }
+
+  /**
+   * Creates configured <code>Executor</code> or <code>Manager</code> <code>Stateful Set</code>.
+   * @param type One of <code>Executor</code> or <code>Manager</code>
+   * @param containerResources The container system resource configurations.
+   * @param numberOfInstances The container count.
+   * @return Fully configured <code>Stateful Set</code> or <code>null</code> on invalid <code>type</code>.
+   */
+  V1StatefulSet create(Type type, Resource containerResources, int numberOfInstances) {
+    if (statefulsets.containsKey(type)) {
+      return statefulsets.get(type).create(containerResources, numberOfInstances);
+    }
+    return null;
+  }
+
+  static class ExecutorFactory implements IStatefulSetFactory {
+
+    @Override
+    public V1StatefulSet create(Resource containerResources, int numberOfInstances) {
+      return null;
+    }
+  }
+
+  static class ManagerFactory implements IStatefulSetFactory {
+
+    @Override
+    public V1StatefulSet create(Resource containerResources, int numberOfInstances) {
+      return null;
+    }
   }
 }