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
a0a3c318
Commit
a0a3c318
authored
4 years ago
by
Ashutosh Mestry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-4015: Add Re-indexing as JAVA_PATCH. Part 2
parent
06106fe9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
AtlasConfiguration.java
intg/src/main/java/org/apache/atlas/AtlasConfiguration.java
+1
-1
ReIndexPatch.java
...ava/org/apache/atlas/repository/patches/ReIndexPatch.java
+8
-6
No files found.
intg/src/main/java/org/apache/atlas/AtlasConfiguration.java
View file @
a0a3c318
...
@@ -74,7 +74,7 @@ public enum AtlasConfiguration {
...
@@ -74,7 +74,7 @@ public enum AtlasConfiguration {
HTTP_HEADER_SERVER_VALUE
(
"atlas.http.header.server.value"
,
"Apache Atlas"
),
HTTP_HEADER_SERVER_VALUE
(
"atlas.http.header.server.value"
,
"Apache Atlas"
),
STORAGE_CONSISTENCY_LOCK_ENABLED
(
"atlas.graph.storage.consistency-lock.enabled"
,
true
),
STORAGE_CONSISTENCY_LOCK_ENABLED
(
"atlas.graph.storage.consistency-lock.enabled"
,
true
),
RE
INDEX_PATCH_ENABLED
(
"atlas.patch.reindex.enabled
"
,
false
);
RE
BUILD_INDEX
(
"atlas.rebuild.index
"
,
false
);
private
static
final
Configuration
APPLICATION_PROPERTIES
;
private
static
final
Configuration
APPLICATION_PROPERTIES
;
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/patches/ReIndexPatch.java
View file @
a0a3c318
...
@@ -23,6 +23,7 @@ import org.apache.atlas.pc.WorkItemBuilder;
...
@@ -23,6 +23,7 @@ import org.apache.atlas.pc.WorkItemBuilder;
import
org.apache.atlas.pc.WorkItemConsumer
;
import
org.apache.atlas.pc.WorkItemConsumer
;
import
org.apache.atlas.pc.WorkItemManager
;
import
org.apache.atlas.pc.WorkItemManager
;
import
org.apache.atlas.repository.Constants
;
import
org.apache.atlas.repository.Constants
;
import
org.apache.atlas.repository.graphdb.AtlasEdge
;
import
org.apache.atlas.repository.graphdb.AtlasElement
;
import
org.apache.atlas.repository.graphdb.AtlasElement
;
import
org.apache.atlas.repository.graphdb.AtlasGraph
;
import
org.apache.atlas.repository.graphdb.AtlasGraph
;
import
org.apache.atlas.repository.graphdb.AtlasVertex
;
import
org.apache.atlas.repository.graphdb.AtlasVertex
;
...
@@ -53,7 +54,8 @@ public class ReIndexPatch extends AtlasPatchHandler {
...
@@ -53,7 +54,8 @@ public class ReIndexPatch extends AtlasPatchHandler {
@Override
@Override
public
void
apply
()
throws
AtlasBaseException
{
public
void
apply
()
throws
AtlasBaseException
{
if
(
AtlasConfiguration
.
REINDEX_PATCH_ENABLED
.
getBoolean
()
==
false
)
{
if
(
AtlasConfiguration
.
REBUILD_INDEX
.
getBoolean
()
==
false
)
{
LOG
.
info
(
"ReIndexPatch: Skipped, since not enabled!"
);
return
;
return
;
}
}
...
@@ -113,8 +115,8 @@ public class ReIndexPatch extends AtlasPatchHandler {
...
@@ -113,8 +115,8 @@ public class ReIndexPatch extends AtlasPatchHandler {
}
}
private
static
void
edges
(
WorkItemManager
manager
,
AtlasGraph
graph
)
{
private
static
void
edges
(
WorkItemManager
manager
,
AtlasGraph
graph
)
{
Iterable
<
Object
>
iterable
=
graph
.
getEdges
();
Iterable
<
AtlasEdge
>
iterable
=
graph
.
getEdges
();
for
(
Iterator
<
Object
>
iter
=
iterable
.
iterator
();
iter
.
hasNext
();
)
{
for
(
Iterator
<
AtlasEdge
>
iter
=
iterable
.
iterator
();
iter
.
hasNext
();
)
{
manager
.
checkProduce
(
iter
.
next
());
manager
.
checkProduce
(
iter
.
next
());
}
}
}
}
...
@@ -144,9 +146,9 @@ public class ReIndexPatch extends AtlasPatchHandler {
...
@@ -144,9 +146,9 @@ public class ReIndexPatch extends AtlasPatchHandler {
}
}
private
static
class
ReindexConsumer
extends
WorkItemConsumer
<
AtlasElement
>
{
private
static
class
ReindexConsumer
extends
WorkItemConsumer
<
AtlasElement
>
{
private
List
<
AtlasElement
>
list
=
new
ArrayList
();
private
final
List
<
AtlasElement
>
list
=
new
ArrayList
();
private
AtlasGraph
graph
;
private
final
String
[]
indexNames
;
private
String
[]
indexNames
;
private
final
AtlasGraph
graph
;
private
final
AtomicLong
counter
;
private
final
AtomicLong
counter
;
public
ReindexConsumer
(
BlockingQueue
queue
,
AtlasGraph
graph
,
String
[]
indexNames
)
{
public
ReindexConsumer
(
BlockingQueue
queue
,
AtlasGraph
graph
,
String
[]
indexNames
)
{
...
...
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