You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by sa...@apache.org on 2017/05/09 05:06:26 UTC

incubator-atlas git commit: ATLAS-855: Atlas logs contain stale transaction eviction message

Repository: incubator-atlas
Updated Branches:
  refs/heads/master 70931e197 -> b6eef8c2b


ATLAS-855: Atlas logs contain stale transaction eviction message


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

Branch: refs/heads/master
Commit: b6eef8c2b732d49d9cd1c7b18d23aeed388cc395
Parents: 70931e1
Author: Sarath Subramanian <ss...@hortonworks.com>
Authored: Mon May 8 22:06:06 2017 -0700
Committer: Sarath Subramanian <ss...@hortonworks.com>
Committed: Mon May 8 22:06:06 2017 -0700

----------------------------------------------------------------------
 .../repository/store/graph/AtlasTypeDefGraphStore.java   | 11 -----------
 .../store/graph/v1/AtlasTypeDefGraphStoreV1.java         |  6 +++++-
 2 files changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b6eef8c2/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
index 41de29f..4a8e1de 100644
--- a/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
+++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
@@ -113,7 +113,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasEnumDef getEnumDefByName(String name) throws AtlasBaseException {
         AtlasEnumDef ret = typeRegistry.getEnumDefByName(name);
         if (ret == null) {
@@ -123,7 +122,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasEnumDef getEnumDefByGuid(String guid) throws AtlasBaseException {
         AtlasEnumDef ret = typeRegistry.getEnumDefByGuid(guid);
         if (ret == null) {
@@ -153,7 +151,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasStructDef getStructDefByName(String name) throws AtlasBaseException {
         AtlasStructDef ret = typeRegistry.getStructDefByName(name);
 
@@ -165,7 +162,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasStructDef getStructDefByGuid(String guid) throws AtlasBaseException {
         AtlasStructDef ret = typeRegistry.getStructDefByGuid(guid);
 
@@ -197,7 +193,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasClassificationDef getClassificationDefByName(String name) throws AtlasBaseException {
         AtlasClassificationDef ret = typeRegistry.getClassificationDefByName(name);
 
@@ -209,7 +204,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasClassificationDef getClassificationDefByGuid(String guid) throws AtlasBaseException {
         AtlasClassificationDef ret = typeRegistry.getClassificationDefByGuid(guid);
 
@@ -243,7 +237,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasEntityDef getEntityDefByName(String name) throws AtlasBaseException {
         AtlasEntityDef ret = typeRegistry.getEntityDefByName(name);
 
@@ -255,7 +248,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasEntityDef getEntityDefByGuid(String guid) throws AtlasBaseException {
         AtlasEntityDef ret = typeRegistry.getEntityDefByGuid(guid);
 
@@ -516,7 +508,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasTypesDef searchTypesDef(SearchFilter searchFilter) throws AtlasBaseException {
         final AtlasTypesDef typesDef = new AtlasTypesDef();
         Predicate searchPredicates = FilterUtil.getPredicateFromSearchFilter(searchFilter);
@@ -549,7 +540,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasBaseTypeDef getByName(String name) throws AtlasBaseException {
         if (StringUtils.isBlank(name)) {
             throw new AtlasBaseException(AtlasErrorCode.TYPE_NAME_INVALID, "", name);
@@ -559,7 +549,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
     }
 
     @Override
-    @GraphTransaction
     public AtlasBaseTypeDef getByGuid(String guid) throws AtlasBaseException {
         if (StringUtils.isBlank(guid)) {
             throw new AtlasBaseException(AtlasErrorCode.TYPE_GUID_NOT_FOUND, guid);

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/b6eef8c2/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java
----------------------------------------------------------------------
diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java
index b76dfef..3bf318f 100644
--- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java
+++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java
@@ -73,7 +73,11 @@ public class AtlasTypeDefGraphStoreV1 extends AtlasTypeDefGraphStore {
 
         try {
             init();
-        } catch(AtlasBaseException excp) {
+            // commit/close the transaction after successful type store initialization.
+            atlasGraph.commit();
+
+        } catch (AtlasBaseException excp) {
+            atlasGraph.rollback();
             LOG.error("failed to initialize types from graph store", excp);
         }