Commit b6eef8c2 by Sarath Subramanian

ATLAS-855: Atlas logs contain stale transaction eviction message

parent 70931e19
...@@ -113,7 +113,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -113,7 +113,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasEnumDef getEnumDefByName(String name) throws AtlasBaseException { public AtlasEnumDef getEnumDefByName(String name) throws AtlasBaseException {
AtlasEnumDef ret = typeRegistry.getEnumDefByName(name); AtlasEnumDef ret = typeRegistry.getEnumDefByName(name);
if (ret == null) { if (ret == null) {
...@@ -123,7 +122,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -123,7 +122,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasEnumDef getEnumDefByGuid(String guid) throws AtlasBaseException { public AtlasEnumDef getEnumDefByGuid(String guid) throws AtlasBaseException {
AtlasEnumDef ret = typeRegistry.getEnumDefByGuid(guid); AtlasEnumDef ret = typeRegistry.getEnumDefByGuid(guid);
if (ret == null) { if (ret == null) {
...@@ -153,7 +151,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -153,7 +151,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasStructDef getStructDefByName(String name) throws AtlasBaseException { public AtlasStructDef getStructDefByName(String name) throws AtlasBaseException {
AtlasStructDef ret = typeRegistry.getStructDefByName(name); AtlasStructDef ret = typeRegistry.getStructDefByName(name);
...@@ -165,7 +162,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -165,7 +162,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasStructDef getStructDefByGuid(String guid) throws AtlasBaseException { public AtlasStructDef getStructDefByGuid(String guid) throws AtlasBaseException {
AtlasStructDef ret = typeRegistry.getStructDefByGuid(guid); AtlasStructDef ret = typeRegistry.getStructDefByGuid(guid);
...@@ -197,7 +193,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -197,7 +193,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasClassificationDef getClassificationDefByName(String name) throws AtlasBaseException { public AtlasClassificationDef getClassificationDefByName(String name) throws AtlasBaseException {
AtlasClassificationDef ret = typeRegistry.getClassificationDefByName(name); AtlasClassificationDef ret = typeRegistry.getClassificationDefByName(name);
...@@ -209,7 +204,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -209,7 +204,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasClassificationDef getClassificationDefByGuid(String guid) throws AtlasBaseException { public AtlasClassificationDef getClassificationDefByGuid(String guid) throws AtlasBaseException {
AtlasClassificationDef ret = typeRegistry.getClassificationDefByGuid(guid); AtlasClassificationDef ret = typeRegistry.getClassificationDefByGuid(guid);
...@@ -243,7 +237,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -243,7 +237,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasEntityDef getEntityDefByName(String name) throws AtlasBaseException { public AtlasEntityDef getEntityDefByName(String name) throws AtlasBaseException {
AtlasEntityDef ret = typeRegistry.getEntityDefByName(name); AtlasEntityDef ret = typeRegistry.getEntityDefByName(name);
...@@ -255,7 +248,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -255,7 +248,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasEntityDef getEntityDefByGuid(String guid) throws AtlasBaseException { public AtlasEntityDef getEntityDefByGuid(String guid) throws AtlasBaseException {
AtlasEntityDef ret = typeRegistry.getEntityDefByGuid(guid); AtlasEntityDef ret = typeRegistry.getEntityDefByGuid(guid);
...@@ -516,7 +508,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -516,7 +508,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasTypesDef searchTypesDef(SearchFilter searchFilter) throws AtlasBaseException { public AtlasTypesDef searchTypesDef(SearchFilter searchFilter) throws AtlasBaseException {
final AtlasTypesDef typesDef = new AtlasTypesDef(); final AtlasTypesDef typesDef = new AtlasTypesDef();
Predicate searchPredicates = FilterUtil.getPredicateFromSearchFilter(searchFilter); Predicate searchPredicates = FilterUtil.getPredicateFromSearchFilter(searchFilter);
...@@ -549,7 +540,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -549,7 +540,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasBaseTypeDef getByName(String name) throws AtlasBaseException { public AtlasBaseTypeDef getByName(String name) throws AtlasBaseException {
if (StringUtils.isBlank(name)) { if (StringUtils.isBlank(name)) {
throw new AtlasBaseException(AtlasErrorCode.TYPE_NAME_INVALID, "", name); throw new AtlasBaseException(AtlasErrorCode.TYPE_NAME_INVALID, "", name);
...@@ -559,7 +549,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ ...@@ -559,7 +549,6 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
} }
@Override @Override
@GraphTransaction
public AtlasBaseTypeDef getByGuid(String guid) throws AtlasBaseException { public AtlasBaseTypeDef getByGuid(String guid) throws AtlasBaseException {
if (StringUtils.isBlank(guid)) { if (StringUtils.isBlank(guid)) {
throw new AtlasBaseException(AtlasErrorCode.TYPE_GUID_NOT_FOUND, guid); throw new AtlasBaseException(AtlasErrorCode.TYPE_GUID_NOT_FOUND, guid);
......
...@@ -73,7 +73,11 @@ public class AtlasTypeDefGraphStoreV1 extends AtlasTypeDefGraphStore { ...@@ -73,7 +73,11 @@ public class AtlasTypeDefGraphStoreV1 extends AtlasTypeDefGraphStore {
try { try {
init(); 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); LOG.error("failed to initialize types from graph store", excp);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment