asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject incubator-asterixdb git commit: some finals + exception cleanup
Date Sat, 21 May 2016 01:37:03 GMT
Repository: incubator-asterixdb
Updated Branches:
  refs/heads/master fbcf7e4aa -> 2348ca127


some finals + exception cleanup

Change-Id: Ie0252fef069ee93db6e32e13a13ebb11df5ce913
Reviewed-on: https://asterix-gerrit.ics.uci.edu/877
Reviewed-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/2348ca12
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/2348ca12
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/2348ca12

Branch: refs/heads/master
Commit: 2348ca1278ce7bda45b0a6fee18ba8208702936f
Parents: fbcf7e4
Author: Till Westmann <tillw@apache.org>
Authored: Fri May 20 16:13:38 2016 -0700
Committer: Till Westmann <tillw@apache.org>
Committed: Fri May 20 18:36:55 2016 -0700

----------------------------------------------------------------------
 .../asterix/jobgen/QueryLogicalExpressionJobGen.java     |  9 ++-------
 .../library/ExternalFunctionDescriptorProvider.java      |  5 ++---
 .../apache/asterix/om/pointables/cast/ARecordCaster.java | 11 +++--------
 .../asterix/om/pointables/printer/adm/APrintVisitor.java |  7 ++++---
 .../asterix/om/pointables/printer/csv/APrintVisitor.java |  5 +++--
 .../om/pointables/printer/json/clean/APrintVisitor.java  |  7 ++++---
 .../pointables/printer/json/lossless/APrintVisitor.java  |  7 ++++---
 7 files changed, 22 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/2348ca12/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/jobgen/QueryLogicalExpressionJobGen.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/jobgen/QueryLogicalExpressionJobGen.java
b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/jobgen/QueryLogicalExpressionJobGen.java
index 5ebabf3..f4a926c 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/jobgen/QueryLogicalExpressionJobGen.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/jobgen/QueryLogicalExpressionJobGen.java
@@ -20,7 +20,6 @@ package org.apache.asterix.jobgen;
 
 import java.util.List;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.common.functions.FunctionDescriptorTag;
 import org.apache.asterix.external.library.ExternalFunctionDescriptorProvider;
 import org.apache.asterix.formats.base.IDataFormat;
@@ -147,12 +146,8 @@ public class QueryLogicalExpressionJobGen implements ILogicalExpressionJobGen
{
             IDataFormat format = FormatUtils.getDefaultFormat();
             fd = format.resolveFunction(expr, env);
         } else {
-            try {
-                fd = ExternalFunctionDescriptorProvider
-                        .getExternalFunctionDescriptor((IExternalFunctionInfo) expr.getFunctionInfo());
-            } catch (AsterixException ae) {
-                throw new AlgebricksException(ae);
-            }
+            fd = ExternalFunctionDescriptorProvider
+                    .getExternalFunctionDescriptor((IExternalFunctionInfo) expr.getFunctionInfo());
         }
         return fd.createEvaluatorFactory(args);
     }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/2348ca12/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/ExternalFunctionDescriptorProvider.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/ExternalFunctionDescriptorProvider.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/ExternalFunctionDescriptorProvider.java
index 877ce77..5c27561 100755
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/ExternalFunctionDescriptorProvider.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/library/ExternalFunctionDescriptorProvider.java
@@ -18,7 +18,6 @@
  */
 package org.apache.asterix.external.library;
 
-import org.apache.asterix.common.exceptions.AsterixException;
 import org.apache.asterix.om.functions.IExternalFunctionInfo;
 import org.apache.asterix.om.functions.IFunctionDescriptor;
 import org.apache.asterix.runtime.evaluators.base.AbstractScalarFunctionDynamicDescriptor;
