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
cae6522d
Commit
cae6522d
authored
8 years ago
by
Sarath Subramanian
Committed by
Madhan Neethiraj
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1428: Create of entityDef type fails with type already exists exception
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
e5b6438f
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
32 deletions
+11
-32
release-log.txt
release-log.txt
+1
-0
TypesResource.java
...in/java/org/apache/atlas/web/resources/TypesResource.java
+1
-4
TypesREST.java
...pp/src/main/java/org/apache/atlas/web/rest/TypesREST.java
+9
-28
No files found.
release-log.txt
View file @
cae6522d
...
...
@@ -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-1428 Create of entityDef type fails with type already exists exception (sarath.kum4r@gmail.com via mneethiraj)
ATLAS-1421 Regression : HTML is displayed for deleted entities in search-result and entity-details pages (Kalyanikashikar via mneethiraj)
ATLAS-1417 HIveHook: synchronous execution fails to notify (sumasai via mneethiraj)
ATLAS-1391 Add exclusion mechanism for Atlas audit (guptaneeru via mneethiraj)
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java
View file @
cae6522d
...
...
@@ -165,10 +165,7 @@ public class TypesResource {
response
.
put
(
AtlasClient
.
REQUEST_ID
,
Servlets
.
getRequestId
());
response
.
put
(
AtlasClient
.
TYPES
,
typesResponse
);
return
Response
.
ok
().
entity
(
response
).
build
();
}
catch
(
TypeExistsException
e
)
{
LOG
.
error
(
"Type already exists"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
CONFLICT
));
}
catch
(
AtlasException
|
IllegalArgumentException
e
)
{
}
catch
(
AtlasBaseException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to persist types"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
WebApplicationException
e
)
{
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java
View file @
cae6522d
...
...
@@ -305,12 +305,7 @@ public class TypesREST {
public
AtlasEntityDef
createEntityDef
(
AtlasEntityDef
entityDef
)
throws
AtlasBaseException
{
AtlasEntityDef
ret
=
typeDefStore
.
createEntityDef
(
entityDef
);
try
{
ret
=
typeDefStore
.
createEntityDef
(
entityDef
);
return
ret
;
}
catch
(
AtlasBaseException
ex
)
{
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
ex
,
Response
.
Status
.
BAD_REQUEST
));
}
}
@GET
...
...
@@ -336,10 +331,8 @@ public class TypesREST {
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
public
AtlasEntityDef
updateEntityDefByName
(
@PathParam
(
"name"
)
String
name
,
AtlasEntityDef
entityDef
)
throws
Exception
{
AtlasEntityDef
ret
=
null
;
ret
=
typeDefStore
.
updateEntityDefByName
(
name
,
entityDef
);
public
AtlasEntityDef
updateEntityDefByName
(
@PathParam
(
"name"
)
String
name
,
AtlasEntityDef
entityDef
)
throws
AtlasBaseException
{
AtlasEntityDef
ret
=
typeDefStore
.
updateEntityDefByName
(
name
,
entityDef
);
return
ret
;
}
...
...
@@ -349,10 +342,8 @@ public class TypesREST {
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
public
AtlasEntityDef
updateEntityDefByGuid
(
@PathParam
(
"guid"
)
String
guid
,
AtlasEntityDef
entityDef
)
throws
Exception
{
AtlasEntityDef
ret
=
null
;
ret
=
typeDefStore
.
updateEntityDefByGuid
(
guid
,
entityDef
);
public
AtlasEntityDef
updateEntityDefByGuid
(
@PathParam
(
"guid"
)
String
guid
,
AtlasEntityDef
entityDef
)
throws
AtlasBaseException
{
AtlasEntityDef
ret
=
typeDefStore
.
updateEntityDefByGuid
(
guid
,
entityDef
);
return
ret
;
}
...
...
@@ -361,7 +352,7 @@ public class TypesREST {
@Path
(
"/entitydef/name/{name}"
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
public
void
deleteEntityDef
(
@PathParam
(
"name"
)
String
name
)
throws
Exception
{
public
void
deleteEntityDef
(
@PathParam
(
"name"
)
String
name
)
throws
AtlasBase
Exception
{
typeDefStore
.
deleteEntityDefByName
(
name
);
}
...
...
@@ -369,7 +360,7 @@ public class TypesREST {
@Path
(
"/entitydef/guid/{guid}"
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
public
void
deleteEntityDefByGuid
(
@PathParam
(
"guid"
)
String
guid
)
throws
Exception
{
public
void
deleteEntityDefByGuid
(
@PathParam
(
"guid"
)
String
guid
)
throws
AtlasBase
Exception
{
typeDefStore
.
deleteEntityDefByGuid
(
guid
);
}
...
...
@@ -448,14 +439,8 @@ public class TypesREST {
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
public
AtlasTypesDef
updateAtlasTypeDefs
(
final
AtlasTypesDef
typesDef
)
throws
Exception
{
AtlasTypesDef
ret
=
null
;
try
{
ret
=
typeDefStore
.
updateTypesDef
(
typesDef
);
}
catch
(
AtlasBaseException
ex
)
{
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
ex
,
ex
.
getAtlasErrorCode
().
getHttpCode
()));
}
public
AtlasTypesDef
updateAtlasTypeDefs
(
final
AtlasTypesDef
typesDef
)
throws
AtlasBaseException
{
AtlasTypesDef
ret
=
typeDefStore
.
updateTypesDef
(
typesDef
);
return
ret
;
}
...
...
@@ -470,12 +455,8 @@ public class TypesREST {
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
public
void
deleteAtlasTypeDefs
(
final
AtlasTypesDef
typesDef
)
{
try
{
public
void
deleteAtlasTypeDefs
(
final
AtlasTypesDef
typesDef
)
throws
AtlasBaseException
{
typeDefStore
.
deleteTypesDef
(
typesDef
);
}
catch
(
AtlasBaseException
ex
)
{
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
ex
,
Response
.
Status
.
NOT_MODIFIED
));
}
}
/**
...
...
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