[
https://issues.apache.org/jira/browse/GOBBLIN-772?focusedWorklogId=248142&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-248142
]
ASF GitHub Bot logged work on GOBBLIN-772:
------------------------------------------
Author: ASF GitHub Bot
Created on: 24/May/19 16:57
Start Date: 24/May/19 16:57
Worklog Time Spent: 10m
Work Description: autumnust commented on pull request #2637:
[GOBBLIN-772]Implement Schema Comparison Strategy during Disctp
URL: https://github.com/apache/incubator-gobblin/pull/2637#discussion_r287437052
##########
File path:
gobblin-data-management/src/main/java/org/apache/gobblin/util/schema_check/AvroSchemaCheckStrategy.java
##########
@@ -0,0 +1,55 @@
+/*
+ * 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.util.schema_check;
+
+import org.apache.avro.Schema;
+import org.apache.gobblin.configuration.ConfigurationKeys;
+import org.apache.gobblin.configuration.WorkUnitState;
+
+
+/**
+ * The strategy to compare Avro schema.
+ */
+public interface AvroSchemaCheckStrategy {
+ /**
+ * A factory to initiate the Strategy
+ */
+ class AvroSchemaCheckStrategyFactory {
+ /**
+ * Use the configuration to create a schema check strategy. If it's not
found, return null.
+ * @param state
+ * @return
+ */
+ public static AvroSchemaCheckStrategy create(WorkUnitState state)
+ {
+ try {
+ return (AvroSchemaCheckStrategy)
Class.forName(state.getProp(ConfigurationKeys.AVRO_SCHEMA_CHECK_STRATEGY,
ConfigurationKeys.AVRO_SCHEMA_CHECK_STRATEGY_DEFAULT)).newInstance();
+ } catch (Exception e)
+ {
+ return null;
Review comment:
Exception caught but not propagated/logged will be a silent failure which is
usually not what we wanted. If there's nothing (recovery type of thing) we
could do after catching the exception, let's just log the exception as a
starting point
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 248142)
Time Spent: 2h (was: 1h 50m)
> Implement Schema Comparison Strategy during Disctp
> --------------------------------------------------
>
> Key: GOBBLIN-772
> URL: https://issues.apache.org/jira/browse/GOBBLIN-772
> Project: Apache Gobblin
> Issue Type: Task
> Reporter: Zihan Li
> Priority: Major
> Time Spent: 2h
> Remaining Estimate: 0h
>
> We need a schema comparison strategy to make sure the real schema and the
> expected schema have matching field names and types.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)