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
fe107bbf
Commit
fe107bbf
authored
May 20, 2015
by
Suma Shivaprasad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed review comments
parent
6be16550
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
MetadataServiceClient.java
...ava/org/apache/hadoop/metadata/MetadataServiceClient.java
+7
-7
No files found.
client/src/main/java/org/apache/hadoop/metadata/MetadataServiceClient.java
View file @
fe107bbf
...
@@ -138,7 +138,7 @@ public class MetadataServiceClient {
...
@@ -138,7 +138,7 @@ public class MetadataServiceClient {
public
List
<
String
>
listTypes
()
throws
MetadataServiceException
{
public
List
<
String
>
listTypes
()
throws
MetadataServiceException
{
try
{
try
{
final
JSONObject
jsonObject
=
callAPI
(
API
.
LIST_TYPES
,
Response
.
Status
.
OK
,
null
);
final
JSONObject
jsonObject
=
callAPI
(
API
.
LIST_TYPES
,
null
);
final
JSONArray
list
=
jsonObject
.
getJSONArray
(
MetadataServiceClient
.
RESULTS
);
final
JSONArray
list
=
jsonObject
.
getJSONArray
(
MetadataServiceClient
.
RESULTS
);
ArrayList
<
String
>
types
=
new
ArrayList
<>();
ArrayList
<
String
>
types
=
new
ArrayList
<>();
for
(
int
index
=
0
;
index
<
list
.
length
();
index
++)
{
for
(
int
index
=
0
;
index
<
list
.
length
();
index
++)
{
...
@@ -154,7 +154,7 @@ public class MetadataServiceClient {
...
@@ -154,7 +154,7 @@ public class MetadataServiceClient {
public
String
getType
(
String
typeName
)
throws
MetadataServiceException
{
public
String
getType
(
String
typeName
)
throws
MetadataServiceException
{
WebResource
resource
=
getResource
(
API
.
GET_TYPE
,
typeName
);
WebResource
resource
=
getResource
(
API
.
GET_TYPE
,
typeName
);
try
{
try
{
JSONObject
response
=
callAPIWithResource
(
API
.
GET_TYPE
,
resource
,
Response
.
Status
.
OK
);
JSONObject
response
=
callAPIWithResource
(
API
.
GET_TYPE
,
resource
);
return
response
.
getString
(
DEFINITION
);
return
response
.
getString
(
DEFINITION
);
}
catch
(
MetadataServiceException
e
)
{
}
catch
(
MetadataServiceException
e
)
{
if
(
e
.
getStatus
()
==
ClientResponse
.
Status
.
NOT_FOUND
)
{
if
(
e
.
getStatus
()
==
ClientResponse
.
Status
.
NOT_FOUND
)
{
...
@@ -205,7 +205,7 @@ public class MetadataServiceClient {
...
@@ -205,7 +205,7 @@ public class MetadataServiceClient {
public
JSONObject
searchEntity
(
String
searchQuery
)
throws
MetadataServiceException
{
public
JSONObject
searchEntity
(
String
searchQuery
)
throws
MetadataServiceException
{
WebResource
resource
=
getResource
(
API
.
SEARCH
);
WebResource
resource
=
getResource
(
API
.
SEARCH
);
resource
=
resource
.
queryParam
(
"query"
,
searchQuery
);
resource
=
resource
.
queryParam
(
"query"
,
searchQuery
);
return
callAPIWithResource
(
API
.
SEARCH
,
resource
,
Response
.
Status
.
OK
);
return
callAPIWithResource
(
API
.
SEARCH
,
resource
);
}
}
/**
/**
...
@@ -235,9 +235,9 @@ public class MetadataServiceClient {
...
@@ -235,9 +235,9 @@ public class MetadataServiceClient {
public
JSONArray
searchByDSL
(
String
query
)
throws
MetadataServiceException
{
public
JSONArray
searchByDSL
(
String
query
)
throws
MetadataServiceException
{
WebResource
resource
=
getResource
(
API
.
SEARCH_DSL
);
WebResource
resource
=
getResource
(
API
.
SEARCH_DSL
);
resource
=
resource
.
queryParam
(
"query"
,
query
);
resource
=
resource
.
queryParam
(
"query"
,
query
);
JSONObject
result
=
callAPIWithResource
(
API
.
SEARCH_DSL
,
resource
,
Response
.
Status
.
OK
);
JSONObject
result
=
callAPIWithResource
(
API
.
SEARCH_DSL
,
resource
);
try
{
try
{
return
result
.
getJSONObject
(
"results"
).
getJSONArray
(
"rows"
);
return
result
.
getJSONObject
(
RESULTS
).
getJSONArray
(
ROWS
);
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
throw
new
MetadataServiceException
(
e
);
throw
new
MetadataServiceException
(
e
);
}
}
...
@@ -252,7 +252,7 @@ public class MetadataServiceClient {
...
@@ -252,7 +252,7 @@ public class MetadataServiceClient {
public
JSONObject
searchByGremlin
(
String
gremlinQuery
)
throws
MetadataServiceException
{
public
JSONObject
searchByGremlin
(
String
gremlinQuery
)
throws
MetadataServiceException
{
WebResource
resource
=
getResource
(
API
.
SEARCH_GREMLIN
);
WebResource
resource
=
getResource
(
API
.
SEARCH_GREMLIN
);
resource
=
resource
.
queryParam
(
"query"
,
gremlinQuery
);
resource
=
resource
.
queryParam
(
"query"
,
gremlinQuery
);
return
callAPIWithResource
(
API
.
SEARCH_GREMLIN
,
resource
,
Response
.
Status
.
OK
);
return
callAPIWithResource
(
API
.
SEARCH_GREMLIN
,
resource
);
}
}
/**
/**
...
@@ -264,7 +264,7 @@ public class MetadataServiceClient {
...
@@ -264,7 +264,7 @@ public class MetadataServiceClient {
public
JSONObject
searchByFullText
(
String
query
)
throws
MetadataServiceException
{
public
JSONObject
searchByFullText
(
String
query
)
throws
MetadataServiceException
{
WebResource
resource
=
getResource
(
API
.
SEARCH_FULL_TEXT
);
WebResource
resource
=
getResource
(
API
.
SEARCH_FULL_TEXT
);
resource
=
resource
.
queryParam
(
"query"
,
query
);
resource
=
resource
.
queryParam
(
"query"
,
query
);
return
callAPIWithResource
(
API
.
SEARCH_FULL_TEXT
,
resource
,
Response
.
Status
.
OK
);
return
callAPIWithResource
(
API
.
SEARCH_FULL_TEXT
,
resource
);
}
}
public
String
getRequestId
(
JSONObject
json
)
throws
MetadataServiceException
{
public
String
getRequestId
(
JSONObject
json
)
throws
MetadataServiceException
{
...
...
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