[ 
https://issues.apache.org/jira/browse/GOBBLIN-1967?focusedWorklogId=892980&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-892980
 ]

ASF GitHub Bot logged work on GOBBLIN-1967:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 29/Nov/23 18:37
            Start Date: 29/Nov/23 18:37
    Worklog Time Spent: 10m 
      Work Description: umustafi commented on code in PR #3838:
URL: https://github.com/apache/gobblin/pull/3838#discussion_r1409711852


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/flowgraph/datanodes/ExternalDataNode.java:
##########
@@ -0,0 +1,27 @@
+package org.apache.gobblin.service.modules.flowgraph.datanodes;
+
+import com.typesafe.config.Config;
+import org.apache.gobblin.service.modules.dataset.ExternalDatasetDescriptor;
+import org.apache.gobblin.service.modules.flowgraph.BaseDataNode;
+
+
+/**
+ * A DataNode for generic ingress/egress data movement outside of HDFS (HTTP 
or otherwise)
+ */
+public class ExternalDataNode extends BaseDataNode {
+  public static final String EXTERNAL_PLATFORM_NAME = "external";

Review Comment:
   will we have child classes of this generic external datanode? will they 
override this platform name field?



##########
gobblin-service/src/test/java/org/apache/gobblin/service/modules/dataset/ExternalDatasetDescriptorTest.java:
##########
@@ -0,0 +1,53 @@
+/*
+ * 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.dataset;
+
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+import com.typesafe.config.ConfigValueFactory;
+import java.io.IOException;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorConfigKeys;
+import org.junit.Assert;
+import org.testng.annotations.Test;
+
+
+public class ExternalDatasetDescriptorTest {
+
+  @Test
+  public void testContains() throws IOException {
+    Config config1 = ConfigFactory.empty()
+        .withValue(DatasetDescriptorConfigKeys.PLATFORM_KEY, 
ConfigValueFactory.fromAnyRef("external"))
+        .withValue(DatasetDescriptorConfigKeys.PATH_KEY, 
ConfigValueFactory.fromAnyRef("https://a.com/b";));
+    ExternalDatasetDescriptor descriptor1 = new 
ExternalDatasetDescriptor(config1);
+
+    // Verify that same path points to same dataset
+    Config config2 = ConfigFactory.empty()
+        .withValue(DatasetDescriptorConfigKeys.PLATFORM_KEY, 
ConfigValueFactory.fromAnyRef("external"))
+        .withValue(DatasetDescriptorConfigKeys.PATH_KEY, 
ConfigValueFactory.fromAnyRef("https://a.com/b";));
+    ExternalDatasetDescriptor descriptor2 = new 
ExternalDatasetDescriptor(config2);
+    Assert.assertEquals(descriptor2.contains(descriptor1).size(), 0);
+
+    // Verify that same path but different platform points to different dataset

Review Comment:
   comment should be same platform but diff path



##########
gobblin-service/src/test/java/org/apache/gobblin/service/modules/dataset/ExternalDatasetDescriptorTest.java:
##########
@@ -0,0 +1,53 @@
+/*
+ * 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.dataset;
+
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+import com.typesafe.config.ConfigValueFactory;
+import java.io.IOException;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorConfigKeys;
+import org.junit.Assert;
+import org.testng.annotations.Test;
+
+
+public class ExternalDatasetDescriptorTest {
+
+  @Test
+  public void testContains() throws IOException {
+    Config config1 = ConfigFactory.empty()
+        .withValue(DatasetDescriptorConfigKeys.PLATFORM_KEY, 
ConfigValueFactory.fromAnyRef("external"))
+        .withValue(DatasetDescriptorConfigKeys.PATH_KEY, 
ConfigValueFactory.fromAnyRef("https://a.com/b";));
+    ExternalDatasetDescriptor descriptor1 = new 
ExternalDatasetDescriptor(config1);
+
+    // Verify that same path points to same dataset
+    Config config2 = ConfigFactory.empty()
+        .withValue(DatasetDescriptorConfigKeys.PLATFORM_KEY, 
ConfigValueFactory.fromAnyRef("external"))
+        .withValue(DatasetDescriptorConfigKeys.PATH_KEY, 
ConfigValueFactory.fromAnyRef("https://a.com/b";));
+    ExternalDatasetDescriptor descriptor2 = new 
ExternalDatasetDescriptor(config2);
+    Assert.assertEquals(descriptor2.contains(descriptor1).size(), 0);

Review Comment:
   why do we use contains here rather than equality?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 892980)
    Time Spent: 1h  (was: 50m)

> Add data node for generic external ingress egress
> -------------------------------------------------
>
>                 Key: GOBBLIN-1967
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1967
>             Project: Apache Gobblin
>          Issue Type: Improvement
>          Components: gobblin-service
>            Reporter: William Lo
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> GaaS has datanodes for HTTP, SFTP, and HDFS/Table varients. However, in some 
> scenarios we want a generic identifier for an external ingress/egress flow 
> running in GaaS. Reason being is that there are some usecases that can be 
> very generic and we want to avoid adapting these flows to the opinionated 
> setup of GaaS, while maintaining compatibility.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to