parquet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tians...@apache.org
Subject parquet-mr git commit: PARQUET-273 : remove usage of ReflectiveOperationException to support JAVA6
Date Tue, 12 May 2015 18:17:23 GMT
Repository: parquet-mr
Updated Branches:
  refs/heads/master 9500c773e -> c7d56cffb


PARQUET-273 : remove usage of ReflectiveOperationException to support JAVA6

as commented here: https://github.com/apache/parquet-mr/commit/52f3240d90f2397cd1850ab11674ba08a0ecb2a0#commitcomment-11065301

Author: Tianshuo Deng <tdeng@twitter.com>

Closes #191 from tsdeng/remove_usage_of_reflective_operation_exception and squashes the following
commits:

adbe37a [Tianshuo Deng] remove usage of ReflectiveOperationException to support JAVA6


Project: http://git-wip-us.apache.org/repos/asf/parquet-mr/repo
Commit: http://git-wip-us.apache.org/repos/asf/parquet-mr/commit/c7d56cff
Tree: http://git-wip-us.apache.org/repos/asf/parquet-mr/tree/c7d56cff
Diff: http://git-wip-us.apache.org/repos/asf/parquet-mr/diff/c7d56cff

Branch: refs/heads/master
Commit: c7d56cffbb4668d0955ef00196e08f42f2efe363
Parents: 9500c77
Author: Tianshuo Deng <tdeng@twitter.com>
Authored: Tue May 12 11:15:40 2015 -0700
Committer: Tianshuo Deng <tdeng@twitter.com>
Committed: Tue May 12 11:15:40 2015 -0700

----------------------------------------------------------------------
 .../parquet/scrooge/ScroogeStructConverter.java | 26 ++++++++++++++++----
 1 file changed, 21 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/parquet-mr/blob/c7d56cff/parquet-scrooge/src/main/java/org/apache/parquet/scrooge/ScroogeStructConverter.java
----------------------------------------------------------------------
diff --git a/parquet-scrooge/src/main/java/org/apache/parquet/scrooge/ScroogeStructConverter.java
b/parquet-scrooge/src/main/java/org/apache/parquet/scrooge/ScroogeStructConverter.java
index 98eaf75..ca2716b 100644
--- a/parquet-scrooge/src/main/java/org/apache/parquet/scrooge/ScroogeStructConverter.java
+++ b/parquet-scrooge/src/main/java/org/apache/parquet/scrooge/ScroogeStructConverter.java
@@ -91,7 +91,9 @@ public class ScroogeStructConverter {
     ThriftStructCodec<?> companionObject;
     try {
       companionObject = (ThriftStructCodec<?>) companionClass.getField("MODULE$").get(null);
-    } catch (ReflectiveOperationException e) {
+    } catch (NoSuchFieldException e) {
+      throw new ScroogeSchemaConversionException("Can not get ThriftStructCodec from companion
object of " + companionClass.getName(), e);
+    } catch (IllegalAccessException e) {
       throw new ScroogeSchemaConversionException("Can not get ThriftStructCodec from companion
object of " + companionClass.getName(), e);
     }
 
@@ -141,8 +143,14 @@ public class ScroogeStructConverter {
           Object companionUnionObj = companionUnionClass.getField("MODULE$").get(null);
           ThriftStructFieldInfo info = (ThriftStructFieldInfo) companionUnionClass.getMethod("fieldInfo").invoke(companionUnionObj);
           fields.add(info);
-        } catch (ReflectiveOperationException e) {
-          throw new ScroogeSchemaConversionException("can not find fiedInfo for " + unionClass,
e);
+        } catch (NoSuchFieldException e) {
+          throw new ScroogeSchemaConversionException("can not find fieldInfo for " + unionClass,
e);
+        } catch (InvocationTargetException e) {
+          throw new ScroogeSchemaConversionException("can not find fieldInfo for " + unionClass,
e);
+        } catch (NoSuchMethodException e) {
+          throw new ScroogeSchemaConversionException("can not find fieldInfo for " + unionClass,
e);
+        } catch (IllegalAccessException e) {
+          throw new ScroogeSchemaConversionException("can not find fieldInfo for " + unionClass,
e);
         }
       }
     }
@@ -324,10 +332,18 @@ public class ScroogeStructConverter {
         enumValues.add(new ThriftType.EnumValue(enumDesc.id, enumDesc.originalName));
       }
       return new ThriftType.EnumType(enumValues);
-    } catch (ReflectiveOperationException e) {
-      throw new ScroogeSchemaConversionException("Can not convert enum field " + fieldName,
e);
     } catch (RuntimeException e) {
       throw new ScroogeSchemaConversionException("Can not convert enum field " + fieldName,
e);
+    } catch (NoSuchMethodException e) {
+      throw new ScroogeSchemaConversionException("Can not convert enum field " + fieldName,
e);
+    } catch (IllegalAccessException e) {
+      throw new ScroogeSchemaConversionException("Can not convert enum field " + fieldName,
e);
+    } catch (NoSuchFieldException e) {
+      throw new ScroogeSchemaConversionException("Can not convert enum field " + fieldName,
e);
+    } catch (InvocationTargetException e) {
+      throw new ScroogeSchemaConversionException("Can not convert enum field " + fieldName,
e);
+    } catch (ClassNotFoundException e) {
+      throw new ScroogeSchemaConversionException("Can not convert enum field " + fieldName,
e);
     }
 
   }


Mime
View raw message