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
bb9c1e10
Commit
bb9c1e10
authored
May 26, 2015
by
Venkatesh Seetharam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG-37719 listing entities return's a 500
parent
9f28c422
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
11 deletions
+7
-11
EntityResource.java
.../apache/hadoop/metadata/web/resources/EntityResource.java
+7
-11
No files found.
webapp/src/main/java/org/apache/hadoop/metadata/web/resources/EntityResource.java
View file @
bb9c1e10
...
...
@@ -110,8 +110,6 @@ public class EntityResource {
@Path
(
"{guid}"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
getEntityDefinition
(
@PathParam
(
"guid"
)
String
guid
)
{
Preconditions
.
checkNotNull
(
guid
,
"Entity GUID cannot be null"
);
try
{
LOG
.
debug
(
"Fetching entity definition for guid={} "
,
guid
);
final
String
entityDefinition
=
metadataService
.
getEntityDefinition
(
guid
);
...
...
@@ -144,13 +142,14 @@ public class EntityResource {
/**
* Gets the list of entities for a given entity type.
*
* @param entityType
name of a type which is unique
* @param entityType name of a type which is unique
*/
@GET
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
getEntityListByType
(
@QueryParam
(
"type"
)
String
entityType
)
{
Preconditions
.
checkNotNull
(
entityType
,
"Entity type cannot be null"
);
try
{
Preconditions
.
checkNotNull
(
entityType
,
"Entity type cannot be null"
);
LOG
.
debug
(
"Fetching entity list for type={} "
,
entityType
);
final
List
<
String
>
entityList
=
metadataService
.
getEntityList
(
entityType
);
...
...
@@ -161,6 +160,10 @@ public class EntityResource {
response
.
put
(
MetadataServiceClient
.
COUNT
,
entityList
.
size
());
return
Response
.
ok
(
response
).
build
();
}
catch
(
NullPointerException
e
)
{
LOG
.
error
(
"Entity type cannot be null"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
MetadataException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to get entity list for type {}"
,
entityType
,
e
);
throw
new
WebApplicationException
(
...
...
@@ -213,8 +216,6 @@ public class EntityResource {
@Path
(
"{guid}/traits"
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
getTraitNames
(
@PathParam
(
"guid"
)
String
guid
)
{
Preconditions
.
checkNotNull
(
guid
,
"Entity GUID cannot be null"
);
try
{
LOG
.
debug
(
"Fetching trait names for entity={}"
,
guid
);
final
List
<
String
>
traitNames
=
metadataService
.
getTraitNames
(
guid
);
...
...
@@ -248,8 +249,6 @@ public class EntityResource {
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
addTrait
(
@Context
HttpServletRequest
request
,
@PathParam
(
"guid"
)
String
guid
)
{
Preconditions
.
checkNotNull
(
guid
,
"Entity GUID cannot be null"
);
try
{
final
String
traitDefinition
=
Servlets
.
getRequestPayload
(
request
);
LOG
.
debug
(
"Adding trait={} for entity={} "
,
traitDefinition
,
guid
);
...
...
@@ -288,9 +287,6 @@ public class EntityResource {
public
Response
deleteTrait
(
@Context
HttpServletRequest
request
,
@PathParam
(
"guid"
)
String
guid
,
@PathParam
(
TRAIT_NAME
)
String
traitName
)
{
Preconditions
.
checkNotNull
(
guid
,
"Entity GUID cannot be null"
);
Preconditions
.
checkNotNull
(
traitName
,
"Trait name cannot be null"
);
LOG
.
debug
(
"Deleting trait={} from entity={} "
,
traitName
,
guid
);
try
{
metadataService
.
deleteTrait
(
guid
,
traitName
);
...
...
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