@@ -30,13 +29,13 @@ import org.apache.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
 public class ExternalFunctionDescriptorProvider {
 
     public static IFunctionDescriptor getExternalFunctionDescriptor(IExternalFunctionInfo
finfo)
-            throws AsterixException {
+            throws AlgebricksException {
         switch (finfo.getKind()) {
             case SCALAR:
                 return new ExternalScalarFunctionDescriptor(finfo);
             case AGGREGATE:
             case UNNEST:
-                throw new AsterixException("Unsupported function kind :" + finfo.getKind());
+                throw new AlgebricksException("Unsupported function kind :" + finfo.getKind());
             default:
                 break;
         }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/2348ca12/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java
index d632d70..15f6c4a 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/cast/ARecordCaster.java
@@ -289,14 +289,9 @@ class ARecordCaster {
 
         // write the closed part
         for (int i = 0; i < fieldPermutation.length; i++) {
-            int pos = fieldPermutation[i];
-            IVisitablePointable field;
-            if (pos >= 0) {
-                field = fieldValues.get(pos);
-            } else {
-                field = nullReference;
-            }
-            IAType fType = cachedReqType.getFieldTypes()[i];
+            final int pos = fieldPermutation[i];
+            final IVisitablePointable field = pos >= 0 ? fieldValues.get(pos) : nullReference;
+            final IAType fType = cachedReqType.getFieldTypes()[i];
             nestedVisitorArg.second = fType;
 
             // recursively casting, the result of casting can always be thought

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/2348ca12/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/adm/APrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/adm/APrintVisitor.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/adm/APrintVisitor.java
index d4f8652..7e2b4b8 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/adm/APrintVisitor.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/adm/APrintVisitor.java
@@ -54,6 +54,7 @@ import org.apache.asterix.om.types.ATypeTag;
 import org.apache.hyracks.algebricks.common.exceptions.NotImplementedException;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 
+import java.io.IOException;
 import java.io.PrintStream;
 import java.util.HashMap;
 import java.util.Map;
@@ -77,7 +78,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
         }
         try {
             printer.printList(accessor, arg.first, this);
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new AsterixException(e);
         }
         return null;
@@ -92,7 +93,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
         }
         try {
             printer.printRecord(accessor, arg.first, this);
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new AsterixException(e);
         }
         return null;
@@ -212,7 +213,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
                 }
             }
             return null;
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new IllegalStateException(e);
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/2348ca12/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/csv/APrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/csv/APrintVisitor.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/csv/APrintVisitor.java
index 04e3e27..0254ef6 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/csv/APrintVisitor.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/csv/APrintVisitor.java
@@ -53,6 +53,7 @@ import org.apache.asterix.om.types.ATypeTag;
 import org.apache.hyracks.algebricks.common.exceptions.NotImplementedException;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 
+import java.io.IOException;
 import java.io.PrintStream;
 import java.util.HashMap;
 import java.util.Map;
@@ -88,7 +89,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
             level++;
             printer.printRecord(accessor, arg.first, this);
             level--;
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new AsterixException(e);
         }
         return null;
@@ -204,7 +205,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
                 }
             }
             return null;
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new IllegalStateException(e);
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/2348ca12/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/clean/APrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/clean/APrintVisitor.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/clean/APrintVisitor.java
index 2f8e5f9..ac0b73a 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/clean/APrintVisitor.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/clean/APrintVisitor.java
@@ -54,6 +54,7 @@ import org.apache.asterix.om.types.ATypeTag;
 import org.apache.hyracks.algebricks.common.exceptions.NotImplementedException;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 
+import java.io.IOException;
 import java.io.PrintStream;
 import java.util.HashMap;
 import java.util.Map;
@@ -77,7 +78,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
         }
         try {
             printer.printList(accessor, arg.first, this);
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new AsterixException(e);
         }
         return null;
@@ -92,7 +93,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
         }
         try {
             printer.printRecord(accessor, arg.first, this);
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new AsterixException(e);
         }
         return null;
@@ -212,7 +213,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
                 }
             }
             return null;
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new IllegalStateException(e);
         }
     }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/2348ca12/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/lossless/APrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/lossless/APrintVisitor.java
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/lossless/APrintVisitor.java
index 3d8958a..6a96fcd 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/lossless/APrintVisitor.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/lossless/APrintVisitor.java
@@ -54,6 +54,7 @@ import org.apache.asterix.om.types.ATypeTag;
 import org.apache.hyracks.algebricks.common.exceptions.NotImplementedException;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 
+import java.io.IOException;
 import java.io.PrintStream;
 import java.util.HashMap;
 import java.util.Map;
@@ -77,7 +78,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
         }
         try {
             printer.printList(accessor, arg.first, this);
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new AsterixException(e);
         }
         return null;
@@ -92,7 +93,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
         }
         try {
             printer.printRecord(accessor, arg.first, this);
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new AsterixException(e);
         }
         return null;
@@ -212,7 +213,7 @@ public class APrintVisitor implements IVisitablePointableVisitor<Void,
Pair<Prin
                 }
             }
             return null;
-        } catch (Exception e) {
+        } catch (IOException e) {
             throw new IllegalStateException(e);
         }
     }


Mime
View raw message