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

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

                Author: ASF GitHub Bot
            Created on: 28/Nov/23 21:55
            Start Date: 28/Nov/23 21:55
    Worklog Time Spent: 10m 
      Work Description: phet commented on code in PR #3838:
URL: https://github.com/apache/gobblin/pull/3838#discussion_r1408454577


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/dataset/ExternalDatasetDescriptor.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.ConfigValueFactory;
+import java.io.IOException;
+import java.util.ArrayList;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.ToString;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorConfigKeys;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorErrorUtils;
+import org.apache.gobblin.util.ConfigUtils;
+
+
+/**
+ * Describes a external dataset not on HDFS
+ * e.g, https://some-api:443/user/123/names where the path is the full URI
+ */
+@ToString (exclude = {"rawConfig"})
+@EqualsAndHashCode (exclude = {"rawConfig"}, callSuper = true)
+public class ExternalDatasetDescriptor extends BaseDatasetDescriptor 
implements DatasetDescriptor {
+
+  @Getter
+  private final String path;
+  @Getter
+  private final Config rawConfig;
+
+  public ExternalDatasetDescriptor(Config config) throws IOException {
+    super(config);
+    // refers to the full HTTP url
+    this.path = ConfigUtils.getString(config, 
DatasetDescriptorConfigKeys.PATH_KEY, "");
+    this.rawConfig = config.withValue(DatasetDescriptorConfigKeys.PATH_KEY, 
ConfigValueFactory.fromAnyRef(this.path)).withFallback(super.getRawConfig());
+    this.isInputDataset = ConfigUtils.getBoolean(config, 
DatasetDescriptorConfigKeys.IS_INPUT_DATASET, false);

Review Comment:
   if this is from the `BaseDatasetDescriptor`, doesn't initialization belong 
with the `super` ctor?



##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/dataset/ExternalDatasetDescriptor.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.ConfigValueFactory;
+import java.io.IOException;
+import java.util.ArrayList;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.ToString;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorConfigKeys;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorErrorUtils;
+import org.apache.gobblin.util.ConfigUtils;
+
+
+/**
+ * Describes a external dataset not on HDFS
+ * e.g, https://some-api:443/user/123/names where the path is the full URI

Review Comment:
   the concept of 'external' is vague (and only defined by negation--"not on 
HDFS").  is it about being remote?  is it about HTTP?  if so, must it be static 
(e.g. REST) or do we also cover hosted services (API invocations)?
   
   ...or is this more just a generic container meant to be open-ended and 
flexible?



##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/dataset/ExternalDatasetDescriptor.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.ConfigValueFactory;
+import java.io.IOException;
+import java.util.ArrayList;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.ToString;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorConfigKeys;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorErrorUtils;
+import org.apache.gobblin.util.ConfigUtils;
+
+
+/**
+ * Describes a external dataset not on HDFS
+ * e.g, https://some-api:443/user/123/names where the path is the full URI
+ */
+@ToString (exclude = {"rawConfig"})
+@EqualsAndHashCode (exclude = {"rawConfig"}, callSuper = true)
+public class ExternalDatasetDescriptor extends BaseDatasetDescriptor 
implements DatasetDescriptor {
+
+  @Getter
+  private final String path;
+  @Getter
+  private final Config rawConfig;
+
+  public ExternalDatasetDescriptor(Config config) throws IOException {
+    super(config);
+    // refers to the full HTTP url
+    this.path = ConfigUtils.getString(config, 
DatasetDescriptorConfigKeys.PATH_KEY, "");
+    this.rawConfig = config.withValue(DatasetDescriptorConfigKeys.PATH_KEY, 
ConfigValueFactory.fromAnyRef(this.path)).withFallback(super.getRawConfig());
+    this.isInputDataset = ConfigUtils.getBoolean(config, 
DatasetDescriptorConfigKeys.IS_INPUT_DATASET, false);
+  }
+
+  /**
+   * Check if this HTTP path equals the other HTTP path
+   *
+   * @param inputDatasetDescriptorConfig whose path should be in the format of 
a HTTP path
+   */
+  @Override
+  protected ArrayList<String> isPathContaining(DatasetDescriptor 
inputDatasetDescriptorConfig) {
+    // Might be null

Review Comment:
   agreed!  `null` check?



##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/dataset/ExternalDatasetDescriptor.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.ConfigValueFactory;
+import java.io.IOException;
+import java.util.ArrayList;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.ToString;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorConfigKeys;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorErrorUtils;
+import org.apache.gobblin.util.ConfigUtils;
+
+
+/**
+ * Describes a external dataset not on HDFS
+ * e.g, https://some-api:443/user/123/names where the path is the full URI
+ */
+@ToString (exclude = {"rawConfig"})
+@EqualsAndHashCode (exclude = {"rawConfig"}, callSuper = true)
+public class ExternalDatasetDescriptor extends BaseDatasetDescriptor 
implements DatasetDescriptor {
+
+  @Getter
+  private final String path;
+  @Getter
+  private final Config rawConfig;
+
+  public ExternalDatasetDescriptor(Config config) throws IOException {
+    super(config);
+    // refers to the full HTTP url
+    this.path = ConfigUtils.getString(config, 
DatasetDescriptorConfigKeys.PATH_KEY, "");
+    this.rawConfig = config.withValue(DatasetDescriptorConfigKeys.PATH_KEY, 
ConfigValueFactory.fromAnyRef(this.path)).withFallback(super.getRawConfig());
+    this.isInputDataset = ConfigUtils.getBoolean(config, 
DatasetDescriptorConfigKeys.IS_INPUT_DATASET, false);
+  }
+
+  /**
+   * Check if this HTTP path equals the other HTTP path
+   *
+   * @param inputDatasetDescriptorConfig whose path should be in the format of 
a HTTP path
+   */
+  @Override
+  protected ArrayList<String> isPathContaining(DatasetDescriptor 
inputDatasetDescriptorConfig) {

Review Comment:
   is the concept of input here the same as `this.isInputDataset`?  if so 
please document in javadoc; if not, suggest calling this `other`



##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/dataset/ExternalDatasetDescriptor.java:
##########
@@ -0,0 +1,66 @@
+/*
+ * 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.ConfigValueFactory;
+import java.io.IOException;
+import java.util.ArrayList;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.ToString;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorConfigKeys;
+import 
org.apache.gobblin.service.modules.flowgraph.DatasetDescriptorErrorUtils;
+import org.apache.gobblin.util.ConfigUtils;
+
+
+/**
+ * Describes a external dataset not on HDFS
+ * e.g, https://some-api:443/user/123/names where the path is the full URI
+ */
+@ToString (exclude = {"rawConfig"})
+@EqualsAndHashCode (exclude = {"rawConfig"}, callSuper = true)
+public class ExternalDatasetDescriptor extends BaseDatasetDescriptor 
implements DatasetDescriptor {
+
+  @Getter
+  private final String path;
+  @Getter
+  private final Config rawConfig;
+
+  public ExternalDatasetDescriptor(Config config) throws IOException {
+    super(config);
+    // refers to the full HTTP url
+    this.path = ConfigUtils.getString(config, 
DatasetDescriptorConfigKeys.PATH_KEY, "");

Review Comment:
   what does an empty path mean?  shouldn't it be required (not defaulting to 
`""`)?





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

    Worklog Id:     (was: 892762)
    Time Spent: 0.5h  (was: 20m)

> 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: 0.5h
>  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