You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/11/04 19:07:01 UTC

[jira] [Work logged] (GOBBLIN-897) Implement Local FS Spec Executor

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

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

                Author: ASF GitHub Bot
            Created on: 04/Nov/19 19:06
            Start Date: 04/Nov/19 19:06
    Worklog Time Spent: 10m 
      Work Description: zxcware commented on pull request #2755: [GOBBLIN-897] adds local FS spec executor to write jobs to a local dir
URL: https://github.com/apache/incubator-gobblin/pull/2755#discussion_r342205669
 
 

 ##########
 File path: gobblin-runtime/src/main/java/org/apache/gobblin/runtime/spec_executorInstance/LocalFsSpecProducer.java
 ##########
 @@ -0,0 +1,106 @@
+/*
+ * 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.spec_executorInstance;
+
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.typesafe.config.Config;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.Future;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.gobblin.runtime.api.JobSpec;
+import org.apache.gobblin.runtime.api.Spec;
+import org.apache.gobblin.runtime.api.SpecExecutor;
+import org.apache.gobblin.runtime.api.SpecProducer;
+import org.apache.gobblin.util.CompletedFuture;
+import org.apache.gobblin.util.ConfigUtils;
+
+
+/**
+ * An implementation of {@link SpecProducer} that produces {@link JobSpec}s to the {@value #LOCAL_FS_PRODUCER_PATH_KEY}
+ */
+@Slf4j
+public class LocalFsSpecProducer implements SpecProducer<Spec> {
+  private String specProducerPath;
+  public static final String LOCAL_FS_PRODUCER_PATH_KEY = "gobblin.cluster.localSpecProducer.dir";
+
+  public LocalFsSpecProducer(Config config) {
+    this.specProducerPath = ConfigUtils.getString(config, LOCAL_FS_PRODUCER_PATH_KEY, "");
+    Preconditions.checkArgument(!Strings.isNullOrEmpty(this.specProducerPath), "Missing argument: " + LOCAL_FS_PRODUCER_PATH_KEY);
+    File parentDir = new File(specProducerPath);
+    if (!parentDir.exists()) {
+      if (parentDir.mkdirs()) {
 
 Review comment:
   Failure handling on `mkdirs`
 
----------------------------------------------------------------
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


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

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

> Implement Local FS Spec Executor
> --------------------------------
>
>                 Key: GOBBLIN-897
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-897
>             Project: Apache Gobblin
>          Issue Type: New Feature
>          Components: gobblin-core, gobblin-service
>    Affects Versions: 0.15.0
>            Reporter: William Lo
>            Assignee: Abhishek Tiwari
>            Priority: Major
>             Fix For: 0.15.0
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)