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
88eadb9b
Commit
88eadb9b
authored
Aug 22, 2017
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2078: Type update using v1 API doesn't route to createUpdateTypesDef in v2 API
parent
b54f4b87
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
3 deletions
+20
-3
AtlasTypeDefStore.java
...c/main/java/org/apache/atlas/store/AtlasTypeDefStore.java
+2
-0
AtlasTypeDefGraphStore.java
.../atlas/repository/store/graph/AtlasTypeDefGraphStore.java
+12
-0
TypesResource.java
...in/java/org/apache/atlas/web/resources/TypesResource.java
+6
-3
No files found.
intg/src/main/java/org/apache/atlas/store/AtlasTypeDefStore.java
View file @
88eadb9b
...
...
@@ -93,6 +93,8 @@ public interface AtlasTypeDefStore {
AtlasTypesDef
updateTypesDef
(
AtlasTypesDef
atlasTypesDef
)
throws
AtlasBaseException
;
AtlasTypesDef
createUpdateTypesDef
(
AtlasTypesDef
typesToCreateUpdate
)
throws
AtlasBaseException
;
AtlasTypesDef
createUpdateTypesDef
(
AtlasTypesDef
typesToCreate
,
AtlasTypesDef
typesToUpdate
)
throws
AtlasBaseException
;
void
deleteTypesDef
(
AtlasTypesDef
atlasTypesDef
)
throws
AtlasBaseException
;
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
View file @
88eadb9b
...
...
@@ -45,6 +45,9 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.Set
;
import
static
org
.
apache
.
atlas
.
repository
.
store
.
bootstrap
.
AtlasTypeDefStoreInitializer
.
getTypesToCreate
;
import
static
org
.
apache
.
atlas
.
repository
.
store
.
bootstrap
.
AtlasTypeDefStoreInitializer
.
getTypesToUpdate
;
/**
* Abstract class for graph persistence store for TypeDef
...
...
@@ -340,6 +343,15 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
@Override
@GraphTransaction
public
AtlasTypesDef
createUpdateTypesDef
(
AtlasTypesDef
typesDef
)
throws
AtlasBaseException
{
AtlasTypesDef
typesToCreate
=
getTypesToCreate
(
typesDef
,
typeRegistry
);
AtlasTypesDef
typesToUpdate
=
getTypesToUpdate
(
typesDef
,
typeRegistry
);
return
createUpdateTypesDef
(
typesToCreate
,
typesToUpdate
);
}
@Override
@GraphTransaction
public
AtlasTypesDef
createUpdateTypesDef
(
AtlasTypesDef
typesToCreate
,
AtlasTypesDef
typesToUpdate
)
throws
AtlasBaseException
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"==> AtlasTypeDefGraphStore.createUpdateTypesDef({}, {})"
,
typesToCreate
,
typesToUpdate
);
...
...
webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java
View file @
88eadb9b
...
...
@@ -23,6 +23,7 @@ import com.sun.jersey.api.core.ResourceContext;
import
org.apache.atlas.AtlasClient
;
import
org.apache.atlas.exception.AtlasBaseException
;
import
org.apache.atlas.model.typedef.AtlasTypesDef
;
import
org.apache.atlas.store.AtlasTypeDefStore
;
import
org.apache.atlas.type.AtlasTypeRegistry
;
import
org.apache.atlas.typesystem.TypesDef
;
import
org.apache.atlas.typesystem.json.TypesSerialization
;
...
...
@@ -71,11 +72,13 @@ public class TypesResource {
private
static
final
Logger
PERF_LOG
=
AtlasPerfTracer
.
getPerfLogger
(
"rest.TypesResource"
);
private
static
AtlasTypeRegistry
typeRegistry
;
private
final
TypesREST
typesREST
;
private
final
AtlasTypeDefStore
typeDefStore
;
@Inject
public
TypesResource
(
AtlasTypeRegistry
typeRegistry
,
TypesREST
typesREST
)
{
public
TypesResource
(
AtlasTypeRegistry
typeRegistry
,
TypesREST
typesREST
,
AtlasTypeDefStore
typeDefStore
)
{
this
.
typeRegistry
=
typeRegistry
;
this
.
typesREST
=
typesREST
;
this
.
typesREST
=
typesREST
;
this
.
typeDefStore
=
typeDefStore
;
}
@Context
...
...
@@ -176,7 +179,7 @@ public class TypesResource {
}
AtlasTypesDef
updateTypesDef
=
TypeConverterUtil
.
toAtlasTypesDef
(
typeDefinition
,
typeRegistry
);
AtlasTypesDef
updatedTypesDef
=
type
sREST
.
updateAtlasTypeDefs
(
updateTypesDef
);
AtlasTypesDef
updatedTypesDef
=
type
DefStore
.
createUpdateTypesDef
(
updateTypesDef
);
List
<
String
>
typeNames
=
TypeConverterUtil
.
getTypeNames
(
updatedTypesDef
);
for
(
int
i
=
0
;
i
<
typeNames
.
size
();
i
++)
{
...
...
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