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
fe30c2c0
Commit
fe30c2c0
authored
9 years ago
by
Venkatesh Seetharam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG-37719 listing entities return's a 500
parent
247a4d09
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
EntityResource.java
.../apache/hadoop/metadata/web/resources/EntityResource.java
+6
-10
No files found.
webapp/src/main/java/org/apache/hadoop/metadata/web/resources/EntityResource.java
View file @
fe30c2c0
...
...
@@ -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
);
...
...
@@ -149,8 +147,9 @@ public class EntityResource {
@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
);
...
...
This diff is collapsed.
Click to expand it.
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