Commit a0a3c318 by Ashutosh Mestry

ATLAS-4015: Add Re-indexing as JAVA_PATCH. Part 2

parent 06106fe9
......@@ -74,7 +74,7 @@ public enum AtlasConfiguration {
HTTP_HEADER_SERVER_VALUE("atlas.http.header.server.value","Apache Atlas"),
STORAGE_CONSISTENCY_LOCK_ENABLED("atlas.graph.storage.consistency-lock.enabled", true),
REINDEX_PATCH_ENABLED("atlas.patch.reindex.enabled", false);
REBUILD_INDEX("atlas.rebuild.index", false);
private static final Configuration APPLICATION_PROPERTIES;
......
......@@ -23,6 +23,7 @@ import org.apache.atlas.pc.WorkItemBuilder;
import org.apache.atlas.pc.WorkItemConsumer;
import org.apache.atlas.pc.WorkItemManager;
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.AtlasGraph;
import org.apache.atlas.repository.graphdb.AtlasVertex;
......@@ -53,7 +54,8 @@ public class ReIndexPatch extends AtlasPatchHandler {
@Override
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;
}
......@@ -113,8 +115,8 @@ public class ReIndexPatch extends AtlasPatchHandler {
}
private static void edges(WorkItemManager manager, AtlasGraph graph) {
Iterable<Object> iterable = graph.getEdges();
for (Iterator<Object> iter = iterable.iterator(); iter.hasNext(); ) {
Iterable<AtlasEdge> iterable = graph.getEdges();
for (Iterator<AtlasEdge> iter = iterable.iterator(); iter.hasNext(); ) {
manager.checkProduce(iter.next());
}
}
......@@ -144,9 +146,9 @@ public class ReIndexPatch extends AtlasPatchHandler {
}
private static class ReindexConsumer extends WorkItemConsumer<AtlasElement> {
private List<AtlasElement> list = new ArrayList();
private AtlasGraph graph;
private String[] indexNames;
private final List<AtlasElement> list = new ArrayList();
private final String[] indexNames;
private final AtlasGraph graph;
private final AtomicLong counter;
public ReindexConsumer(BlockingQueue queue, AtlasGraph graph, String[] indexNames) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment