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
1cc40fd9
Commit
1cc40fd9
authored
7 years ago
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1675: type-registry re-initialization failure when instance goes from passive to active state
parent
a127e26b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
AtlasTypeRegistry.java
...rc/main/java/org/apache/atlas/type/AtlasTypeRegistry.java
+31
-0
AtlasTypeDefGraphStore.java
.../atlas/repository/store/graph/AtlasTypeDefGraphStore.java
+2
-0
No files found.
intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java
View file @
1cc40fd9
...
@@ -231,6 +231,10 @@ public class AtlasTypeRegistry {
...
@@ -231,6 +231,10 @@ public class AtlasTypeRegistry {
entityDefs
=
new
TypeDefCache
<>(
allTypes
);
entityDefs
=
new
TypeDefCache
<>(
allTypes
);
allDefCaches
=
new
TypeDefCache
[]
{
enumDefs
,
structDefs
,
classificationDefs
,
entityDefs
};
allDefCaches
=
new
TypeDefCache
[]
{
enumDefs
,
structDefs
,
classificationDefs
,
entityDefs
};
init
();
}
void
init
()
{
allTypes
.
addType
(
new
AtlasBuiltInTypes
.
AtlasBooleanType
());
allTypes
.
addType
(
new
AtlasBuiltInTypes
.
AtlasBooleanType
());
allTypes
.
addType
(
new
AtlasBuiltInTypes
.
AtlasByteType
());
allTypes
.
addType
(
new
AtlasBuiltInTypes
.
AtlasByteType
());
allTypes
.
addType
(
new
AtlasBuiltInTypes
.
AtlasShortType
());
allTypes
.
addType
(
new
AtlasBuiltInTypes
.
AtlasShortType
());
...
@@ -303,6 +307,16 @@ public class AtlasTypeRegistry {
...
@@ -303,6 +307,16 @@ public class AtlasTypeRegistry {
entityDefs
.
removeTypeDefByName
(
typeName
);
entityDefs
.
removeTypeDefByName
(
typeName
);
}
}
}
}
void
clear
()
{
allTypes
.
clear
();
enumDefs
.
clear
();
structDefs
.
clear
();
classificationDefs
.
clear
();
entityDefs
.
clear
();
init
();
}
}
}
public
static
class
AtlasTransientTypeRegistry
extends
AtlasTypeRegistry
{
public
static
class
AtlasTransientTypeRegistry
extends
AtlasTypeRegistry
{
...
@@ -334,6 +348,10 @@ public class AtlasTypeRegistry {
...
@@ -334,6 +348,10 @@ public class AtlasTypeRegistry {
}
}
}
}
public
void
clear
()
{
registryData
.
clear
();
}
public
void
addType
(
AtlasBaseTypeDef
typeDef
)
throws
AtlasBaseException
{
public
void
addType
(
AtlasBaseTypeDef
typeDef
)
throws
AtlasBaseException
{
if
(
LOG
.
isDebugEnabled
())
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"==> AtlasTypeRegistry.addType({})"
,
typeDef
);
LOG
.
debug
(
"==> AtlasTypeRegistry.addType({})"
,
typeDef
);
...
@@ -863,10 +881,16 @@ class TypeCache {
...
@@ -863,10 +881,16 @@ class TypeCache {
typeNameMap
.
get
(
name
);
typeNameMap
.
get
(
name
);
}
}
}
}
public
void
clear
()
{
typeGuidMap
.
clear
();
typeNameMap
.
clear
();
}
}
}
class
TypeDefCache
<
T1
extends
AtlasBaseTypeDef
,
T2
extends
AtlasType
>
{
class
TypeDefCache
<
T1
extends
AtlasBaseTypeDef
,
T2
extends
AtlasType
>
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
TypeDefCache
.
class
);
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
TypeDefCache
.
class
);
private
final
TypeCache
typeCache
;
private
final
TypeCache
typeCache
;
private
final
Map
<
String
,
T1
>
typeDefGuidMap
;
private
final
Map
<
String
,
T1
>
typeDefGuidMap
;
private
final
Map
<
String
,
T1
>
typeDefNameMap
;
private
final
Map
<
String
,
T1
>
typeDefNameMap
;
...
@@ -985,4 +1009,11 @@ class TypeDefCache<T1 extends AtlasBaseTypeDef, T2 extends AtlasType> {
...
@@ -985,4 +1009,11 @@ class TypeDefCache<T1 extends AtlasBaseTypeDef, T2 extends AtlasType> {
}
}
}
}
}
}
public
void
clear
()
{
typeCache
.
clear
();
typeDefGuidMap
.
clear
();
typeDefNameMap
.
clear
();
typeNameMap
.
clear
();
}
}
}
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
View file @
1cc40fd9
...
@@ -93,6 +93,8 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
...
@@ -93,6 +93,8 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
try
{
try
{
ttr
=
typeRegistry
.
lockTypeRegistryForUpdate
(
typeUpdateLockMaxWaitTimeSeconds
);
ttr
=
typeRegistry
.
lockTypeRegistryForUpdate
(
typeUpdateLockMaxWaitTimeSeconds
);
ttr
.
clear
();
AtlasTypesDef
typesDef
=
new
AtlasTypesDef
(
getEnumDefStore
(
ttr
).
getAll
(),
AtlasTypesDef
typesDef
=
new
AtlasTypesDef
(
getEnumDefStore
(
ttr
).
getAll
(),
getStructDefStore
(
ttr
).
getAll
(),
getStructDefStore
(
ttr
).
getAll
(),
getClassificationDefStore
(
ttr
).
getAll
(),
getClassificationDefStore
(
ttr
).
getAll
(),
...
...
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