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
5 years ago
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
...
@@ -379,25 +379,30 @@ public class GraphBackedSearchIndexer implements SearchIndexer, ActiveStateChang
private
void
resolveIndexFieldNames
(
AtlasGraphManagement
managementSystem
,
AtlasEntityType
entityType
)
{
private
void
resolveIndexFieldNames
(
AtlasGraphManagement
managementSystem
,
AtlasEntityType
entityType
)
{
for
(
AtlasAttribute
attribute:
entityType
.
getAllAttributes
().
values
())
{
for
(
AtlasAttribute
attribute:
entityType
.
getAllAttributes
().
values
())
{
if
(
needsIndexFieldNameResolution
(
attribute
))
{
resolveIndexFieldName
(
managementSystem
,
attribute
);
resolveIndexFieldName
(
managementSystem
,
attribute
);
}
}
}
}
}
private
void
resolveIndexFieldName
(
AtlasGraphManagement
managementSystem
,
private
void
resolveIndexFieldName
(
AtlasGraphManagement
managementSystem
,
AtlasAttribute
attribute
)
{
AtlasAttribute
attribute
)
{
if
(
attribute
.
getIndexFieldName
()
==
null
&&
TypeCategory
.
PRIMITIVE
.
equals
(
attribute
.
getAttributeType
().
getTypeCategory
()))
{
AtlasPropertyKey
propertyKey
=
managementSystem
.
getPropertyKey
(
attribute
.
getQualifiedName
());
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
);
String
indexFieldName
=
managementSystem
.
getIndexFieldName
(
Constants
.
VERTEX_INDEX
,
propertyKey
);
attribute
.
setIndexFieldName
(
indexFieldName
);
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
)
{
LOG
.
info
(
"Property {} is mapped to index field name {}"
,
attribute
.
getQualifiedName
(),
attribute
.
getIndexFieldName
());
return
attribute
.
getIndexFieldName
()
==
null
&&
}
TypeCategory
.
PRIMITIVE
.
equals
(
attribute
.
getAttributeType
().
getTypeCategory
());
}
}
}
private
void
createCommonVertexIndex
(
AtlasGraphManagement
management
,
private
void
createCommonVertexIndex
(
AtlasGraphManagement
management
,
...
...
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