sv2000 commented on a change in pull request #2882: [GOBBLIN-1042] Fix ForkMetric incorrect return type of parent metric object and relevant unit tests URL: https://github.com/apache/incubator-gobblin/pull/2882#discussion_r378594183
########## File path: gobblin-cluster/src/main/java/org/apache/gobblin/cluster/InMemoryWuSingleTask.java ########## @@ -0,0 +1,94 @@ +/* + * 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.cluster; + +import java.io.IOException; +import java.util.List; + +import org.apache.gobblin.configuration.ConfigurationKeys; +import org.apache.gobblin.runtime.JobState; +import org.apache.gobblin.runtime.util.StateStores; +import org.apache.gobblin.source.workunit.WorkUnit; +import org.apache.gobblin.writer.DataWriter; +import org.apache.gobblin.writer.DataWriterBuilder; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; + +import com.google.common.collect.Lists; +import com.typesafe.config.Config; + +/** + * Instead of deserializing {@link JobState} and {@link WorkUnit} from filesystem, create them in memory. + * Uses {@link DummyDataWriter} so that the execution of a Task goes through. + */ +public class InMemoryWuSingleTask extends InMemoryWuFailedSingleTask { Review comment: Perhaps better to not have a successful task extend a "meant-to-fail" task. If avoiding code duplication is the intention here, we can perhaps refactor the getJobState and getWorkUnits method of InMemoryWuFailedSingleTask to an abstract InMemorySingleTask class and have both failed/successful tasks extend the abstract class? ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services