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
7d622bdf
Commit
7d622bdf
authored
Mar 07, 2017
by
apoorvnaik
Committed by
Madhan Neethiraj
Mar 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1655: Metrics query enhancement
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
f87f5f22
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
AtlasGremlin2QueryProvider.java
...ava/org/apache/atlas/util/AtlasGremlin2QueryProvider.java
+7
-7
No files found.
repository/src/main/java/org/apache/atlas/util/AtlasGremlin2QueryProvider.java
View file @
7d622bdf
...
@@ -22,21 +22,21 @@ public class AtlasGremlin2QueryProvider extends AtlasGremlinQueryProvider {
...
@@ -22,21 +22,21 @@ public class AtlasGremlin2QueryProvider extends AtlasGremlinQueryProvider {
public
String
getQuery
(
final
AtlasGremlinQuery
gremlinQuery
)
{
public
String
getQuery
(
final
AtlasGremlinQuery
gremlinQuery
)
{
switch
(
gremlinQuery
)
{
switch
(
gremlinQuery
)
{
case
TYPE_COUNT_METRIC:
case
TYPE_COUNT_METRIC:
return
"g.V().has('__type', 'typeSystem').filter({
it.'__type.category'.name() != 'TRAIT'
}).count()"
;
return
"g.V().has('__type', 'typeSystem').filter({
!it.'__type.category'.name().matches('TRAIT')
}).count()"
;
case
TYPE_UNUSED_COUNT_METRIC:
case
TYPE_UNUSED_COUNT_METRIC:
return
"g.V('__type', 'typeSystem').filter({
it.'__type.category'.name() != 'TRAIT' && it.inE
.count() == 0}).count()"
;
return
"g.V('__type', 'typeSystem').filter({
!it.getProperty('__type.category').name().matches('TRAIT') && it.inE()
.count() == 0}).count()"
;
case
ENTITY_COUNT_METRIC:
case
ENTITY_COUNT_METRIC:
return
"g.V().has('__superTypeNames', T.in, ['Referenceable']).count()"
;
return
"g.V().has('__superTypeNames', T.in, ['Referenceable']).count()"
;
case
TAG_COUNT_METRIC:
case
TAG_COUNT_METRIC:
return
"g.V().has('__type', 'typeSystem').filter({it.
'__type.category'.name() == 'TRAIT'
}).count()"
;
return
"g.V().has('__type', 'typeSystem').filter({it.
getProperty('__type.category').name().matches('TRAIT')
}).count()"
;
case
ENTITY_DELETED_METRIC:
case
ENTITY_DELETED_METRIC:
return
"g.V().has('__
superTypeNames', T.in, ['Referenceable']
).has('__status', 'DELETED').count()"
;
return
"g.V().has('__
typeName', T.in, g.V().has('__type', 'typeSystem').filter{it.getProperty('__type.category').name().matches('CLASS')}.'__type.name'.toSet()
).has('__status', 'DELETED').count()"
;
case
ENTITIES_PER_TYPE_METRIC:
case
ENTITIES_PER_TYPE_METRIC:
return
"g.V().has('__typeName', T.in, g.V().has('__type', 'typeSystem').filter
({it.'__type.category'.name() != 'TRAIT'}).'__type.name'.toSet()).groupCount{it.'__typeName'
}.cap.toList()"
;
return
"g.V().has('__typeName', T.in, g.V().has('__type', 'typeSystem').filter
{it.getProperty('__type.category').name() == 'CLASS'}.'__type.name'.toSet()).groupCount{it.getProperty('__typeName')
}.cap.toList()"
;
case
TAGGED_ENTITIES_METRIC:
case
TAGGED_ENTITIES_METRIC:
return
"g.V().has('__
superTypeNames', T.in, ['Referenceable']).has('__traitNames'
).count()"
;
return
"g.V().has('__
traitNames', T.in, g.V().has('__type', 'typeSystem').filter{it.getProperty('__type.category').name() == 'TRAIT'}.'__type.name'.toSet()
).count()"
;
case
ENTITIES_FOR_TAG_METRIC:
case
ENTITIES_FOR_TAG_METRIC:
return
"g.V().has('__typeName', T.in, g.V().has('__type', 'typeSystem').filter{it.
'__type.category'.name() == 'TRAIT'}.'__type.name'.toSet()).groupCount{it.'__typeName'
}.cap.toList()"
;
return
"g.V().has('__typeName', T.in, g.V().has('__type', 'typeSystem').filter{it.
getProperty('__type.category').name() == 'TRAIT'}.'__type.name'.toSet()).groupCount{it.getProperty('__typeName')
}.cap.toList()"
;
case
EXPORT_BY_GUID_FULL:
case
EXPORT_BY_GUID_FULL:
return
"g.V('__guid', startGuid).bothE().bothV().has('__guid').__guid.dedup().toList()"
;
return
"g.V('__guid', startGuid).bothE().bothV().has('__guid').__guid.dedup().toList()"
;
case
EXPORT_BY_GUID_CONNECTED_IN_EDGE:
case
EXPORT_BY_GUID_CONNECTED_IN_EDGE:
...
...
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