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
2c84d702
Commit
2c84d702
authored
Aug 18, 2017
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2062: Add flag to disable v1 gremlin search API using atlas-application property
(cherry picked from commit caf89a3098d3187514a8412294b0d84dec68b097)
parent
6d8c50cc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
atlas-application.properties
distro/src/conf/atlas-application.properties
+5
-0
MetadataDiscoveryResource.java
...apache/atlas/web/resources/MetadataDiscoveryResource.java
+12
-1
No files found.
distro/src/conf/atlas-application.properties
View file @
2c84d702
...
...
@@ -252,6 +252,11 @@ atlas.metric.query.cache.ttlInSecs=900
#Set to false to disable full text search.
#atlas.search.fulltext.enable=true
######### Gremlin Search Configuration #########
#Set to false to disable gremlin search.
atlas.search.gremlin.enable
=
false
########## Add http headers ###########
...
...
webapp/src/main/java/org/apache/atlas/web/resources/MetadataDiscoveryResource.java
View file @
2c84d702
...
...
@@ -28,6 +28,7 @@ import org.apache.atlas.query.QueryParams;
import
org.apache.atlas.utils.AtlasPerfTracer
;
import
org.apache.atlas.utils.ParamChecker
;
import
org.apache.atlas.web.util.Servlets
;
import
org.apache.commons.configuration.Configuration
;
import
org.codehaus.jettison.json.JSONArray
;
import
org.codehaus.jettison.json.JSONException
;
import
org.codehaus.jettison.json.JSONObject
;
...
...
@@ -66,6 +67,10 @@ public class MetadataDiscoveryResource {
private
final
DiscoveryService
discoveryService
;
private
final
boolean
gremlinSearchEnabled
;
private
static
Configuration
applicationProperties
=
null
;
private
static
final
String
ENABLE_GREMLIN_SEARCH_PROPERTY
=
"atlas.search.gremlin.enable"
;
/**
* Created by the Guice ServletModule and injected with the
* configured DiscoveryService.
...
...
@@ -73,8 +78,10 @@ public class MetadataDiscoveryResource {
* @param discoveryService metadata service handle
*/
@Inject
public
MetadataDiscoveryResource
(
DiscoveryService
discoveryService
)
{
public
MetadataDiscoveryResource
(
DiscoveryService
discoveryService
,
Configuration
configuration
)
{
this
.
discoveryService
=
discoveryService
;
applicationProperties
=
configuration
;
gremlinSearchEnabled
=
applicationProperties
!=
null
&&
applicationProperties
.
getBoolean
(
ENABLE_GREMLIN_SEARCH_PROPERTY
,
false
);
}
/**
...
...
@@ -212,6 +219,10 @@ public class MetadataDiscoveryResource {
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"MetadataDiscoveryResource.searchUsingGremlinQuery("
+
gremlinQuery
+
")"
);
}
if
(!
gremlinSearchEnabled
)
{
throw
new
DiscoveryException
(
"Gremlin search is not enabled."
);
}
gremlinQuery
=
ParamChecker
.
notEmpty
(
gremlinQuery
,
"gremlinQuery cannot be null or empty"
);
final
List
<
Map
<
String
,
String
>>
results
=
discoveryService
.
searchByGremlin
(
gremlinQuery
);
...
...
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