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
36459c78
Commit
36459c78
authored
Jul 16, 2019
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3338: avoid repeated calls to get index-field name during startup
parent
85f9b502
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
GraphBackedSearchIndexer.java
...ache/atlas/repository/graph/GraphBackedSearchIndexer.java
+14
-9
No files found.
repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java
View file @
36459c78
...
...
@@ -379,25 +379,30 @@ public class GraphBackedSearchIndexer implements SearchIndexer, ActiveStateChang
private
void
resolveIndexFieldNames
(
AtlasGraphManagement
managementSystem
,
AtlasEntityType
entityType
)
{
for
(
AtlasAttribute
attribute:
entityType
.
getAllAttributes
().
values
())
{
if
(
needsIndexFieldNameResolution
(
attribute
))
{
resolveIndexFieldName
(
managementSystem
,
attribute
);
}
}
}
private
void
resolveIndexFieldName
(
AtlasGraphManagement
managementSystem
,
AtlasAttribute
attribute
)
{
AtlasPropertyKey
propertyKey
=
managementSystem
.
getPropertyKey
(
attribute
.
getQualifiedName
());
private
void
resolveIndexFieldName
(
AtlasGraphManagement
managementSystem
,
AtlasAttribute
attribute
)
{
if
(
attribute
.
getIndexFieldName
()
==
null
&&
TypeCategory
.
PRIMITIVE
.
equals
(
attribute
.
getAttributeType
().
getTypeCategory
()))
{
AtlasStructType
definedInType
=
attribute
.
getDefinedInType
();
AtlasAttribute
baseInstance
=
definedInType
!=
null
?
definedInType
.
getAttribute
(
attribute
.
getName
())
:
null
;
if
(
baseInstance
!=
null
&&
baseInstance
.
getIndexFieldName
()
!=
null
)
{
attribute
.
setIndexFieldName
(
baseInstance
.
getIndexFieldName
());
}
else
{
AtlasPropertyKey
propertyKey
=
managementSystem
.
getPropertyKey
(
attribute
.
getVertexPropertyName
());
String
indexFieldName
=
managementSystem
.
getIndexFieldName
(
Constants
.
VERTEX_INDEX
,
propertyKey
);
attribute
.
setIndexFieldName
(
indexFieldName
);
LOG
.
info
(
"Property {} is mapped to index field name {}"
,
attribute
.
getQualifiedName
(),
attribute
.
getIndexFieldName
());
if
(
baseInstance
!=
null
)
{
baseInstance
.
setIndexFieldName
(
indexFieldName
);
}
private
boolean
needsIndexFieldNameResolution
(
AtlasAttribute
attribute
)
{
return
attribute
.
getIndexFieldName
()
==
null
&&
TypeCategory
.
PRIMITIVE
.
equals
(
attribute
.
getAttributeType
().
getTypeCategory
());
LOG
.
info
(
"Property {} is mapped to index field name {}"
,
attribute
.
getQualifiedName
(),
attribute
.
getIndexFieldName
());
}
}
}
private
void
createCommonVertexIndex
(
AtlasGraphManagement
management
,
...
...
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