Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
8dc4041c
Commit
8dc4041c
authored
Mar 28, 2019
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3104: Fix stale transaction alerts in atlas logs
parent
a9fc73a4
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
9 deletions
+28
-9
AtlasGraph.java
.../java/org/apache/atlas/repository/graphdb/AtlasGraph.java
+5
-0
AtlasJanusGraph.java
...pache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
+9
-0
AtlasJavaPatchHandler.java
...pache/atlas/repository/patches/AtlasJavaPatchHandler.java
+4
-4
UniqueAttributePatchHandler.java
...atlas/repository/patches/UniqueAttributePatchHandler.java
+2
-5
AtlasGraphUtilsV2.java
...he/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
+8
-0
No files found.
graphdb/api/src/main/java/org/apache/atlas/repository/graphdb/AtlasGraph.java
View file @
8dc4041c
...
...
@@ -208,6 +208,11 @@ public interface AtlasGraph<V, E> {
void
clear
();
/**
* Gets all open transactions.
*/
Set
getOpenTransactions
();
/**
* Converts the graph to gson and writes it to the specified stream.
*
* @param os
...
...
graphdb/janus/src/main/java/org/apache/atlas/repository/graphdb/janus/AtlasJanusGraph.java
View file @
8dc4041c
...
...
@@ -60,6 +60,7 @@ import org.janusgraph.core.SchemaViolationException;
import
org.janusgraph.core.schema.JanusGraphIndex
;
import
org.janusgraph.core.schema.JanusGraphManagement
;
import
org.janusgraph.diskstorage.BackendException
;
import
org.janusgraph.graphdb.database.StandardJanusGraph
;
import
javax.script.Bindings
;
import
javax.script.ScriptEngine
;
...
...
@@ -87,6 +88,7 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
private
final
ConvertGremlinValueFunction
GREMLIN_VALUE_CONVERSION_FUNCTION
=
new
ConvertGremlinValueFunction
();
private
final
Set
<
String
>
multiProperties
=
new
HashSet
<>();
private
final
StandardJanusGraph
janusGraph
;
public
AtlasJanusGraph
()
{
//determine multi-properties once at startup
...
...
@@ -107,6 +109,8 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
mgmt
.
rollback
();
}
}
janusGraph
=
(
StandardJanusGraph
)
AtlasJanusGraphDatabase
.
getGraphInstance
();
}
@Override
...
...
@@ -217,6 +221,11 @@ public class AtlasJanusGraph implements AtlasGraph<AtlasJanusVertex, AtlasJanusE
}
@Override
public
Set
getOpenTransactions
()
{
return
janusGraph
.
getOpenTransactions
();
}
@Override
public
void
shutdown
()
{
getGraph
().
close
();
}
...
...
repository/src/main/java/org/apache/atlas/repository/patches/AtlasJavaPatchHandler.java
View file @
8dc4041c
...
...
@@ -84,10 +84,10 @@ public abstract class AtlasJavaPatchHandler {
setEncodedProperty
(
patchVertex
,
CREATED_BY_KEY
,
getCurrentUser
());
setEncodedProperty
(
patchVertex
,
MODIFIED_BY_KEY
,
getCurrentUser
());
graph
.
commit
();
addToPatchesRegistry
(
patchId
,
getPatchStatus
());
}
graph
.
commit
();
}
private
PatchStatus
getPatchStatus
(
Map
<
String
,
PatchStatus
>
patchesRegistry
)
{
...
...
@@ -108,10 +108,10 @@ public abstract class AtlasJavaPatchHandler {
setEncodedProperty
(
patchVertex
,
MODIFICATION_TIMESTAMP_PROPERTY_KEY
,
RequestContext
.
get
().
getRequestTime
());
setEncodedProperty
(
patchVertex
,
MODIFIED_BY_KEY
,
getCurrentUser
());
graph
.
commit
();
addToPatchesRegistry
(
getPatchId
(),
getPatchStatus
());
}
graph
.
commit
();
}
public
PatchStatus
getPatchStatus
()
{
...
...
repository/src/main/java/org/apache/atlas/repository/patches/UniqueAttributePatchHandler.java
View file @
8dc4041c
...
...
@@ -136,7 +136,6 @@ public class UniqueAttributePatchHandler extends AtlasJavaPatchHandler {
private
void
registerUniqueAttrPropertyKeys
(
Collection
<
AtlasAttribute
>
attributes
)
throws
IndexException
{
AtlasGraphManagement
management
=
graph
.
getManagementSystem
();
boolean
idxCreated
=
false
;
for
(
AtlasAttribute
attribute
:
attributes
)
{
String
uniquePropertyName
=
attribute
.
getVertexUniquePropertyName
();
...
...
@@ -150,14 +149,11 @@ public class UniqueAttributePatchHandler extends AtlasJavaPatchHandler {
AtlasCardinality
cardinality
=
indexer
.
toAtlasCardinality
(
attributeDef
.
getCardinality
());
indexer
.
createVertexIndex
(
management
,
uniquePropertyName
,
UniqueKind
.
NONE
,
propertyClass
,
cardinality
,
isIndexable
,
true
);
idxCreated
=
true
;
}
}
//Commit indexes
if
(
idxCreated
)
{
indexer
.
commit
(
management
);
}
graph
.
commit
();
}
}
\ No newline at end of file
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
View file @
8dc4041c
...
...
@@ -512,9 +512,17 @@ public class AtlasGraphUtilsV2 {
LOG
.
warn
(
"getPatches() returned empty result!"
);
}
getGraphInstance
().
commit
();
return
new
AtlasPatches
(
ret
);
}
public
int
getOpenTransactions
()
{
Set
openTransactions
=
getGraphInstance
().
getOpenTransactions
();
return
(
openTransactions
!=
null
)
?
openTransactions
.
size
()
:
0
;
}
private
static
AtlasPatch
toAtlasPatch
(
AtlasVertex
vertex
)
{
AtlasPatch
ret
=
new
AtlasPatch
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment