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
ec94d2ad
Commit
ec94d2ad
authored
8 years ago
by
Suma Shivaprasad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
parent
64f017a7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
1 deletion
+41
-1
release-log.txt
release-log.txt
+1
-0
GraphTransactionInterceptor.java
...in/java/org/apache/atlas/GraphTransactionInterceptor.java
+14
-0
GraphHelper.java
...n/java/org/apache/atlas/repository/graph/GraphHelper.java
+1
-1
GraphBackedDiscoveryServiceTest.java
...ache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
+25
-0
No files found.
release-log.txt
View file @
ec94d2ad
...
...
@@ -7,6 +7,7 @@ ATLAS-674 Falcon Hook should use timestamps instead of long(ayubkhan via sumasai
ATLAS-675 Storm Hook should use timetsamps as Date type 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-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
ATLAS-1126 Fix NPE in getSchema calls (sumasai)
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/GraphTransactionInterceptor.java
View file @
ec94d2ad
...
...
@@ -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
();
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
;
}
}
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
View file @
ec94d2ad
...
...
@@ -736,7 +736,7 @@ public final class GraphHelper {
case
Constants
.
TIMESTAMP_PROPERTY_KEY
:
case
Constants
.
MODIFICATION_TIMESTAMP_PROPERTY_KEY
:
return
TypesUtil
.
newAttributeInfo
(
field
,
DataTypes
.
LONG
_TYPE
);
return
TypesUtil
.
newAttributeInfo
(
field
,
DataTypes
.
DATE
_TYPE
);
}
return
null
;
}
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java
View file @
ec94d2ad
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
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