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
Jan 04, 2017
by
Sarath Subramanian
Committed by
Madhan Neethiraj
Jan 04, 2017
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
34 deletions
+13
-34
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
+11
-30
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
...
@@ -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)
ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES:
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-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-1417 HIveHook: synchronous execution fails to notify (sumasai via mneethiraj)
ATLAS-1391 Add exclusion mechanism for Atlas audit (guptaneeru via mneethiraj)
ATLAS-1391 Add exclusion mechanism for Atlas audit (guptaneeru via mneethiraj)
...
...
webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java
View file @
cae6522d
...
@@ -165,10 +165,7 @@ public class TypesResource {
...
@@ -165,10 +165,7 @@ public class TypesResource {
response
.
put
(
AtlasClient
.
REQUEST_ID
,
Servlets
.
getRequestId
());
response
.
put
(
AtlasClient
.
REQUEST_ID
,
Servlets
.
getRequestId
());
response
.
put
(
AtlasClient
.
TYPES
,
typesResponse
);
response
.
put
(
AtlasClient
.
TYPES
,
typesResponse
);
return
Response
.
ok
().
entity
(
response
).
build
();
return
Response
.
ok
().
entity
(
response
).
build
();
}
catch
(
TypeExistsException
e
)
{
}
catch
(
AtlasBaseException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Type already exists"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
CONFLICT
));
}
catch
(
AtlasException
|
IllegalArgumentException
e
)
{
LOG
.
error
(
"Unable to persist types"
,
e
);
LOG
.
error
(
"Unable to persist types"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
WebApplicationException
e
)
{
}
catch
(
WebApplicationException
e
)
{
...
...
webapp/src/main/java/org/apache/atlas/web/rest/TypesREST.java
View file @
cae6522d
...
@@ -305,12 +305,7 @@ public class TypesREST {
...
@@ -305,12 +305,7 @@ public class TypesREST {
public
AtlasEntityDef
createEntityDef
(
AtlasEntityDef
entityDef
)
throws
AtlasBaseException
{
public
AtlasEntityDef
createEntityDef
(
AtlasEntityDef
entityDef
)
throws
AtlasBaseException
{
AtlasEntityDef
ret
=
typeDefStore
.
createEntityDef
(
entityDef
);
AtlasEntityDef
ret
=
typeDefStore
.
createEntityDef
(
entityDef
);
try
{
return
ret
;
ret
=
typeDefStore
.
createEntityDef
(
entityDef
);
return
ret
;
}
catch
(
AtlasBaseException
ex
)
{
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
ex
,
Response
.
Status
.
BAD_REQUEST
));
}
}
}
@GET
@GET
...
@@ -336,10 +331,8 @@ public class TypesREST {
...
@@ -336,10 +331,8 @@ public class TypesREST {
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
@Experimental
public
AtlasEntityDef
updateEntityDefByName
(
@PathParam
(
"name"
)
String
name
,
AtlasEntityDef
entityDef
)
throws
Exception
{
public
AtlasEntityDef
updateEntityDefByName
(
@PathParam
(
"name"
)
String
name
,
AtlasEntityDef
entityDef
)
throws
AtlasBaseException
{
AtlasEntityDef
ret
=
null
;
AtlasEntityDef
ret
=
typeDefStore
.
updateEntityDefByName
(
name
,
entityDef
);
ret
=
typeDefStore
.
updateEntityDefByName
(
name
,
entityDef
);
return
ret
;
return
ret
;
}
}
...
@@ -349,10 +342,8 @@ public class TypesREST {
...
@@ -349,10 +342,8 @@ public class TypesREST {
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
@Experimental
public
AtlasEntityDef
updateEntityDefByGuid
(
@PathParam
(
"guid"
)
String
guid
,
AtlasEntityDef
entityDef
)
throws
Exception
{
public
AtlasEntityDef
updateEntityDefByGuid
(
@PathParam
(
"guid"
)
String
guid
,
AtlasEntityDef
entityDef
)
throws
AtlasBaseException
{
AtlasEntityDef
ret
=
null
;
AtlasEntityDef
ret
=
typeDefStore
.
updateEntityDefByGuid
(
guid
,
entityDef
);
ret
=
typeDefStore
.
updateEntityDefByGuid
(
guid
,
entityDef
);
return
ret
;
return
ret
;
}
}
...
@@ -361,7 +352,7 @@ public class TypesREST {
...
@@ -361,7 +352,7 @@ public class TypesREST {
@Path
(
"/entitydef/name/{name}"
)
@Path
(
"/entitydef/name/{name}"
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
@Experimental
public
void
deleteEntityDef
(
@PathParam
(
"name"
)
String
name
)
throws
Exception
{
public
void
deleteEntityDef
(
@PathParam
(
"name"
)
String
name
)
throws
AtlasBase
Exception
{
typeDefStore
.
deleteEntityDefByName
(
name
);
typeDefStore
.
deleteEntityDefByName
(
name
);
}
}
...
@@ -369,7 +360,7 @@ public class TypesREST {
...
@@ -369,7 +360,7 @@ public class TypesREST {
@Path
(
"/entitydef/guid/{guid}"
)
@Path
(
"/entitydef/guid/{guid}"
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
@Experimental
public
void
deleteEntityDefByGuid
(
@PathParam
(
"guid"
)
String
guid
)
throws
Exception
{
public
void
deleteEntityDefByGuid
(
@PathParam
(
"guid"
)
String
guid
)
throws
AtlasBase
Exception
{
typeDefStore
.
deleteEntityDefByGuid
(
guid
);
typeDefStore
.
deleteEntityDefByGuid
(
guid
);
}
}
...
@@ -448,14 +439,8 @@ public class TypesREST {
...
@@ -448,14 +439,8 @@ public class TypesREST {
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
@Experimental
public
AtlasTypesDef
updateAtlasTypeDefs
(
final
AtlasTypesDef
typesDef
)
throws
Exception
{
public
AtlasTypesDef
updateAtlasTypeDefs
(
final
AtlasTypesDef
typesDef
)
throws
AtlasBaseException
{
AtlasTypesDef
ret
=
null
;
AtlasTypesDef
ret
=
typeDefStore
.
updateTypesDef
(
typesDef
);
try
{
ret
=
typeDefStore
.
updateTypesDef
(
typesDef
);
}
catch
(
AtlasBaseException
ex
)
{
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
ex
,
ex
.
getAtlasErrorCode
().
getHttpCode
()));
}
return
ret
;
return
ret
;
}
}
...
@@ -470,12 +455,8 @@ public class TypesREST {
...
@@ -470,12 +455,8 @@ public class TypesREST {
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Consumes
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Produces
(
Servlets
.
JSON_MEDIA_TYPE
)
@Experimental
@Experimental
public
void
deleteAtlasTypeDefs
(
final
AtlasTypesDef
typesDef
)
{
public
void
deleteAtlasTypeDefs
(
final
AtlasTypesDef
typesDef
)
throws
AtlasBaseException
{
try
{
typeDefStore
.
deleteTypesDef
(
typesDef
);
typeDefStore
.
deleteTypesDef
(
typesDef
);
}
catch
(
AtlasBaseException
ex
)
{
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
ex
,
Response
.
Status
.
NOT_MODIFIED
));
}
}
}
/**
/**
...
...
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