Skip to content

Commit 71e1d82

Browse files
authored
Clean up logging around indexing tasks (bioinformatics-ua#691)
* Clean up logging around indexing tasks - lower level of some log lines which are not very useful - remove commented out code * Revert removal of deprecated call StorageInterface#handles - its deprecation is currently being contested
1 parent 471e530 commit 71e1d82

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

dicoogle/src/main/java/pt/ua/dicoogle/plugins/PluginController.java

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -454,15 +454,13 @@ public List<String> getQueryProvidersName(boolean enabled) {
454454
for (QueryInterface p : plugins) {
455455
names.add(p.getName());
456456
}
457-
// logger.info("Query Providers: "+Arrays.toString(names.toArray()) );
458457
return names;
459458
}
460459

461460
public QueryInterface getQueryProviderByName(String name, boolean onlyEnabled) {
462461
Collection<QueryInterface> plugins = getQueryPlugins(onlyEnabled);
463462
for (QueryInterface p : plugins) {
464463
if (p.getName().equalsIgnoreCase(name)) {
465-
// logger.info("Retrived Query Provider: "+name);
466464
return p;
467465
}
468466
}
@@ -494,7 +492,6 @@ public IndexerInterface getIndexerByName(String name, boolean onlyEnabled) {
494492
Collection<IndexerInterface> plugins = getIndexingPlugins(onlyEnabled);
495493
for (IndexerInterface p : plugins) {
496494
if (p.getName().equalsIgnoreCase(name)) {
497-
// logger.info("Retrived Query Provider: "+name);
498495
return p;
499496
}
500497
}
@@ -507,7 +504,6 @@ public JettyPluginInterface getServletByName(String name, boolean onlyEnabled) {
507504
Collection<JettyPluginInterface> plugins = getServletPlugins(onlyEnabled);
508505
for (JettyPluginInterface p : plugins) {
509506
if (p.getName().equalsIgnoreCase(name)) {
510-
// logger.info("Retrived Query Provider: "+name);
511507
return p;
512508
}
513509
}
@@ -519,7 +515,6 @@ public StorageInterface getStorageByName(String name, boolean onlyEnabled) {
519515
Collection<StorageInterface> plugins = getStoragePlugins(onlyEnabled);
520516
for (StorageInterface p : plugins) {
521517
if (p.getName().equalsIgnoreCase(name)) {
522-
// logger.info("Retrived Query Provider: "+name);
523518
return p;
524519
}
525520
}
@@ -535,7 +530,6 @@ public JointQueryTask queryAll(JointQueryTask holder, final String query, final
535530

536531
public JointQueryTask queryAll(JointQueryTask holder, final String query, final DimLevel level,
537532
final Object... parameters) {
538-
// logger.info("Querying all providers");
539533
List<String> providers = this.getQueryProvidersName(true);
540534
return query(holder, providers, query, level, parameters);
541535
}
@@ -552,7 +546,6 @@ public Task<Iterable<SearchResult>> query(String querySource, final String query
552546
final Object... parameters) {
553547
Task<Iterable<SearchResult>> t = getTaskForQueryDim(querySource, query, level, parameters);
554548
taskManagerQueries.dispatch(t);
555-
// logger.info("Fired Query Task: "+querySource +" QueryString:"+query);
556549

557550
return t;// returns the handler to obtain the computation results
558551
}
@@ -573,7 +566,6 @@ public JointQueryTask query(JointQueryTask holder, List<String> querySources, fi
573566
for (Task<?> t : tasks)
574567
taskManagerQueries.dispatch(t);
575568

576-
// logger.info("Fired Query Tasks: "+Arrays.toString(querySources.toArray()) +" QueryString:"+query);
577569
return holder;// returns the handler to obtain the computation results
578570
}
579571

@@ -593,7 +585,6 @@ public JointQueryTask query(JointQueryTask holder, List<String> querySources, fi
593585
for (Task<?> t : tasks)
594586
taskManagerQueries.dispatch(t);
595587

596-
// logger.info("Fired Query Tasks: "+Arrays.toString(querySources.toArray()) +" QueryString:"+query);
597588
return holder;// returns the handler to obtain the computation results
598589
}
599590

@@ -618,7 +609,6 @@ public Iterable<SearchResult> call() throws Exception {
618609

619610
}
620611
});
621-
// logger.info("Prepared Query Task: QueryString");
622612
return queryTask;
623613
}
624614

@@ -654,7 +644,6 @@ public Iterable<SearchResult> call() {
654644

655645
}
656646
});
657-
// logger.info("Prepared Query Task: QueryString");
658647
return queryTask;
659648
}
660649

@@ -687,11 +676,8 @@ public List<Task<Report>> index(URI path) {
687676
continue;
688677
final String taskUniqueID = UUID.randomUUID().toString();
689678
task.setName(String.format("[%s]index %s", indexer.getName(), path));
690-
task.onCompletion(new Runnable() {
691-
@Override
692-
public void run() {
693-
logger.info("Task [{}] complete: {} is indexed", taskUniqueID, pathF);
694-
}
679+
task.onCompletion(() -> {
680+
logger.info("Task [{}] complete on {}", taskUniqueID, pathF);
695681
});
696682

697683
taskManager.dispatch(task);
@@ -701,7 +687,7 @@ public void run() {
701687
logger.warn("Indexer {} failed unexpectedly", indexer.getName(), ex);
702688
}
703689
}
704-
logger.info("Finished firing all indexing plugins for {}", path);
690+
logger.debug("Finished firing all indexing plugins for {}", path);
705691

706692
return rettasks;
707693
}
@@ -728,14 +714,14 @@ public List<Task<Report>> index(String pluginName, URI path) {
728714

729715
@Override
730716
public void run() {
731-
logger.info("Task [{}] complete: {} is indexed", taskUniqueID, pathF);
717+
logger.info("Task [{}] complete on {}", taskUniqueID, pathF);
732718
}
733719
});
734720

735721
taskManager.dispatch(task);
736722

737723
rettasks.add(task);
738-
logger.info("Fired indexer {} for URI {}", pluginName, path.toString());
724+
logger.debug("Fired indexer {} for URI {}", pluginName, path.toString());
739725
RunningIndexTasks.getInstance().addTask(task);
740726
}
741727
} catch (RuntimeException ex) {

0 commit comments

Comments
 (0)