atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ames...@apache.org
Subject atlas git commit: ATLAS-2134: Code Improvements.
Date Thu, 14 Sep 2017 02:06:54 GMT
Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 221e829fc -> 4c7430ddf


ATLAS-2134: Code Improvements.


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/4c7430dd
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/4c7430dd
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/4c7430dd

Branch: refs/heads/branch-0.8
Commit: 4c7430ddf8865cb1163decf75d71735e991399ff
Parents: 221e829
Author: ashutoshm <amestry@hortonworks.com>
Authored: Wed Sep 13 19:05:41 2017 -0700
Committer: ashutoshm <amestry@hortonworks.com>
Committed: Wed Sep 13 19:06:36 2017 -0700

----------------------------------------------------------------------
 .../apache/atlas/repository/impexp/ZipSource.java  |  2 +-
 .../atlas/query/GraphPersistenceStrategies.scala   |  2 ++
 .../scala/org/apache/atlas/query/QueryParser.scala | 17 ++++++++++-------
 3 files changed, 13 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/4c7430dd/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java b/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java
index 4c23582..bd51d3b 100644
--- a/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java
+++ b/repository/src/main/java/org/apache/atlas/repository/impexp/ZipSource.java
@@ -175,7 +175,7 @@ public class ZipSource implements EntityImportStream {
             currentPosition++;
             return getEntityWithExtInfo(this.iterator.next());
         } catch (AtlasBaseException e) {
-            e.printStackTrace();
+            LOG.error("getNextEntityWithExtInfo", e);
             return null;
         }
     }

http://git-wip-us.apache.org/repos/asf/atlas/blob/4c7430dd/repository/src/main/scala/org/apache/atlas/query/GraphPersistenceStrategies.scala
----------------------------------------------------------------------
diff --git a/repository/src/main/scala/org/apache/atlas/query/GraphPersistenceStrategies.scala
b/repository/src/main/scala/org/apache/atlas/query/GraphPersistenceStrategies.scala
index 752a522..c2b3436 100755
--- a/repository/src/main/scala/org/apache/atlas/query/GraphPersistenceStrategies.scala
+++ b/repository/src/main/scala/org/apache/atlas/query/GraphPersistenceStrategies.scala
@@ -284,6 +284,8 @@ case class GraphPersistenceStrategy1(g: AtlasGraph[_,_]) extends GraphPersistenc
             case DataTypes.TypeCategory.TRAIT =>
                 throw new UnsupportedOperationException(s"load for ${aInfo.dataType()} not
supported")
             case DataTypes.TypeCategory.CLASS => loadStructAttribute(dataType, aInfo,
i, v)
+            case DataTypes.TypeCategory.RELATIONSHIP =>
+                throw new UnsupportedOperationException(s"load for ${aInfo.dataType()} not
supported")
         }
     }
 

http://git-wip-us.apache.org/repos/asf/atlas/blob/4c7430dd/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala
----------------------------------------------------------------------
diff --git a/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala b/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala
index 7b7cd98..4bc6e74 100755
--- a/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala
+++ b/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala
@@ -233,6 +233,7 @@ object QueryParser extends StandardTokenParsers with QueryKeywords with
Expressi
     def querySrc: Parser[Expression] = rep1sep(singleQrySrc, opt(COMMA)) ^^ { l => l match
{
         case h :: Nil => h
         case h :: t => t.foldLeft(h)(merge(_, _))
+        case Nil => null
     }
     }
 
@@ -277,21 +278,21 @@ object QueryParser extends StandardTokenParsers with QueryKeywords with
Expressi
       case o ~ odr ~ None => (odr, true)
       case o ~ odr ~ asc => (odr, asc.get)
     }
-    
+
     def limitOffset: Parser[(Int, Int)] = LIMIT ~ lmt ~ opt (offset) ^^ {
       case l ~ lt ~ None => (lt.toInt, 0)
       case l ~ lt ~ of => (lt.toInt, of.get.toInt)
     }
-    
+
     def offset = OFFSET ~ ofset  ^^ {
       case offset ~ of  => of
     }
-    
+
     def asce = asc ^^ {
       case DESC  => false
       case  _ => true
     }
-    
+
     def loopExpression(implicit queryParams: QueryParams): Parser[(Expression, Option[Literal[Integer]],
Option[String])] =
         LOOP ~ (LPAREN ~> query <~ RPAREN) ~ opt(intConstant <~ TIMES) ~ opt(AS
~> alias) ^^ {
             case l ~ e ~ None ~ a => (e, None, a)
@@ -361,17 +362,19 @@ object QueryParser extends StandardTokenParsers with QueryKeywords with
Expressi
         case h :: t => { //the left-most part of the identifier (h) can be
             t.foldLeft(id(h).asInstanceOf[Expression])(_.field(_))
         }
+
+        case Nil => null
     }
     }
 
     def alias = ident | stringLit
-    
+
     def lmt = intConstant
-    
+
     def ofset = intConstant
 
     def asc =  ident | stringLit
-    
+
     def literal = booleanConstant ^^ {
         boolean(_)
         } |


Mime
View raw message