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
d1f34186
Commit
d1f34186
authored
Nov 21, 2019
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3530: Retrieve entityDefinition for '_ALL_ENTITY_TYPES' in…
ATLAS-3530: Retrieve entityDefinition for '_ALL_ENTITY_TYPES' in /api/atlas/v2/types/entitydef/name/{name}
parent
bdd110df
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
AtlasEntityType.java
.../src/main/java/org/apache/atlas/type/AtlasEntityType.java
+1
-1
AtlasTypeDefGraphStore.java
.../atlas/repository/store/graph/AtlasTypeDefGraphStore.java
+5
-0
AtlasTypeDefGraphStoreTest.java
...as/repository/store/graph/AtlasTypeDefGraphStoreTest.java
+9
-1
No files found.
intg/src/main/java/org/apache/atlas/type/AtlasEntityType.java
View file @
d1f34186
...
@@ -643,7 +643,7 @@ public class AtlasEntityType extends AtlasStructType {
...
@@ -643,7 +643,7 @@ public class AtlasEntityType extends AtlasStructType {
add
(
new
AtlasAttributeDef
(
CUSTOM_ATTRIBUTES_PROPERTY_KEY
,
ATLAS_TYPE_STRING
,
false
,
true
));
add
(
new
AtlasAttributeDef
(
CUSTOM_ATTRIBUTES_PROPERTY_KEY
,
ATLAS_TYPE_STRING
,
false
,
true
));
}};
}};
AtlasEntityDef
entityDef
=
new
AtlasEntityDef
(
ENTITY_ROOT_NAME
,
"
"
,
"
"
,
attributeDefs
);
AtlasEntityDef
entityDef
=
new
AtlasEntityDef
(
ENTITY_ROOT_NAME
,
"
Root entity for system attributes"
,
"1.0
"
,
attributeDefs
);
return
new
AtlasEntityType
(
entityDef
);
return
new
AtlasEntityType
(
entityDef
);
}
}
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
View file @
d1f34186
...
@@ -45,6 +45,7 @@ import java.util.HashSet;
...
@@ -45,6 +45,7 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
static
org
.
apache
.
atlas
.
model
.
discovery
.
SearchParameters
.
ALL_ENTITY_TYPES
;
import
static
org
.
apache
.
atlas
.
repository
.
store
.
bootstrap
.
AtlasTypeDefStoreInitializer
.
getTypesToCreate
;
import
static
org
.
apache
.
atlas
.
repository
.
store
.
bootstrap
.
AtlasTypeDefStoreInitializer
.
getTypesToCreate
;
import
static
org
.
apache
.
atlas
.
repository
.
store
.
bootstrap
.
AtlasTypeDefStoreInitializer
.
getTypesToUpdate
;
import
static
org
.
apache
.
atlas
.
repository
.
store
.
bootstrap
.
AtlasTypeDefStoreInitializer
.
getTypesToUpdate
;
...
@@ -260,8 +261,12 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
...
@@ -260,8 +261,12 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
AtlasEntityDef
ret
=
typeRegistry
.
getEntityDefByName
(
name
);
AtlasEntityDef
ret
=
typeRegistry
.
getEntityDefByName
(
name
);
if
(
ret
==
null
)
{
if
(
ret
==
null
)
{
ret
=
StringUtils
.
equals
(
name
,
ALL_ENTITY_TYPES
)
?
AtlasEntityType
.
getEntityRoot
().
getEntityDef
()
:
null
;
if
(
ret
==
null
)
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
TYPE_NAME_NOT_FOUND
,
name
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
TYPE_NAME_NOT_FOUND
,
name
);
}
}
}
return
ret
;
return
ret
;
}
}
...
...
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java
View file @
d1f34186
...
@@ -24,7 +24,6 @@ import org.apache.atlas.TestUtilsV2;
...
@@ -24,7 +24,6 @@ import org.apache.atlas.TestUtilsV2;
import
org.apache.atlas.exception.AtlasBaseException
;
import
org.apache.atlas.exception.AtlasBaseException
;
import
org.apache.atlas.model.SearchFilter
;
import
org.apache.atlas.model.SearchFilter
;
import
org.apache.atlas.model.typedef.*
;
import
org.apache.atlas.model.typedef.*
;
import
org.apache.atlas.model.impexp.AtlasExportRequest
;
import
org.apache.atlas.model.typedef.AtlasClassificationDef
;
import
org.apache.atlas.model.typedef.AtlasClassificationDef
;
import
org.apache.atlas.model.typedef.AtlasEntityDef
;
import
org.apache.atlas.model.typedef.AtlasEntityDef
;
import
org.apache.atlas.model.typedef.AtlasEnumDef
;
import
org.apache.atlas.model.typedef.AtlasEnumDef
;
...
@@ -32,6 +31,7 @@ import org.apache.atlas.model.typedef.AtlasStructDef;
...
@@ -32,6 +31,7 @@ import org.apache.atlas.model.typedef.AtlasStructDef;
import
org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef
;
import
org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef
;
import
org.apache.atlas.runner.LocalSolrRunner
;
import
org.apache.atlas.runner.LocalSolrRunner
;
import
org.apache.atlas.store.AtlasTypeDefStore
;
import
org.apache.atlas.store.AtlasTypeDefStore
;
import
org.apache.atlas.type.AtlasEntityType
;
import
org.apache.atlas.type.AtlasType
;
import
org.apache.atlas.type.AtlasType
;
import
org.apache.atlas.utils.TestResourceFileUtils
;
import
org.apache.atlas.utils.TestResourceFileUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -693,4 +693,12 @@ public class AtlasTypeDefGraphStoreTest {
...
@@ -693,4 +693,12 @@ public class AtlasTypeDefGraphStoreTest {
assertEquals
(
guid
,
getBackFromCache
.
getGuid
());
assertEquals
(
guid
,
getBackFromCache
.
getGuid
());
assertEquals
(
createdTime
,
getBackFromCache
.
getCreateTime
());
assertEquals
(
createdTime
,
getBackFromCache
.
getCreateTime
());
}
}
@Test
public
void
testGetOnAllEntityTypes
()
throws
AtlasBaseException
{
AtlasEntityDef
entityDefByName
=
typeDefStore
.
getEntityDefByName
(
"_ALL_ENTITY_TYPES"
);
assertNotNull
(
entityDefByName
);
assertEquals
(
entityDefByName
,
AtlasEntityType
.
getEntityRoot
().
getEntityDef
());
}
}
}
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