[
https://issues.apache.org/jira/browse/GOBBLIN-1724?focusedWorklogId=817190&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-817190
]
ASF GitHub Bot logged work on GOBBLIN-1724:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 14/Oct/22 21:48
Start Date: 14/Oct/22 21:48
Worklog Time Spent: 10m
Work Description: AndyJiang99 commented on code in PR #3583:
URL: https://github.com/apache/gobblin/pull/3583#discussion_r996180142
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/flowgraph/SharedFlowGraphHelper.java:
##########
@@ -0,0 +1,126 @@
+/*
+ * 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.gobblin.service.modules.flowgraph;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Map;
+
+import org.apache.commons.io.FilenameUtils;
+import org.apache.hadoop.fs.Path;
+
+import com.google.common.base.Optional;
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+import com.typesafe.config.ConfigValueFactory;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.apache.gobblin.runtime.api.TopologySpec;
+import
org.apache.gobblin.service.modules.template_catalog.FSFlowTemplateCatalog;
+import org.apache.gobblin.util.ConfigUtils;
+import org.apache.gobblin.util.reflection.GobblinConstructorUtils;
+
+
+/**
+ * Supports a configuration of a flowgraph where it can support multiple
sub-flowgraphs within its directory
+ * Node definitions are shared between each subgraph, but can be overwritten
within the subgraph
+ * Edge definitions are only defined in the subgraphs
+ * e.g.
+ * /gobblin-flowgraph
+ * /subgraphA
+ * /nodeA
+ * /nodeB
+ * edgeAB.properties
+ * /subgraphB
+ * /nodeA
+ * /nodeB
+ * edgeAB.properties
+ * A.properties
+ * /nodes
+ * A.properties
+ * B.properties
+ */
+@Slf4j
+public class SharedFlowGraphHelper extends BaseFlowGraphHelper {
+
+ protected String sharedNodeFolder;
+ private static String NODE_FILE_SUFFIX = ".properties";
+ private static String SHARED_NODE_FOLDER_NAME = "nodes";
+ private static int NODE_FOLDER_DEPTH = 2;
Review Comment:
Same as above. Any reason why this number was chosen? As it looks to be
different from the BaseFlowGraph helper function depth value
Issue Time Tracking
-------------------
Worklog Id: (was: 817190)
Time Spent: 1h (was: 50m)
> Support a flowgraph layout for shared node configurations
> ---------------------------------------------------------
>
> Key: GOBBLIN-1724
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1724
> Project: Apache Gobblin
> Issue Type: Improvement
> Reporter: William Lo
> Priority: Major
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Currently the GaaS Flowgraph assumes that there will be one separate
> flowgraph for each configured use case, but this adds for a large amount of
> duplication when supporting multiple flowgraphs.
> We should support a layout where there can be a directory for shared nodes
> between each flowgraph, and each flowgraph can overwrite properties for these
> nodes if needed.
> e.g.
> {code:java}
> /flowgraph
> ../nodeA
> ..../nodeB
> ......edgeAB.properties
> ../nodeB
> ....nodeB.properties
> /nodes
> ..nodeA.properties
> ..nodeB.properties{code}
> Where nodeA will use the shared properties, and nodeB will use the union of
> the properties in /flowgraph and the shared properties.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)