atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [1/2] incubator-atlas git commit: ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
Date Tue, 27 Dec 2016 22:46:46 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/0.7-incubating 9b7ccce3e -> 6681b9486


ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)

(cherry picked from commit ec94d2ad169f92feb9005ca1dc06845216c77055)


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

Branch: refs/heads/0.7-incubating
Commit: 3a95c0f134a9965502e3fa0adfe475feb7ac6e0f
Parents: 9b7ccce
Author: Suma Shivaprasad <sumasai.shivaprasad@gmail.com>
Authored: Thu Aug 18 15:46:00 2016 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Tue Dec 27 14:00:37 2016 -0800

----------------------------------------------------------------------
 release-log.txt                                 |  3 ++-
 .../atlas/GraphTransactionInterceptor.java      | 16 ++++++++++++-
 .../org/apache/atlas/repository/Constants.java  |  2 +-
 .../GraphBackedDiscoveryServiceTest.java        | 25 ++++++++++++++++++++
 4 files changed, 43 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/3a95c0f1/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index ac044c9..ccb2a3a 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -3,7 +3,9 @@ Apache Atlas Release Notes
 
 --Release 0.7-incubating
 INCOMPATIBLE CHANGES:
+ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
 ATLAS-675 Storm Hook should use timestamps as Date type instead of Long (ayubkhan via sumasai)
+ATLAS-674 Falcon Hook should use timestamps instead of long(ayubkhan via sumasai)
 ATLAS-1122 Change trait edge labels to have trait name alone (sumasai)
 ATLAS-1060 Add composite indexes for exact match performance improvements for all attributes
(sumasai via shwethags)
 ATLAS-822 Type updates - don't allow updating supertypes ( shwethags via sumasai )
@@ -42,7 +44,6 @@ ATLAS-1173 Doc: Minor editorial bug in the example given for property atlas.serv
 ATLAS-1133 Jetty Server start doesn't throw exception when user-credential.properties file
is not found (nixonrodrigues,svimal2106 via kevalbhatt)
 ATLAS-1149 Changes to UI to sort the hive table schema based on "position" attribute of hive_column
(Kalyanikashikar via kevalbhatt)
 ATLAS-1162 Register shutdown hooks with Hadoop's ShutdownHookManager, instead of directly
with Java Runtime (mneethiraj via sumasai)
-ATLAS-674 Falcon Hook should use timestamps instead of long(ayubkhan via sumasai)
 ATLAS-1098 Atlas allows creation of tag with name "isa" which causes exceptions during search
(apoorvnaik via kevalbhatt)
 ATLAS-1160 Update Atlas hive hook to read configuration from atlas-application.properties
instead of hive-site.xml (mneethiraj via kevalbhatt)
 ATLAS-1154 Errors in Eclipse with web.xml (davidrad via dkantor)

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/3a95c0f1/repository/src/main/java/org/apache/atlas/GraphTransactionInterceptor.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/GraphTransactionInterceptor.java b/repository/src/main/java/org/apache/atlas/GraphTransactionInterceptor.java
index 20e8ebc..fff8925 100644
--- a/repository/src/main/java/org/apache/atlas/GraphTransactionInterceptor.java
+++ b/repository/src/main/java/org/apache/atlas/GraphTransactionInterceptor.java
@@ -22,6 +22,8 @@ import com.thinkaurelius.titan.core.TitanGraph;
 import org.aopalliance.intercept.MethodInterceptor;
 import org.aopalliance.intercept.MethodInvocation;
 import org.apache.atlas.repository.graph.GraphProvider;
+import org.apache.atlas.typesystem.exception.EntityNotFoundException;
+import org.apache.atlas.typesystem.exception.SchemaNotFoundException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -45,8 +47,20 @@ public class GraphTransactionInterceptor implements MethodInterceptor {
             return response;
         } catch (Throwable t) {
             titanGraph.rollback();
-            LOG.error("graph rollback due to exception ", t);
+
+            if (logException(t)) {
+                LOG.error("graph rollback due to exception ", t);
+            } else {
+                LOG.error("graph rollback due to exception " + t.getClass().getSimpleName()
+ ":" + t.getMessage());
+            }
             throw t;
         }
     }
+
+    boolean logException(Throwable t) {
+        if ((t instanceof SchemaNotFoundException) || (t instanceof EntityNotFoundException))
{
+            return false;
+        }
+        return true;
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/3a95c0f1/repository/src/main/java/org/apache/atlas/repository/Constants.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/Constants.java b/repository/src/main/java/org/apache/atlas/repository/Constants.java
index 893f1b6..1767e65 100755
--- a/repository/src/main/java/org/apache/atlas/repository/Constants.java
+++ b/repository/src/main/java/org/apache/atlas/repository/Constants.java
@@ -74,7 +74,7 @@ public final class Constants {
 
         case TIMESTAMP_PROPERTY_KEY:
         case MODIFICATION_TIMESTAMP_PROPERTY_KEY:
-            return TypesUtil.newAttributeInfo(field, DataTypes.LONG_TYPE);
+            return TypesUtil.newAttributeInfo(field, DataTypes.DATE_TYPE);
         }
         return null;
     }

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/3a95c0f1/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
----------------------------------------------------------------------
diff --git a/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
b/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
index 7b7010c..40dc861 100755
--- a/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
+++ b/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
@@ -162,6 +162,31 @@ public class GraphBackedDiscoveryServiceTest extends BaseRepositoryTest
{
         rows = results.getJSONArray("rows");
         assertNotNull(rows);
         assertEquals(rows.length(), 1);
+
+        final String testTs = "\"2011-11-01T02:35:58.440Z\"";
+        dslQuery = "Department where " + Constants.TIMESTAMP_PROPERTY_KEY + " > " + testTs;
+        jsonResults = searchByDSL(dslQuery);
+        assertNotNull(jsonResults);
+
+        results = new JSONObject(jsonResults);
+        assertEquals(results.length(), 3);
+
+        rows = results.getJSONArray("rows");
+        assertNotNull(rows);
+        assertEquals(rows.length(), 1);
+
+
+        dslQuery = "Department where " + Constants.MODIFICATION_TIMESTAMP_PROPERTY_KEY +
" > " + testTs;
+        jsonResults = searchByDSL(dslQuery);
+        assertNotNull(jsonResults);
+
+        results = new JSONObject(jsonResults);
+        assertEquals(results.length(), 3);
+
+        rows = results.getJSONArray("rows");
+        assertNotNull(rows);
+        assertEquals(rows.length(), 1);
+
     }
 
     @Test


Mime
View raw message