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
490e37ec
Commit
490e37ec
authored
Apr 15, 2020
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3709: fix to address skipped index initialization in earlier commit - #2
Change-Id: I9152792cfb5dd66fc29bd1691268219fb64c13b5
parent
eef89a77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
GraphBackedSearchIndexer.java
...ache/atlas/repository/graph/GraphBackedSearchIndexer.java
+7
-8
SolrIndexHelper.java
...va/org/apache/atlas/repository/graph/SolrIndexHelper.java
+8
-2
No files found.
repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
View file @
490e37ec
...
@@ -31,7 +31,6 @@ import org.apache.atlas.listener.ChangedTypeDefs;
...
@@ -31,7 +31,6 @@ import org.apache.atlas.listener.ChangedTypeDefs;
import
org.apache.atlas.listener.TypeDefChangeListener
;
import
org.apache.atlas.listener.TypeDefChangeListener
;
import
org.apache.atlas.model.TypeCategory
;
import
org.apache.atlas.model.TypeCategory
;
import
org.apache.atlas.model.typedef.AtlasBaseTypeDef
;
import
org.apache.atlas.model.typedef.AtlasBaseTypeDef
;
import
org.apache.atlas.model.typedef.AtlasEntityDef
;
import
org.apache.atlas.model.typedef.AtlasEnumDef
;
import
org.apache.atlas.model.typedef.AtlasEnumDef
;
import
org.apache.atlas.model.typedef.AtlasStructDef
;
import
org.apache.atlas.model.typedef.AtlasStructDef
;
import
org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef
;
import
org.apache.atlas.model.typedef.AtlasStructDef.AtlasAttributeDef
;
...
@@ -209,18 +208,18 @@ public class GraphBackedSearchIndexer implements SearchIndexer, ActiveStateChang
...
@@ -209,18 +208,18 @@ public class GraphBackedSearchIndexer implements SearchIndexer, ActiveStateChang
LOG
.
debug
(
"Type definition load completed. Informing the completion to IndexChangeListeners."
);
LOG
.
debug
(
"Type definition load completed. Informing the completion to IndexChangeListeners."
);
}
}
ChangedTypeDefs
changedTypeDefs
=
null
;
Collection
<
AtlasBaseTypeDef
>
typeDefs
=
new
ArrayList
<>();
typeDefs
.
addAll
(
typeRegistry
.
getAllEntityDefs
());
typeDefs
.
addAll
(
typeRegistry
.
getAllBusinessMetadataDefs
());
ChangedTypeDefs
changedTypeDefs
=
new
ChangedTypeDefs
(
null
,
new
ArrayList
<>(
typeDefs
),
null
);
AtlasGraphManagement
management
=
null
;
AtlasGraphManagement
management
=
null
;
try
{
try
{
management
=
provider
.
get
().
getManagementSystem
();
management
=
provider
.
get
().
getManagementSystem
();
//resolve index fields names for the new entity attributes.
//resolve index fields names
changedTypeDefs
=
new
ChangedTypeDefs
(
null
,
new
ArrayList
<>(
typeRegistry
.
getAllEntityDefs
()),
null
);
resolveIndexFieldNames
(
management
,
changedTypeDefs
);
//resolve index fields names for the new business metadata attributes.
changedTypeDefs
=
new
ChangedTypeDefs
(
null
,
new
ArrayList
<>(
typeRegistry
.
getAllBusinessMetadataDefs
()),
null
);
resolveIndexFieldNames
(
management
,
changedTypeDefs
);
resolveIndexFieldNames
(
management
,
changedTypeDefs
);
//Commit indexes
//Commit indexes
...
...
repository/src/main/java/org/apache/atlas/repository/graph/SolrIndexHelper.java
View file @
490e37ec
...
@@ -68,10 +68,16 @@ public class SolrIndexHelper implements IndexChangeListener {
...
@@ -68,10 +68,16 @@ public class SolrIndexHelper implements IndexChangeListener {
@Override
@Override
public
void
onChange
(
ChangedTypeDefs
changedTypeDefs
)
{
public
void
onChange
(
ChangedTypeDefs
changedTypeDefs
)
{
if
(!
AtlasRepositoryConfiguration
.
isFreeTextSearchEnabled
()
||
if
(!
AtlasRepositoryConfiguration
.
isFreeTextSearchEnabled
())
{
changedTypeDefs
==
null
||
!(
changedTypeDefs
.
hasEntityDef
()
||
changedTypeDefs
.
hasBusinessMetadataDef
()))
{
// nothing to do if there are no changes to entity-defs
return
;
return
;
}
}
if
(
changedTypeDefs
==
null
||
!(
changedTypeDefs
.
hasEntityDef
()
||
changedTypeDefs
.
hasBusinessMetadataDef
()))
{
LOG
.
info
(
"SolrIndexHelper.onChange(): no change in entity/business-metadata types. No updates needed."
);
return
;
}
if
(
initializationCompleted
)
{
if
(
initializationCompleted
)
{
try
{
try
{
AtlasGraph
graph
=
AtlasGraphProvider
.
getGraphInstance
();
AtlasGraph
graph
=
AtlasGraphProvider
.
getGraphInstance
();
...
...
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