Skip to content

Commit 4c1a5cf

Browse files
committed
Update indexer orders
1 parent 01da822 commit 4c1a5cf

File tree

3 files changed

+33
-32
lines changed

3 files changed

+33
-32
lines changed

agr_indexer/src/main/java/org/alliancegenome/indexer/Main.java

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,7 @@ public static void main(String[] args) {
6868
log.info("Args[" + i + "]: " + args[i]);
6969
}
7070

71-
ExecutorService parallelExecutor = Executors.newFixedThreadPool(10);
7271
ExecutorService sequentialExecutor = Executors.newFixedThreadPool(1);
73-
74-
for (String type : parallelMap.keySet()) {
75-
if (argumentSet.size() == 0 || argumentSet.contains(type)) {
76-
log.info("Running Parallel for: " + type);
77-
parallelExecutor.execute(indexers.get(type));
78-
//indexers.get(type).start();
79-
} else {
80-
log.info("Not Starting: " + type);
81-
}
82-
}
8372

8473
for (String type : sequentialMap.keySet()) {
8574
if (argumentSet.size() == 0 || argumentSet.contains(type)) {
@@ -90,29 +79,41 @@ public static void main(String[] args) {
9079
log.info("Not Starting: " + type);
9180
}
9281
}
93-
94-
parallelExecutor.shutdown();
95-
while (!parallelExecutor.isTerminated()) {
82+
sequentialExecutor.shutdown();
83+
while (!sequentialExecutor.isTerminated()) {
9684
try {
9785
Thread.sleep(1000);
9886
} catch (InterruptedException e) {
9987
ExceptionCatcher.report(e);
10088
e.printStackTrace();
10189
}
10290
}
103-
log.info("Finished Running Curation Indexers");
104-
sequentialExecutor.shutdown();
105-
while (!sequentialExecutor.isTerminated()) {
91+
log.info("Finished Running Sequential Indexers");
92+
93+
94+
ExecutorService parallelExecutor = Executors.newFixedThreadPool(10);
95+
96+
for (String type : parallelMap.keySet()) {
97+
if (argumentSet.size() == 0 || argumentSet.contains(type)) {
98+
log.info("Running Parallel for: " + type);
99+
parallelExecutor.execute(indexers.get(type));
100+
//indexers.get(type).start();
101+
} else {
102+
log.info("Not Starting: " + type);
103+
}
104+
}
105+
parallelExecutor.shutdown();
106+
while (!parallelExecutor.isTerminated()) {
106107
try {
107108
Thread.sleep(1000);
108109
} catch (InterruptedException e) {
109110
ExceptionCatcher.report(e);
110111
e.printStackTrace();
111112
}
112113
}
113-
log.info("Finished Running Neo4j Indexers");
114+
log.info("Finished Running Parallel Indexers");
114115

115-
log.debug("Waiting for Indexers to finish");
116+
log.debug("Waiting for ALL Indexers to finish");
116117
for (Indexer i : indexers.values()) {
117118
try {
118119
if (i.isAlive()) {

agr_indexer/src/main/java/org/alliancegenome/indexer/TestSpeciesOrder.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void main(String[] args) throws Exception {
3030
String taxonCurie = species.getTaxon() != null ? species.getTaxon().getCurie() : "null";
3131
Integer order = species.getPhylogeneticOrder();
3232
String fullName = species.getFullName();
33-
System.out.println(" " + fullName + " | taxon: " + taxonCurie + " | phylogeneticOrder: " + order);
33+
System.out.println(fullName + " | taxon: " + taxonCurie + " | phylogeneticOrder: " + order);
3434

3535
if (species.getTaxon() != null && order != null) {
3636
String taxonIdPart = taxonCurie.replace("NCBITaxon:", "");
@@ -41,15 +41,15 @@ public static void main(String[] args) throws Exception {
4141
System.out.println("\n=== Species order lookup map ===");
4242
speciesOrderLookup.entrySet().stream()
4343
.sorted(Map.Entry.comparingByValue())
44-
.forEach(e -> System.out.println(" " + e.getKey() + " -> " + e.getValue()));
44+
.forEach(e -> System.out.println(e.getKey() + " -> " + e.getValue()));
4545

4646
// Test buildSpeciesOrder for a specific taxon (e.g. Xenopus laevis 8355)
4747
String testTaxon = args.length > 0 ? args[0] : "NCBITaxon:8355";
4848
System.out.println("\n=== buildSpeciesOrder for " + testTaxon + " ===");
4949
HashMap<String, Integer> speciesOrder = buildSpeciesOrder(speciesOrderLookup, testTaxon);
5050
speciesOrder.entrySet().stream()
5151
.sorted(Map.Entry.comparingByValue())
52-
.forEach(e -> System.out.println(" " + e.getKey() + " -> " + e.getValue()));
52+
.forEach(e -> System.out.println(e.getKey() + " -> " + e.getValue()));
5353

5454
System.out.println("\nDone.");
5555
}

agr_indexer/src/main/java/org/alliancegenome/indexer/config/IndexerConfig.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public enum IndexerConfig {
3030

3131
// Curation Indexers
3232

33+
// Run Sequentially -- typically take a lot of RAM or do consolidation in memory
34+
ReleaseInfoIndexer("release", ReleaseInfoIndexer.class, 1, 1, 1, 1, 1, false),
35+
3336
// Run Parallelly
3437
ParalogyIndexer("paralogy", GeneToGeneParalogyIndexer.class, 4, 5000, 5000, 8, 1, true),
3538
AffectedGenomicModelAnnotationIndexer("agmAnnotation", AGMAnnotationCurationIndexer.class, 4, 1500, 1500, 8, 1, true),
@@ -44,16 +47,13 @@ public enum IndexerConfig {
4447
DiseaseSummaryIndexer("diseaseSummary", DiseaseSummaryCurationIndexer.class, 4, 1500, 1500, 4, 1, true),
4548
TransgenicAlleleIndexer("transgenicAlleles", TransgenicAlleleCurationIndexer.class, 1, 3000, 1500, 8, 1, true),
4649
GeneExpressionRibbonSummaryIndexer("geneExpressionRibbonSummary", GeneExpressionRibbonSummaryIndexer.class, 1, 1, 1, 1, 1, true),
47-
ReleaseInfoIndexer("release", ReleaseInfoIndexer.class, 1, 1, 1, 1, 1, true),
48-
49-
// Run Sequentially -- typically take a lot of RAM or do consolidation in memory
50-
DiseaseSearchResultIndexer("diseaseSearchResult", DiseaseSearchResultCurationIndexer.class, 8, 50, 50, 4, 1, false),
51-
GOSearchResultCurationIndexer("goSearchResult", GOSearchResultCurationIndexer.class, 4, 1500, 1500, 4, 1, false),
52-
AlleleSummaryIndexer("alleleSummary", AlleleSummaryCurationIndexer.class, 4, 1500, 1500, 4, 1, false),
53-
GeneToGeneOrthologyIndexer("geneToGeneOrthology", GeneToGeneOrthologyIndexer.class, 4, 2500, 2500, 8, 1, false),
54-
GeneMolecularInteractionIndexers("geneMolecularInteraction", GeneMolecularInteractionCurationIndexer.class, 4, 1500, 1500, 2, 1, false),
55-
PhenotypeAnnotationIndexer("phenotypeAnnotation", PhenotypeAnnotationCurationIndexer.class, 4, 1500, 1500, 2, 1, false),
56-
DiseaseAnnotationIndexer("diseaseAnnotation", DiseaseAnnotationCurationIndexer.class, 1, 1500, 1500, 2, 1, false),
50+
DiseaseSearchResultIndexer("diseaseSearchResult", DiseaseSearchResultCurationIndexer.class, 8, 50, 50, 4, 1, true),
51+
GOSearchResultCurationIndexer("goSearchResult", GOSearchResultCurationIndexer.class, 4, 1500, 1500, 4, 1, true),
52+
AlleleSummaryIndexer("alleleSummary", AlleleSummaryCurationIndexer.class, 4, 1500, 1500, 4, 1, true),
53+
GeneToGeneOrthologyIndexer("geneToGeneOrthology", GeneToGeneOrthologyIndexer.class, 4, 2500, 2500, 8, 1, true),
54+
GeneMolecularInteractionIndexers("geneMolecularInteraction", GeneMolecularInteractionCurationIndexer.class, 4, 1500, 1500, 2, 1, true),
55+
PhenotypeAnnotationIndexer("phenotypeAnnotation", PhenotypeAnnotationCurationIndexer.class, 4, 1500, 1500, 2, 1, true),
56+
DiseaseAnnotationIndexer("diseaseAnnotation", DiseaseAnnotationCurationIndexer.class, 1, 1500, 1500, 2, 1, true),
5757
;
5858

5959
private String typeName;

0 commit comments

Comments
 (0)