You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2020/06/16 14:35:50 UTC

[GitHub] [incubator-gobblin] sv2000 commented on a change in pull request #3042: [GOBBLIN-1196] search flow configs using flow properties and/or other parameters

sv2000 commented on a change in pull request #3042:
URL: https://github.com/apache/incubator-gobblin/pull/3042#discussion_r440893024



##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/FlowSpec.java
##########
@@ -411,5 +419,43 @@ public static String getFlowGroup(URI flowUri) {
       }
       return uriTokens[EXPECTED_NUM_URI_PATH_TOKENS - 2];
     }
+
+    public static FlowConfig toFlowConfig(Spec spec) {

Review comment:
       Add javadoc here.

##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/api/SpecSearchObject.java
##########
@@ -0,0 +1,24 @@
+/*
+ * 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.runtime.api;
+
+/**
+ * This is an interface to package all the parameters that should be used to search {@link Spec} in a {@link SpecStore}
+ */
+public interface SpecSearchObject {

Review comment:
       Why define an empty interface?

##########
File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_catalog/FlowCatalog.java
##########
@@ -269,23 +270,40 @@ public boolean exists(URI uri) {
   }
 
   @Override
-  public Spec getSpec(URI uri) throws SpecNotFoundException {
+  public Spec getSpecs(URI uri) throws SpecNotFoundException {
     try {
       return specStore.getSpec(uri);
     } catch (IOException e) {
       throw new RuntimeException("Cannot retrieve Spec from Spec store for URI: " + uri, e);
     }
   }
 
+  @Override
+  public Collection<Spec> getSpecs(SpecSearchObject specSearchObject) {
+    try {
+      return specStore.getSpecs(specSearchObject);
+    } catch (IOException e) {
+      throw new RuntimeException("Cannot retrieve Spec from Spec store for URI: " + specSearchObject, e);
+    }
+  }
+
+  public Collection<Spec> getAllSpecs() {
+    try {
+      return specStore.getSpecs();

Review comment:
       An option to consider: GobblinServiceScheduler already caches all the specs in memory. So we should be able to avoid going to the SpecStore to retrieve all the specs each time getAllSpecs() is invoked. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org