avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject [34/35] avro git commit: AVRO-1907: Java: Add debug logging for invalid logical types.
Date Sat, 05 Nov 2016 20:20:51 GMT
AVRO-1907: Java: Add debug logging for invalid logical types.

Contributed by Gabor Szadovszky.


Project: http://git-wip-us.apache.org/repos/asf/avro/repo
Commit: http://git-wip-us.apache.org/repos/asf/avro/commit/16870af3
Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/16870af3
Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/16870af3

Branch: refs/heads/branch-1.8
Commit: 16870af3aa3abe5e2cdc8ccc48ba4ecf20f10f9c
Parents: b28f0d5
Author: Gabor Szadovszky <gabor.szadovszky@cloudera.com>
Authored: Mon Sep 26 13:44:25 2016 +0200
Committer: Ryan Blue <blue@apache.org>
Committed: Sat Nov 5 13:19:20 2016 -0700

----------------------------------------------------------------------
 CHANGES.txt                                                   | 3 +++
 .../java/avro/src/main/java/org/apache/avro/LogicalTypes.java | 7 +++++++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/avro/blob/16870af3/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index afe0922..06586a8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -31,6 +31,9 @@ Trunk (not yet released)
 
     AVRO-1918: Improve logical type documentation. (Gabor Szadovszky via cutting)
 
+    AVRO-1907: Java: Add debug logging for invalid logical types.
+    (Gabor Szadovszky via blue)
+
   BUG FIXES
 
     AVRO-1741: Python3: Fix error when codec is not in the header.

http://git-wip-us.apache.org/repos/asf/avro/blob/16870af3/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java
----------------------------------------------------------------------
diff --git a/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java b/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java
index fb8f17b..742b2fc 100644
--- a/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java
+++ b/lang/java/avro/src/main/java/org/apache/avro/LogicalTypes.java
@@ -21,8 +21,13 @@ package org.apache.avro;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
 public class LogicalTypes {
 
+  private static final Logger LOG = LoggerFactory.getLogger(LogicalTypes.class);
+
   public interface LogicalTypeFactory {
     LogicalType fromSchema(Schema schema);
   }
@@ -81,9 +86,11 @@ public class LogicalTypes {
         logicalType.validate(schema);
       }
     } catch (RuntimeException e) {
+      LOG.debug("Invalid logical type found", e);
       if (throwErrors) {
         throw e;
       }
+      LOG.warn("Ignoring invalid logical type for name: {}", typeName);
       // ignore invalid types
       logicalType = null;
     }


Mime
View raw message