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
1fa05264
Commit
1fa05264
authored
Nov 21, 2016
by
Shwetha GS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1116 Performance monitoring of backend methods in API requests (shwethags)
parent
94a82722
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
569 additions
and
229 deletions
+569
-229
atlas-log4j.xml
distro/src/conf/atlas-log4j.xml
+13
-16
Configuration.twiki
docs/src/site/twiki/Configuration.twiki
+13
-0
InstallationSteps.twiki
docs/src/site/twiki/InstallationSteps.twiki
+4
-0
pom.xml
pom.xml
+32
-0
release-log.txt
release-log.txt
+1
-0
pom.xml
repository/pom.xml
+41
-0
FullTextMapper.java
...ava/org/apache/atlas/repository/graph/FullTextMapper.java
+3
-1
GraphHelper.java
...n/java/org/apache/atlas/repository/graph/GraphHelper.java
+33
-20
GraphToTypedInstanceMapper.java
...he/atlas/repository/graph/GraphToTypedInstanceMapper.java
+14
-11
TypedInstanceToGraphMapper.java
...he/atlas/repository/graph/TypedInstanceToGraphMapper.java
+17
-15
AtlasGraphUtilsV1.java
...he/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java
+1
-1
pom.xml
server-api/pom.xml
+52
-0
RequestContext.java
...er-api/src/main/java/org/apache/atlas/RequestContext.java
+6
-0
AtlasAspect.java
...pi/src/main/java/org/apache/atlas/aspect/AtlasAspect.java
+68
-0
Loggable.java
...r-api/src/main/java/org/apache/atlas/aspect/Loggable.java
+30
-0
Monitored.java
...-api/src/main/java/org/apache/atlas/aspect/Monitored.java
+30
-0
Metrics.java
...r-api/src/main/java/org/apache/atlas/metrics/Metrics.java
+68
-0
MonitoredAspectTest.java
...src/test/aspect/org/apache/atlas/MonitoredAspectTest.java
+47
-0
atlas-log4j.xml
typesystem/src/main/resources/atlas-log4j.xml
+0
-16
pom.xml
webapp/pom.xml
+51
-0
AuditFilter.java
...c/main/java/org/apache/atlas/web/filters/AuditFilter.java
+11
-0
AdminResource.java
...in/java/org/apache/atlas/web/resources/AdminResource.java
+16
-50
DataSetLineageResource.java
...rg/apache/atlas/web/resources/DataSetLineageResource.java
+4
-21
EntityResource.java
...n/java/org/apache/atlas/web/resources/EntityResource.java
+0
-0
LineageResource.java
.../java/org/apache/atlas/web/resources/LineageResource.java
+4
-21
MetadataDiscoveryResource.java
...apache/atlas/web/resources/MetadataDiscoveryResource.java
+5
-27
TypesResource.java
...in/java/org/apache/atlas/web/resources/TypesResource.java
+5
-30
No files found.
distro/src/conf/atlas-log4j.xml
View file @
1fa05264
...
...
@@ -43,6 +43,14 @@
</layout>
</appender>
<appender
name=
"METRICS"
class=
"org.apache.log4j.DailyRollingFileAppender"
>
<param
name=
"File"
value=
"${atlas.log.dir}/metric.log"
/>
<param
name=
"Append"
value=
"true"
/>
<layout
class=
"org.apache.log4j.PatternLayout"
>
<param
name=
"ConversionPattern"
value=
"%d %x %m%n"
/>
</layout>
</appender>
<appender
name=
"FAILED"
class=
"org.apache.log4j.DailyRollingFileAppender"
>
<param
name=
"File"
value=
"${atlas.log.dir}/failed.log"
/>
<param
name=
"Append"
value=
"true"
/>
...
...
@@ -56,22 +64,6 @@
<appender-ref
ref=
"FILE"
/>
</logger>
<!-- uncomment this block to generate performance traces
<appender name="perf_appender" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${atlas.log.dir}/atlas_perf.log" />
<param name="datePattern" value="'.'yyyy-MM-dd" />
<param name="append" value="true" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d|%t|%m%n" />
</layout>
</appender>
<logger name="org.apache.atlas.perf" additivity="false">
<level value="debug" />
<appender-ref ref="perf_appender" />
</logger>
-->
<logger
name=
"com.thinkaurelius.titan"
additivity=
"false"
>
<level
value=
"warn"
/>
<appender-ref
ref=
"FILE"
/>
...
...
@@ -88,6 +80,11 @@
<appender-ref
ref=
"AUDIT"
/>
</logger>
<logger
name=
"METRICS"
additivity=
"false"
>
<level
value=
"debug"
/>
<appender-ref
ref=
"METRICS"
/>
</logger>
<logger
name=
"FAILED"
additivity=
"false"
>
<level
value=
"info"
/>
<appender-ref
ref=
"AUDIT"
/>
...
...
docs/src/site/twiki/Configuration.twiki
View file @
1fa05264
...
...
@@ -284,3 +284,16 @@ atlas.webserver.keepalivetimesecs=60
# Queue size for the requests(when max threads are busy) for the atlas web server
atlas.webserver.queuesize=100
</verbatim>
---+++ Recording performance metrics
Atlas package should be built with '-P perf' to instrument atlas code to collect metrics. The metrics will be recorded in
<atlas.log.dir>/metric.log, with one log line per API call. The metrics contain the number of times the instrumented methods
are called and the total time spent in the instrumented method. Logging to metric.log is controlled through log4j configuration
in atlas-log4j.xml. When the atlas code is instrumented, to disable logging to metric.log at runtime, set log level of METRICS logger to info level:
<verbatim>
<logger name="METRICS" additivity="false">
<level value="info"/>
<appender-ref ref="METRICS"/>
</logger>
</verbatim>
docs/src/site/twiki/InstallationSteps.twiki
View file @
1fa05264
...
...
@@ -18,6 +18,10 @@ mvn clean package -Pdist
</verbatim>
NOTE:
1. Use option '-DskipTests' to skip running unit and integration tests
2. Use option '-P perf' to instrument atlas to collect performance metrics
To build a distribution that configures Atlas for external HBase and Solr, build with the external-hbase-solr profile.
<verbatim>
...
...
pom.xml
View file @
1fa05264
...
...
@@ -491,9 +491,23 @@
<entity.repository.impl>
org.apache.atlas.repository.audit.InMemoryEntityAuditRepository
</entity.repository.impl>
<graphdb.backend.impl>
org.apache.atlas.repository.graphdb.titan0.Titan0GraphDatabase
</graphdb.backend.impl>
<atlas.surefire.options></atlas.surefire.options>
<aspectj.runtime.version>
1.8.7
</aspectj.runtime.version>
<aspectj.skip>
true
</aspectj.skip>
</properties>
<profiles>
<!-- Turn on this profile to instrument atlas server to collect performance metrics -->
<profile>
<id>
perf
</id>
<activation>
<activeByDefault>
false
</activeByDefault>
</activation>
<properties>
<aspectj.skip>
false
</aspectj.skip>
</properties>
</profile>
<!-- Turning on this profile affects only tests and does not affect packaging -->
<profile>
<id>
distributed
</id>
...
...
@@ -618,6 +632,18 @@
<dependencyManagement>
<dependencies>
<!-- AOP dependencies. -->
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjrt
</artifactId>
<version>
${aspectj.runtime.version}
</version>
</dependency>
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjtools
</artifactId>
<version>
${aspectj.runtime.version}
</version>
</dependency>
<dependency>
<groupId>
org.eclipse.jetty
</groupId>
<artifactId>
jetty-jsp
</artifactId>
...
...
@@ -1631,6 +1657,12 @@
<excludeGroupIds>
org.restlet.jee
</excludeGroupIds>
</configuration>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
aspectj-maven-plugin
</artifactId>
<version>
1.8
</version>
</plugin>
</plugins>
</pluginManagement>
...
...
release-log.txt
View file @
1fa05264
...
...
@@ -9,6 +9,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
ATLAS-1116 Performance monitoring of backend methods in API requests (shwethags)
ATLAS-1310 attempt LDAP authentication only when enabled (mneethiraj)
ATLAS-1309 updated HBase model with addition of column-family and column entity-defs (mneethiraj)
ATLAS-916 Return System Attributes in get entity definition (svimal2106)
...
...
repository/pom.xml
View file @
1fa05264
...
...
@@ -219,6 +219,47 @@
<groupId>
net.alchim31.maven
</groupId>
<artifactId>
scala-maven-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
aspectj-maven-plugin
</artifactId>
<configuration>
<complianceLevel>
1.7
</complianceLevel>
<includes>
<include>
**/*.java
</include>
<include>
**/*.aj
</include>
</includes>
<XaddSerialVersionUID>
true
</XaddSerialVersionUID>
<showWeaveInfo>
true
</showWeaveInfo>
<aspectLibraries>
<aspectLibrary>
<groupId>
org.apache.atlas
</groupId>
<artifactId>
atlas-server-api
</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<id>
compile_with_aspectj
</id>
<goals>
<goal>
compile
</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjtools
</artifactId>
<version>
${aspectj.runtime.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.atlas
</groupId>
<artifactId>
atlas-server-api
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
repository/src/main/java/org/apache/atlas/repository/graph/FullTextMapper.java
View file @
1fa05264
...
...
@@ -17,8 +17,9 @@
*/
package
org
.
apache
.
atlas
.
repository
.
graph
;
import
org.apache.atlas.repository.graphdb.AtlasVertex
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.aspect.Monitored
;
import
org.apache.atlas.repository.graphdb.AtlasVertex
;
import
org.apache.atlas.typesystem.ITypedInstance
;
import
org.apache.atlas.typesystem.ITypedReferenceableInstance
;
import
org.apache.atlas.typesystem.types.AttributeInfo
;
...
...
@@ -49,6 +50,7 @@ public class FullTextMapper {
instanceCache
=
new
HashMap
<>();
}
@Monitored
public
String
mapRecursive
(
AtlasVertex
instanceVertex
,
boolean
followReferences
)
throws
AtlasException
{
String
guid
=
GraphHelper
.
getIdFromVertex
(
instanceVertex
);
ITypedReferenceableInstance
typedReference
;
...
...
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
View file @
1fa05264
...
...
@@ -18,20 +18,13 @@
package
org
.
apache
.
atlas
.
repository
.
graph
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Stack
;
import
java.util.UUID
;
import
java.util.Date
;
import
com.google.common.annotations.VisibleForTesting
;
import
com.google.common.collect.BiMap
;
import
com.google.common.collect.HashBiMap
;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.RequestContext
;
import
org.apache.atlas.aspect.Monitored
;
import
org.apache.atlas.repository.Constants
;
import
org.apache.atlas.repository.RepositoryException
;
import
org.apache.atlas.repository.graphdb.AtlasEdge
;
...
...
@@ -65,9 +58,15 @@ import org.codehaus.jettison.json.JSONArray;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.google.common.annotations.VisibleForTesting
;
import
com.google.common.collect.BiMap
;
import
com.google.common.collect.HashBiMap
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Stack
;
import
java.util.UUID
;
/**
* Utility class for graph operations.
...
...
@@ -138,6 +137,7 @@ public final class GraphHelper {
return
vertexWithIdentity
;
}
@Monitored
public
AtlasVertex
createVertexWithoutIdentity
(
String
typeName
,
Id
typedInstanceId
,
Set
<
String
>
superTypeNames
)
{
LOG
.
debug
(
"Creating AtlasVertex for type {} id {}"
,
typeName
,
typedInstanceId
!=
null
?
typedInstanceId
.
_getId
()
:
null
);
...
...
@@ -165,6 +165,7 @@ public final class GraphHelper {
return
vertexWithoutIdentity
;
}
@Monitored
private
AtlasEdge
addEdge
(
AtlasVertex
fromVertex
,
AtlasVertex
toVertex
,
String
edgeLabel
)
{
LOG
.
debug
(
"Adding edge for {} -> label {} -> {}"
,
string
(
fromVertex
),
edgeLabel
,
string
(
toVertex
));
AtlasEdge
edge
=
graph
.
addEdge
(
fromVertex
,
toVertex
,
edgeLabel
);
...
...
@@ -216,7 +217,7 @@ public final class GraphHelper {
return
null
;
}
@Monitored
public
AtlasEdge
getEdgeByEdgeId
(
AtlasVertex
outVertex
,
String
edgeLabel
,
String
edgeId
)
{
if
(
edgeId
==
null
)
{
return
null
;
...
...
@@ -242,6 +243,7 @@ public final class GraphHelper {
* @return AtlasVertex with the given property keys
* @throws EntityNotFoundException
*/
@Monitored
public
AtlasVertex
findVertex
(
Object
...
args
)
throws
EntityNotFoundException
{
StringBuilder
condition
=
new
StringBuilder
();
AtlasGraphQuery
query
=
graph
.
query
();
...
...
@@ -268,6 +270,7 @@ public final class GraphHelper {
//In some cases of parallel APIs, the edge is added, but get edge by label doesn't return the edge. ATLAS-1104
//So traversing all the edges
@Monitored
public
Iterator
<
AtlasEdge
>
getAdjacentEdgesByLabel
(
AtlasVertex
instanceVertex
,
AtlasEdgeDirection
direction
,
final
String
edgeLabel
)
{
LOG
.
debug
(
"Finding edges for {} with label {}"
,
string
(
instanceVertex
),
edgeLabel
);
if
(
instanceVertex
!=
null
&&
edgeLabel
!=
null
)
{
...
...
@@ -316,6 +319,7 @@ public final class GraphHelper {
* @param edgeLabel
* @return
*/
@Monitored
public
AtlasEdge
getEdgeForLabel
(
AtlasVertex
vertex
,
String
edgeLabel
)
{
Iterator
<
AtlasEdge
>
iterator
=
getAdjacentEdgesByLabel
(
vertex
,
AtlasEdgeDirection
.
OUT
,
edgeLabel
);
AtlasEdge
latestDeletedEdge
=
null
;
...
...
@@ -340,6 +344,7 @@ public final class GraphHelper {
return
latestDeletedEdge
;
}
@Monitored
public
static
String
vertexString
(
final
AtlasVertex
vertex
)
{
StringBuilder
properties
=
new
StringBuilder
();
for
(
String
propertyKey
:
vertex
.
getPropertyKeys
())
{
...
...
@@ -350,11 +355,13 @@ public final class GraphHelper {
return
"v["
+
vertex
.
getIdForDisplay
()
+
"], Properties["
+
properties
+
"]"
;
}
@Monitored
public
static
String
edgeString
(
final
AtlasEdge
edge
)
{
return
"e["
+
edge
.
getLabel
()
+
"], ["
+
edge
.
getOutVertex
()
+
" -> "
+
edge
.
getLabel
()
+
" -> "
+
edge
.
getInVertex
()
+
"]"
;
}
@Monitored
public
static
<
T
extends
AtlasElement
>
void
setProperty
(
T
element
,
String
propertyName
,
Object
value
)
{
String
elementStr
=
string
(
element
);
String
actualPropertyName
=
GraphHelper
.
encodePropertyKey
(
propertyName
);
...
...
@@ -383,6 +390,7 @@ public final class GraphHelper {
* @param clazz
* @return
*/
@Monitored
public
static
<
T
>
T
getSingleValuedProperty
(
AtlasElement
element
,
String
propertyName
,
Class
<
T
>
clazz
)
{
String
elementStr
=
string
(
element
);
String
actualPropertyName
=
GraphHelper
.
encodePropertyKey
(
propertyName
);
...
...
@@ -392,6 +400,7 @@ public final class GraphHelper {
}
@Monitored
public
static
Object
getProperty
(
AtlasVertex
<?,?>
vertex
,
String
propertyName
)
{
String
elementStr
=
string
(
vertex
);
String
actualPropertyName
=
GraphHelper
.
encodePropertyKey
(
propertyName
);
...
...
@@ -403,9 +412,9 @@ public final class GraphHelper {
else
{
return
vertex
.
getProperty
(
actualPropertyName
,
Object
.
class
);
}
}
@Monitored
public
static
Object
getProperty
(
AtlasEdge
<?,?>
edge
,
String
propertyName
)
{
String
elementStr
=
string
(
edge
);
String
actualPropertyName
=
GraphHelper
.
encodePropertyKey
(
propertyName
);
...
...
@@ -429,6 +438,7 @@ public final class GraphHelper {
* @param propertyName
* @param value
*/
@Monitored
public
static
void
addProperty
(
AtlasVertex
vertex
,
String
propertyName
,
Object
value
)
{
String
actualPropertyName
=
GraphHelper
.
encodePropertyKey
(
propertyName
);
LOG
.
debug
(
"Adding property {} = \"{}\" to vertex {}"
,
actualPropertyName
,
value
,
string
(
vertex
));
...
...
@@ -440,6 +450,7 @@ public final class GraphHelper {
*
* @param edge
*/
@Monitored
public
void
removeEdge
(
AtlasEdge
edge
)
{
String
edgeString
=
string
(
edge
);
LOG
.
debug
(
"Removing {}"
,
edgeString
);
...
...
@@ -450,8 +461,9 @@ public final class GraphHelper {
/**
* Remove the specified AtlasVertex from the graph.
*
* @param
AtlasV
ertex
* @param
v
ertex
*/
@Monitored
public
void
removeVertex
(
AtlasVertex
vertex
)
{
String
vertexString
=
string
(
vertex
);
LOG
.
debug
(
"Removing {}"
,
vertexString
);
...
...
@@ -746,6 +758,7 @@ public final class GraphHelper {
}
@Monitored
public
static
void
setArrayElementsProperty
(
IDataType
elementType
,
AtlasVertex
instanceVertex
,
String
propertyName
,
List
<
Object
>
values
)
{
String
actualPropertyName
=
GraphHelper
.
encodePropertyKey
(
propertyName
);
if
(
GraphHelper
.
isReference
(
elementType
))
{
...
...
@@ -756,6 +769,7 @@ public final class GraphHelper {
}
}
@Monitored
public
static
void
setMapValueProperty
(
IDataType
elementType
,
AtlasVertex
instanceVertex
,
String
propertyName
,
Object
value
)
{
String
actualPropertyName
=
GraphHelper
.
encodePropertyKey
(
propertyName
);
if
(
GraphHelper
.
isReference
(
elementType
))
{
...
...
@@ -766,6 +780,7 @@ public final class GraphHelper {
}
}
@Monitored
public
static
Object
getMapValueProperty
(
IDataType
elementType
,
AtlasVertex
instanceVertex
,
String
propertyName
)
{
String
actualPropertyName
=
GraphHelper
.
encodePropertyKey
(
propertyName
);
if
(
GraphHelper
.
isReference
(
elementType
))
{
...
...
@@ -776,6 +791,7 @@ public final class GraphHelper {
}
}
@Monitored
public
static
List
<
Object
>
getArrayElementsProperty
(
IDataType
elementType
,
AtlasVertex
instanceVertex
,
String
propertyName
)
{
String
actualPropertyName
=
GraphHelper
.
encodePropertyKey
(
propertyName
);
if
(
GraphHelper
.
isReference
(
elementType
))
{
...
...
@@ -918,7 +934,4 @@ public final class GraphHelper {
String
actualPropertyName
=
GraphHelper
.
encodePropertyKey
(
propertyName
);
return
instanceVertex
.
getListProperty
(
actualPropertyName
);
}
}
repository/src/main/java/org/apache/atlas/repository/graph/GraphToTypedInstanceMapper.java
View file @
1fa05264
...
...
@@ -17,17 +17,9 @@
*/
package
org
.
apache
.
atlas
.
repository
.
graph
;
import
static
org
.
apache
.
atlas
.
repository
.
graph
.
GraphHelper
.
string
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.google.inject.Singleton
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.aspect.Monitored
;
import
org.apache.atlas.repository.Constants
;
import
org.apache.atlas.repository.graphdb.AtlasEdge
;
import
org.apache.atlas.repository.graphdb.AtlasEdgeDirection
;
...
...
@@ -51,7 +43,15 @@ import org.apache.atlas.typesystem.types.TypeSystem;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.google.inject.Singleton
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
static
org
.
apache
.
atlas
.
repository
.
graph
.
GraphHelper
.
string
;
@Singleton
public
final
class
GraphToTypedInstanceMapper
{
...
...
@@ -66,6 +66,7 @@ public final class GraphToTypedInstanceMapper {
this
.
graph
=
graph
;
}
@Monitored
public
ITypedReferenceableInstance
mapGraphToTypedInstance
(
String
guid
,
AtlasVertex
instanceVertex
)
throws
AtlasException
{
...
...
@@ -95,6 +96,7 @@ public final class GraphToTypedInstanceMapper {
return
typedInstance
;
}
@Monitored
private
void
mapVertexToInstanceTraits
(
AtlasVertex
instanceVertex
,
ITypedReferenceableInstance
typedInstance
,
List
<
String
>
traits
)
throws
AtlasException
{
for
(
String
traitName
:
traits
)
{
...
...
@@ -104,6 +106,7 @@ public final class GraphToTypedInstanceMapper {
}
}
@Monitored
public
void
mapVertexToInstance
(
AtlasVertex
instanceVertex
,
ITypedInstance
typedInstance
,
Map
<
String
,
AttributeInfo
>
fields
)
throws
AtlasException
{
...
...
repository/src/main/java/org/apache/atlas/repository/graph/TypedInstanceToGraphMapper.java
View file @
1fa05264
...
...
@@ -17,21 +17,10 @@
*/
package
org
.
apache
.
atlas
.
repository
.
graph
;
import
static
org
.
apache
.
atlas
.
repository
.
graph
.
GraphHelper
.
string
;
import
java.security.MessageDigest
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
com.google.inject.Inject
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.RequestContext
;
import
org.apache.atlas.aspect.Monitored
;
import
org.apache.atlas.repository.Constants
;
import
org.apache.atlas.repository.RepositoryException
;
import
org.apache.atlas.repository.graphdb.AtlasEdge
;
...
...
@@ -59,7 +48,18 @@ import org.apache.atlas.utils.MD5Utils;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.google.inject.Inject
;
import
java.security.MessageDigest
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
static
org
.
apache
.
atlas
.
repository
.
graph
.
GraphHelper
.
string
;
public
final
class
TypedInstanceToGraphMapper
{
...
...
@@ -85,9 +85,9 @@ public final class TypedInstanceToGraphMapper {
UPDATE_FULL
}
@Monitored
void
mapTypedInstanceToGraph
(
Operation
operation
,
ITypedReferenceableInstance
...
typedInstances
)
throws
AtlasException
{
RequestContext
requestContext
=
RequestContext
.
get
();
for
(
ITypedReferenceableInstance
typedInstance
:
typedInstances
)
{
LOG
.
debug
(
"Adding/updating entity {}"
,
typedInstance
);
...
...
@@ -150,6 +150,7 @@ public final class TypedInstanceToGraphMapper {
return
guids
;
}
@Monitored
private
String
addOrUpdateAttributesAndTraits
(
Operation
operation
,
ITypedReferenceableInstance
typedInstance
)
throws
AtlasException
{
LOG
.
debug
(
"Adding/Updating typed instance {}"
,
typedInstance
.
toShortString
());
...
...
@@ -235,6 +236,7 @@ public final class TypedInstanceToGraphMapper {
}
}
@Monitored
private
TypeUtils
.
Pair
<
List
<
ITypedReferenceableInstance
>,
List
<
ITypedReferenceableInstance
>>
createVerticesAndDiscoverInstances
(
Collection
<
IReferenceableInstance
>
instances
)
throws
AtlasException
{
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasGraphUtilsV1.java
View file @
1fa05264
...
...
@@ -142,7 +142,7 @@ public class AtlasGraphUtilsV1 {
return
returnType
.
cast
(
property
);
}
private
static
<
T
extends
AtlasElement
>
String
toString
(
T
element
)
{
private
static
String
toString
(
AtlasElement
element
)
{
if
(
element
instanceof
AtlasVertex
)
{
return
toString
((
AtlasVertex
)
element
);
}
else
if
(
element
instanceof
AtlasEdge
)
{
...
...
server-api/pom.xml
View file @
1fa05264
...
...
@@ -60,6 +60,58 @@
<groupId>
org.apache.atlas
</groupId>
<artifactId>
atlas-client
</artifactId>
</dependency>
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjrt
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
aspectj-maven-plugin
</artifactId>
<configuration>
<complianceLevel>
1.7
</complianceLevel>
<showWeaveInfo>
true
</showWeaveInfo>
<verbose>
true
</verbose>
<forceAjcCompile>
true
</forceAjcCompile>
<includes>
<include>
**/*.java
</include>
<include>
**/*.aj
</include>
</includes>
</configuration>
<executions>
<execution>
<id>
compile_with_aspectj
</id>
<goals>
<goal>
compile
</goal>
</goals>
<configuration>
<aspectDirectory>
src/main/java
</aspectDirectory>
</configuration>
</execution>
<execution>
<id>
test-compile_with_aspectj
</id>
<goals>
<goal>
test-compile
</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjrt
</artifactId>
<version>
${aspectj.runtime.version}
</version>
</dependency>
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjtools
</artifactId>
<version>
${aspectj.runtime.version}
</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
server-api/src/main/java/org/apache/atlas/RequestContext.java
View file @
1fa05264
...
...
@@ -18,6 +18,7 @@
package
org
.
apache
.
atlas
;
import
org.apache.atlas.metrics.Metrics
;
import
org.apache.atlas.typesystem.ITypedReferenceableInstance
;
import
org.apache.atlas.typesystem.persistence.Id
;
import
org.apache.atlas.typesystem.types.ClassType
;
...
...
@@ -45,6 +46,7 @@ public class RequestContext {
private
long
requestTime
;
TypeSystem
typeSystem
=
TypeSystem
.
getInstance
();
private
Metrics
metrics
=
new
Metrics
();
private
RequestContext
()
{
}
...
...
@@ -124,4 +126,8 @@ public class RequestContext {
public
boolean
isDeletedEntity
(
String
entityGuid
)
{
return
deletedEntityIds
.
contains
(
entityGuid
);
}
public
static
Metrics
getMetrics
()
{
return
get
().
metrics
;
}
}
server-api/src/main/java/org/apache/atlas/aspect/AtlasAspect.java
0 → 100644
View file @
1fa05264
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
aspect
;
import
org.apache.atlas.RequestContext
;
import
org.apache.atlas.metrics.Metrics
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.annotation.Around
;
import
org.aspectj.lang.annotation.Aspect
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.List
;
@Aspect
public
class
AtlasAspect
{
public
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
AtlasAspect
.
class
);
@Around
(
"@annotation(org.apache.atlas.aspect.Monitored) && execution(* *(..))"
)
public
Object
collectMetricsForMonitored
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
Signature
methodSign
=
joinPoint
.
getSignature
();
Metrics
metrics
=
RequestContext
.
getMetrics
();
String
metricName
=
methodSign
.
getDeclaringType
().
getSimpleName
()
+
"."
+
methodSign
.
getName
();
long
start
=
System
.
currentTimeMillis
();
try
{
Object
response
=
joinPoint
.
proceed
();
return
response
;
}
finally
{
metrics
.
record
(
metricName
,
(
System
.
currentTimeMillis
()
-
start
));
}
}
@Around
(
"@annotation(org.apache.atlas.aspect.Loggable) && execution(* *(..))"
)
public
Object
logAroundLoggable
(
ProceedingJoinPoint
joinPoint
)
throws
Throwable
{
Signature
methodSign
=
joinPoint
.
getSignature
();
String
methodName
=
methodSign
.
getDeclaringType
().
getSimpleName
()
+
"."
+
methodSign
.
getName
();
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
String
.
format
(
"==> %s(%s)"
,
methodName
,
joinPoint
.
getArgs
()));
}
Object
response
=
joinPoint
.
proceed
();
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
String
.
format
(
"<== %s(%s): %s"
,
methodName
,
joinPoint
.
getArgs
(),
response
instanceof
List
?
((
List
)
response
).
size
()
:
response
));
}
return
response
;
}
}
\ No newline at end of file
server-api/src/main/java/org/apache/atlas/aspect/Loggable.java
0 → 100644
View file @
1fa05264
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
aspect
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
(
ElementType
.
METHOD
)
public
@interface
Loggable
{
}
\ No newline at end of file
server-api/src/main/java/org/apache/atlas/aspect/Monitored.java
0 → 100644
View file @
1fa05264
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
aspect
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
import
java.lang.annotation.Target
;
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Target
(
ElementType
.
METHOD
)
public
@interface
Monitored
{
}
\ No newline at end of file
server-api/src/main/java/org/apache/atlas/metrics/Metrics.java
0 → 100644
View file @
1fa05264
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
metrics
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
public
class
Metrics
{
public
static
class
Counters
{
private
short
invocations
=
0
;
private
long
totalTimeMSecs
=
0
;
@Override
public
String
toString
()
{
return
"[count="
+
invocations
+
", totalTimeMSec="
+
totalTimeMSecs
+
"]"
;
}
public
short
getInvocations
()
{
return
invocations
;
}
public
long
getTotalTimeMSecs
()
{
return
totalTimeMSecs
;
}
}
Map
<
String
,
Counters
>
countersMap
=
new
LinkedHashMap
<>();
public
void
record
(
String
name
,
long
timeMsecs
)
{
Counters
counter
=
countersMap
.
get
(
name
);
if
(
counter
==
null
)
{
counter
=
new
Counters
();
countersMap
.
put
(
name
,
counter
);
}
counter
.
invocations
++;
counter
.
totalTimeMSecs
+=
timeMsecs
;
}
@Override
public
String
toString
()
{
return
countersMap
.
toString
();
}
public
boolean
isEmpty
()
{
return
countersMap
.
isEmpty
();
}
public
Counters
getCounters
(
String
name
)
{
return
countersMap
.
get
(
name
);
}
}
server-api/src/test/aspect/org/apache/atlas/MonitoredAspectTest.java
0 → 100644
View file @
1fa05264
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
;
import
org.apache.atlas.aspect.Monitored
;
import
org.apache.atlas.metrics.Metrics
;
import
org.testng.annotations.Test
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
import
static
org
.
testng
.
Assert
.
assertNotNull
;
import
static
org
.
testng
.
Assert
.
assertTrue
;
public
class
MonitoredAspectTest
{
@Monitored
public
void
monitoredMethod
()
throws
InterruptedException
{
Thread
.
sleep
(
1
);
}
@Test
public
void
testMonitoredAspect
()
throws
Exception
{
RequestContext
.
clear
();
monitoredMethod
();
Metrics
metrics
=
RequestContext
.
getMetrics
();
Metrics
.
Counters
counters
=
metrics
.
getCounters
(
"MonitoredAspectTest.monitoredMethod"
);
assertNotNull
(
counters
);
assertEquals
(
counters
.
getInvocations
(),
1
);
assertTrue
(
counters
.
getTotalTimeMSecs
()
>
0
);
}
}
typesystem/src/main/resources/atlas-log4j.xml
View file @
1fa05264
...
...
@@ -41,22 +41,6 @@
<appender-ref
ref=
"console"
/>
</logger>
<!-- uncomment this block to generate performance traces
<appender name="perf_appender" class="org.apache.log4j.DailyRollingFileAppender">
<param name="file" value="${atlas.log.dir}/atlas_perf.log" />
<param name="datePattern" value="'.'yyyy-MM-dd" />
<param name="append" value="true" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d|%t|%m%n" />
</layout>
</appender>
<logger name="org.apache.atlas.perf" additivity="false">
<level value="debug" />
<appender-ref ref="perf_appender" />
</logger>
-->
<appender
name=
"FAILED"
class=
"org.apache.log4j.DailyRollingFileAppender"
>
<param
name=
"File"
value=
"${atlas.log.dir}/failed.log"
/>
<param
name=
"Append"
value=
"true"
/>
...
...
webapp/pom.xml
View file @
1fa05264
...
...
@@ -384,6 +384,16 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjrt
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.atlas
</groupId>
<artifactId>
atlas-server-api
</artifactId>
</dependency>
</dependencies>
<build>
...
...
@@ -607,6 +617,47 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
aspectj-maven-plugin
</artifactId>
<configuration>
<complianceLevel>
1.7
</complianceLevel>
<includes>
<include>
**/*.java
</include>
<include>
**/*.aj
</include>
</includes>
<XaddSerialVersionUID>
true
</XaddSerialVersionUID>
<showWeaveInfo>
true
</showWeaveInfo>
<aspectLibraries>
<aspectLibrary>
<groupId>
org.apache.atlas
</groupId>
<artifactId>
atlas-server-api
</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<id>
compile_with_aspectj
</id>
<goals>
<goal>
compile
</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>
org.aspectj
</groupId>
<artifactId>
aspectjtools
</artifactId>
<version>
${aspectj.runtime.version}
</version>
</dependency>
<dependency>
<groupId>
org.apache.atlas
</groupId>
<artifactId>
atlas-server-api
</artifactId>
<version>
${project.version}
</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
webapp/src/main/java/org/apache/atlas/web/filters/AuditFilter.java
View file @
1fa05264
...
...
@@ -21,6 +21,7 @@ package org.apache.atlas.web.filters;
import
com.google.inject.Singleton
;
import
org.apache.atlas.AtlasClient
;
import
org.apache.atlas.RequestContext
;
import
org.apache.atlas.metrics.Metrics
;
import
org.apache.atlas.web.util.DateTimeHelper
;
import
org.apache.atlas.web.util.Servlets
;
import
org.slf4j.Logger
;
...
...
@@ -47,6 +48,7 @@ public class AuditFilter implements Filter {
private
static
final
Logger
AUDIT_LOG
=
LoggerFactory
.
getLogger
(
"AUDIT"
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
AuditFilter
.
class
);
private
static
final
Logger
METRICS_LOG
=
LoggerFactory
.
getLogger
(
"METRICS"
);
@Override
public
void
init
(
FilterConfig
filterConfig
)
throws
ServletException
{
...
...
@@ -73,6 +75,7 @@ public class AuditFilter implements Filter {
// put the request id into the response so users can trace logs for this request
((
HttpServletResponse
)
response
).
setHeader
(
AtlasClient
.
REQUEST_ID
,
requestId
);
currentThread
.
setName
(
oldName
);
recordMetrics
();
RequestContext
.
clear
();
}
}
...
...
@@ -103,6 +106,14 @@ public class AuditFilter implements Filter {
whatAddrs
,
whenISO9601
);
}
public
static
void
recordMetrics
()
{
//record metrics
Metrics
requestMetrics
=
RequestContext
.
getMetrics
();
if
(!
requestMetrics
.
isEmpty
())
{
METRICS_LOG
.
info
(
"{}"
,
requestMetrics
);
}
}
@Override
public
void
destroy
()
{
// do nothing
...
...
webapp/src/main/java/org/apache/atlas/web/resources/AdminResource.java
View file @
1fa05264
...
...
@@ -18,19 +18,9 @@
package
org
.
apache
.
atlas
.
web
.
resources
;
import
java.util.Collection
;
import
java.util.HashSet
;
import
java.util.Set
;
import
javax.inject.Singleton
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.WebApplicationException
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
com.google.inject.Inject
;
import
org.apache.atlas.AtlasClient
;
import
org.apache.atlas.aspect.Monitored
;
import
org.apache.atlas.utils.AtlasPerfTracer
;
import
org.apache.atlas.web.filters.AtlasCSRFPreventionFilter
;
import
org.apache.atlas.web.service.ServiceState
;
...
...
@@ -45,7 +35,16 @@ import org.springframework.security.core.Authentication;
import
org.springframework.security.core.GrantedAuthority
;
import
org.springframework.security.core.context.SecurityContextHolder
;
import
com.google.inject.Inject
;
import
javax.inject.Singleton
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.WebApplicationException
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.Response
;
import
java.util.Collection
;
import
java.util.HashSet
;
import
java.util.Set
;
/**
* Jersey Resource for admin operations.
...
...
@@ -74,17 +73,11 @@ public class AdminResource {
*
* @return json representing the thread stack dump.
*/
@Monitored
@GET
@Path
(
"stack"
)
@Produces
(
MediaType
.
TEXT_PLAIN
)
public
String
getThreadDump
()
{
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"AdminResource.getThreadDump()"
);
}
ThreadGroup
topThreadGroup
=
Thread
.
currentThread
().
getThreadGroup
();
while
(
topThreadGroup
.
getParent
()
!=
null
)
{
...
...
@@ -101,9 +94,6 @@ public class AdminResource {
builder
.
append
(
stackTrace
);
}
return
builder
.
toString
();
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
/**
...
...
@@ -111,17 +101,11 @@ public class AdminResource {
*
* @return json representing the version.
*/
@Monitored
@GET
@Path
(
"version"
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
public
Response
getVersion
()
{
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"AdminResource.getVersion()"
);
}
if
(
version
==
null
)
{
try
{
PropertiesConfiguration
configProperties
=
new
PropertiesConfiguration
(
"atlas-buildinfo.properties"
);
...
...
@@ -141,22 +125,13 @@ public class AdminResource {
}
return
version
;
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
@Monitored
@GET
@Path
(
"status"
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
public
Response
getStatus
()
{
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"AdminResource.getStatus()"
);
}
JSONObject
responseData
=
new
JSONObject
();
try
{
responseData
.
put
(
AtlasClient
.
STATUS
,
serviceState
.
getState
().
toString
());
...
...
@@ -165,23 +140,16 @@ public class AdminResource {
}
catch
(
JSONException
e
)
{
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
@Monitored
@GET
@Path
(
"session"
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
public
Response
getUserProfile
()
{
JSONObject
responseData
=
new
JSONObject
();
Boolean
enableTaxonomy
=
null
;
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"AdminResource.getUserProfile()"
);
}
PropertiesConfiguration
configProperties
=
new
PropertiesConfiguration
(
"atlas-application.properties"
);
enableTaxonomy
=
new
Boolean
(
configProperties
.
getString
(
isTaxonomyEnabled
,
"false"
));
Authentication
auth
=
SecurityContextHolder
.
getContext
().
getAuthentication
();
...
...
@@ -208,8 +176,6 @@ public class AdminResource {
return
response
;
}
catch
(
JSONException
|
ConfigurationException
e
)
{
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
}
webapp/src/main/java/org/apache/atlas/web/resources/DataSetLineageResource.java
View file @
1fa05264
...
...
@@ -19,6 +19,7 @@
package
org
.
apache
.
atlas
.
web
.
resources
;
import
org.apache.atlas.AtlasClient
;
import
org.apache.atlas.aspect.Monitored
;
import
org.apache.atlas.discovery.DiscoveryException
;
import
org.apache.atlas.discovery.LineageService
;
import
org.apache.atlas.typesystem.exception.EntityNotFoundException
;
...
...
@@ -68,6 +69,7 @@ public class DataSetLineageResource {
*
* @param tableName table name
*/
@Monitored
@GET
@Path
(
"table/{tableName}/inputs/graph"
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
...
...
@@ -75,12 +77,7 @@ public class DataSetLineageResource {
public
Response
inputsGraph
(
@Context
HttpServletRequest
request
,
@PathParam
(
"tableName"
)
String
tableName
)
{
LOG
.
info
(
"Fetching lineage inputs graph for tableName={}"
,
tableName
);
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"DataSetLineageResource.inputsGraph("
+
tableName
+
")"
);
}
final
String
jsonResult
=
lineageService
.
getInputsGraph
(
tableName
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -98,8 +95,6 @@ public class DataSetLineageResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get lineage inputs graph for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
...
...
@@ -108,6 +103,7 @@ public class DataSetLineageResource {
*
* @param tableName table name
*/
@Monitored
@GET
@Path
(
"table/{tableName}/outputs/graph"
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
...
...
@@ -115,12 +111,7 @@ public class DataSetLineageResource {
public
Response
outputsGraph
(
@Context
HttpServletRequest
request
,
@PathParam
(
"tableName"
)
String
tableName
)
{
LOG
.
info
(
"Fetching lineage outputs graph for tableName={}"
,
tableName
);
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"DataSetLineageResource.outputsGraph("
+
tableName
+
")"
);
}
final
String
jsonResult
=
lineageService
.
getOutputsGraph
(
tableName
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -138,8 +129,6 @@ public class DataSetLineageResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get lineage outputs graph for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
...
...
@@ -148,6 +137,7 @@ public class DataSetLineageResource {
*
* @param tableName table name
*/
@Monitored
@GET
@Path
(
"table/{tableName}/schema"
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
...
...
@@ -155,12 +145,7 @@ public class DataSetLineageResource {
public
Response
schema
(
@Context
HttpServletRequest
request
,
@PathParam
(
"tableName"
)
String
tableName
)
{
LOG
.
info
(
"Fetching schema for tableName={}"
,
tableName
);
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"DataSetLineageResource.schema("
+
tableName
+
")"
);
}
final
String
jsonResult
=
lineageService
.
getSchema
(
tableName
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -178,8 +163,6 @@ public class DataSetLineageResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get schema for table {}"
,
tableName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
}
webapp/src/main/java/org/apache/atlas/web/resources/EntityResource.java
View file @
1fa05264
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/resources/LineageResource.java
View file @
1fa05264
...
...
@@ -19,6 +19,7 @@
package
org
.
apache
.
atlas
.
web
.
resources
;
import
org.apache.atlas.AtlasClient
;
import
org.apache.atlas.aspect.Monitored
;
import
org.apache.atlas.discovery.DiscoveryException
;
import
org.apache.atlas.discovery.LineageService
;
import
org.apache.atlas.typesystem.exception.EntityNotFoundException
;
...
...
@@ -63,6 +64,7 @@ public class LineageResource {
* @param guid dataset entity id
* @return
*/
@Monitored
@GET
@Path
(
"{guid}/inputs/graph"
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
...
...
@@ -70,12 +72,7 @@ public class LineageResource {
public
Response
inputsGraph
(
@PathParam
(
"guid"
)
String
guid
)
{
LOG
.
info
(
"Fetching lineage inputs graph for guid={}"
,
guid
);
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"LineageResource.inputsGraph("
+
guid
+
")"
);
}
final
String
jsonResult
=
lineageService
.
getInputsGraphForEntity
(
guid
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -92,8 +89,6 @@ public class LineageResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get lineage inputs graph for entity guid={}"
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
...
...
@@ -102,6 +97,7 @@ public class LineageResource {
*
* @param guid dataset entity id
*/
@Monitored
@GET
@Path
(
"{guid}/outputs/graph"
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
...
...
@@ -109,12 +105,7 @@ public class LineageResource {
public
Response
outputsGraph
(
@PathParam
(
"guid"
)
String
guid
)
{
LOG
.
info
(
"Fetching lineage outputs graph for entity guid={}"
,
guid
);
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"LineageResource.outputsGraph("
+
guid
+
")"
);
}
final
String
jsonResult
=
lineageService
.
getOutputsGraphForEntity
(
guid
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -131,8 +122,6 @@ public class LineageResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get lineage outputs graph for entity guid={}"
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
...
...
@@ -141,6 +130,7 @@ public class LineageResource {
*
* @param guid dataset entity id
*/
@Monitored
@GET
@Path
(
"{guid}/schema"
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
...
...
@@ -148,12 +138,7 @@ public class LineageResource {
public
Response
schema
(
@PathParam
(
"guid"
)
String
guid
)
{
LOG
.
info
(
"Fetching schema for entity guid={}"
,
guid
);
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"LineageResource.schema("
+
guid
+
")"
);
}
final
String
jsonResult
=
lineageService
.
getSchemaForEntity
(
guid
);
JSONObject
response
=
new
JSONObject
();
...
...
@@ -173,8 +158,6 @@ public class LineageResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get schema for entity={}"
,
guid
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
}
webapp/src/main/java/org/apache/atlas/web/resources/MetadataDiscoveryResource.java
View file @
1fa05264
...
...
@@ -21,6 +21,7 @@ package org.apache.atlas.web.resources;
import
com.google.common.base.Preconditions
;
import
org.apache.atlas.AtlasClient
;
import
org.apache.atlas.AtlasConfiguration
;
import
org.apache.atlas.aspect.Monitored
;
import
org.apache.atlas.classification.InterfaceAudience
;
import
org.apache.atlas.discovery.DiscoveryException
;
import
org.apache.atlas.discovery.DiscoveryService
;
...
...
@@ -82,6 +83,7 @@ public class MetadataDiscoveryResource {
* @param offset offset to the results returned, used for pagination. offset >= 0. -1 maps to offset 0
* @return JSON representing the type and results.
*/
@Monitored
@GET
@Path
(
"search"
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
...
...
@@ -89,11 +91,6 @@ public class MetadataDiscoveryResource {
public
Response
search
(
@QueryParam
(
"query"
)
String
query
,
@DefaultValue
(
LIMIT_OFFSET_DEFAULT
)
@QueryParam
(
"limit"
)
int
limit
,
@DefaultValue
(
LIMIT_OFFSET_DEFAULT
)
@QueryParam
(
"offset"
)
int
offset
)
{
AtlasPerfTracer
perf
=
null
;
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"MetadataDiscoveryResource.search("
+
query
+
", "
+
limit
+
", "
+
offset
+
")"
);
}
boolean
dslQueryFailed
=
false
;
Response
response
=
null
;
try
{
...
...
@@ -109,7 +106,6 @@ public class MetadataDiscoveryResource {
if
(
dslQueryFailed
)
{
response
=
searchUsingFullText
(
query
,
limit
,
offset
);
}
AtlasPerfTracer
.
log
(
perf
);
return
response
;
}
...
...
@@ -125,6 +121,7 @@ public class MetadataDiscoveryResource {
*
* @return JSON representing the type and results.
*/
@Monitored
@GET
@Path
(
"search/dsl"
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
...
...
@@ -132,12 +129,7 @@ public class MetadataDiscoveryResource {
public
Response
searchUsingQueryDSL
(
@QueryParam
(
"query"
)
String
dslQuery
,
@DefaultValue
(
LIMIT_OFFSET_DEFAULT
)
@QueryParam
(
"limit"
)
int
limit
,
@DefaultValue
(
LIMIT_OFFSET_DEFAULT
)
@QueryParam
(
"offset"
)
int
offset
)
{
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"MetadataDiscoveryResource.searchUsingQueryDSL("
+
dslQuery
+
", "
+
limit
+
", "
+
offset
+
")"
);
}
dslQuery
=
ParamChecker
.
notEmpty
(
dslQuery
,
"dslQuery cannot be null"
);
QueryParams
queryParams
=
validateQueryParams
(
limit
,
offset
);
final
String
jsonResultStr
=
discoveryService
.
searchByDSL
(
dslQuery
,
queryParams
);
...
...
@@ -151,8 +143,6 @@ public class MetadataDiscoveryResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get entity list for dslQuery {}"
,
dslQuery
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
...
...
@@ -184,18 +174,14 @@ public class MetadataDiscoveryResource {
* @param gremlinQuery search query in raw gremlin format.
* @return JSON representing the type and results.
*/
@Monitored
@GET
@Path
(
"search/gremlin"
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@InterfaceAudience
.
Private
public
Response
searchUsingGremlinQuery
(
@QueryParam
(
"query"
)
String
gremlinQuery
)
{
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"MetadataDiscoveryResource.searchUsingGremlinQuery("
+
gremlinQuery
+
")"
);
}
gremlinQuery
=
ParamChecker
.
notEmpty
(
gremlinQuery
,
"gremlinQuery cannot be null or empty"
);
final
List
<
Map
<
String
,
String
>>
results
=
discoveryService
.
searchByGremlin
(
gremlinQuery
);
...
...
@@ -218,8 +204,6 @@ public class MetadataDiscoveryResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get entity list for gremlinQuery {}"
,
gremlinQuery
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
...
...
@@ -231,6 +215,7 @@ public class MetadataDiscoveryResource {
* @param offset offset to the results returned, used for pagination. offset >= 0. -1 maps to offset 0
* @return JSON representing the type and results.
*/
@Monitored
@GET
@Path
(
"search/fulltext"
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
...
...
@@ -238,12 +223,7 @@ public class MetadataDiscoveryResource {
public
Response
searchUsingFullText
(
@QueryParam
(
"query"
)
String
query
,
@DefaultValue
(
LIMIT_OFFSET_DEFAULT
)
@QueryParam
(
"limit"
)
int
limit
,
@DefaultValue
(
LIMIT_OFFSET_DEFAULT
)
@QueryParam
(
"offset"
)
int
offset
)
{
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"MetadataDiscoveryResource.searchUsingFullText("
+
query
+
", "
+
limit
+
", "
+
offset
+
")"
);
}
query
=
ParamChecker
.
notEmpty
(
query
,
"query cannot be null or empty"
);
QueryParams
queryParams
=
validateQueryParams
(
limit
,
offset
);
final
String
jsonResultStr
=
discoveryService
.
searchByFullText
(
query
,
queryParams
);
...
...
@@ -257,8 +237,6 @@ public class MetadataDiscoveryResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get entity list for query {}"
,
query
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
...
...
webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java
View file @
1fa05264
...
...
@@ -20,10 +20,9 @@ package org.apache.atlas.web.resources;
import
com.sun.jersey.api.client.ClientResponse
;
import
com.sun.jersey.api.core.ResourceContext
;
import
org.apache.atlas.AtlasClient
;
import
org.apache.atlas.AtlasErrorCode
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.aspect.Monitored
;
import
org.apache.atlas.exception.AtlasBaseException
;
import
org.apache.atlas.model.TypeCategory
;
import
org.apache.atlas.model.typedef.AtlasClassificationDef
;
...
...
@@ -89,19 +88,15 @@ public class TypesResource {
* Submits a type definition corresponding to a given type representing a meta model of a
* domain. Could represent things like Hive Database, Hive Table, etc.
*/
@Monitored
@POST
@Consumes
({
Servlets
.
JSON_MEDIA_TYPE
,
MediaType
.
APPLICATION_JSON
})
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
public
Response
submit
(
@Context
HttpServletRequest
request
)
{
TypesREST
typesRest
=
resourceContext
.
getResource
(
TypesREST
.
class
);
AtlasPerfTracer
perf
=
null
;
JSONArray
typesResponse
=
new
JSONArray
();
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"TypesResource.submit()"
);
}
final
String
typeDefinition
=
Servlets
.
getRequestPayload
(
request
);
LOG
.
info
(
"Creating type with definition {} "
,
typeDefinition
);
...
...
@@ -129,8 +124,6 @@ public class TypesResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to persist types"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
...
...
@@ -143,18 +136,14 @@ public class TypesResource {
* @param request
* @return
*/
@Monitored
@PUT
@Consumes
({
Servlets
.
JSON_MEDIA_TYPE
,
MediaType
.
APPLICATION_JSON
})
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
public
Response
update
(
@Context
HttpServletRequest
request
)
{
TypesREST
typesRest
=
resourceContext
.
getResource
(
TypesREST
.
class
);
AtlasPerfTracer
perf
=
null
;
JSONArray
typesResponse
=
new
JSONArray
();
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"TypesResource.update()"
);
}
final
String
typeDefinition
=
Servlets
.
getRequestPayload
(
request
);
LOG
.
info
(
"Updating type with definition {} "
,
typeDefinition
);
...
...
@@ -182,8 +171,6 @@ public class TypesResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to persist types"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
...
...
@@ -192,19 +179,15 @@ public class TypesResource {
*
* @param typeName name of a type which is unique.
*/
@Monitored
@GET
@Path
(
"{typeName}"
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
public
Response
getDefinition
(
@Context
HttpServletRequest
request
,
@PathParam
(
"typeName"
)
String
typeName
)
{
TypesREST
typesRest
=
resourceContext
.
getResource
(
TypesREST
.
class
);
JSONObject
response
=
new
JSONObject
();
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"TypesResource.getDefinition("
+
typeName
+
")"
);
}
TypeCategory
typeCategory
=
typeRegistry
.
getType
(
typeName
).
getTypeCategory
();
TypesDef
typesDef
=
null
;
...
...
@@ -247,8 +230,6 @@ public class TypesResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get type definition for type {}"
,
typeName
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
...
...
@@ -264,6 +245,7 @@ public class TypesResource {
* For example, typeCategory = TRAIT && supertype contains 'X' && supertype !contains 'Y'
* If there is no filter, all the types are returned
*/
@Monitored
@GET
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
public
Response
getTypesByFilter
(
@Context
HttpServletRequest
request
,
@QueryParam
(
"type"
)
String
typeCategory
,
...
...
@@ -271,12 +253,7 @@ public class TypesResource {
@QueryParam
(
"notsupertype"
)
String
notsupertype
)
throws
AtlasBaseException
{
TypesREST
typesRest
=
resourceContext
.
getResource
(
TypesREST
.
class
);
JSONObject
response
=
new
JSONObject
();
AtlasPerfTracer
perf
=
null
;
try
{
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"TypesResource.getTypesByFilter("
+
typeCategory
+
")"
);
}
List
<
String
>
result
=
RestUtils
.
getTypeNames
(
typesRest
.
getTypeDefHeaders
());
response
.
put
(
AtlasClient
.
RESULTS
,
new
JSONArray
(
result
));
...
...
@@ -291,8 +268,6 @@ public class TypesResource {
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get types list"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
}
finally
{
AtlasPerfTracer
.
log
(
perf
);
}
}
}
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