Skip to content

Commit

Permalink
Clean up logging around indexing tasks
Browse files Browse the repository at this point in the history
- lower level of some log lines which are not very useful
- remove commented out code
  • Loading branch information
Enet4 committed May 23, 2024
1 parent 471e530 commit ba52762
Showing 1 changed file with 6 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -454,15 +454,13 @@ public List<String> getQueryProvidersName(boolean enabled) {
for (QueryInterface p : plugins) {
names.add(p.getName());
}
// logger.info("Query Providers: "+Arrays.toString(names.toArray()) );
return names;
}

public QueryInterface getQueryProviderByName(String name, boolean onlyEnabled) {
Collection<QueryInterface> plugins = getQueryPlugins(onlyEnabled);
for (QueryInterface p : plugins) {
if (p.getName().equalsIgnoreCase(name)) {
// logger.info("Retrived Query Provider: "+name);
return p;
}
}
Expand Down Expand Up @@ -494,7 +492,6 @@ public IndexerInterface getIndexerByName(String name, boolean onlyEnabled) {
Collection<IndexerInterface> plugins = getIndexingPlugins(onlyEnabled);
for (IndexerInterface p : plugins) {
if (p.getName().equalsIgnoreCase(name)) {
// logger.info("Retrived Query Provider: "+name);
return p;
}
}
Expand All @@ -507,7 +504,6 @@ public JettyPluginInterface getServletByName(String name, boolean onlyEnabled) {
Collection<JettyPluginInterface> plugins = getServletPlugins(onlyEnabled);
for (JettyPluginInterface p : plugins) {
if (p.getName().equalsIgnoreCase(name)) {
// logger.info("Retrived Query Provider: "+name);
return p;
}
}
Expand All @@ -519,7 +515,6 @@ public StorageInterface getStorageByName(String name, boolean onlyEnabled) {
Collection<StorageInterface> plugins = getStoragePlugins(onlyEnabled);
for (StorageInterface p : plugins) {
if (p.getName().equalsIgnoreCase(name)) {
// logger.info("Retrived Query Provider: "+name);
return p;
}
}
Expand All @@ -535,7 +530,6 @@ public JointQueryTask queryAll(JointQueryTask holder, final String query, final

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

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

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

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

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

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

}
});
// logger.info("Prepared Query Task: QueryString");
return queryTask;
}

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

}
});
// logger.info("Prepared Query Task: QueryString");
return queryTask;
}

Expand Down Expand Up @@ -687,11 +676,8 @@ public List<Task<Report>> index(URI path) {
continue;
final String taskUniqueID = UUID.randomUUID().toString();
task.setName(String.format("[%s]index %s", indexer.getName(), path));
task.onCompletion(new Runnable() {
@Override
public void run() {
logger.info("Task [{}] complete: {} is indexed", taskUniqueID, pathF);
}
task.onCompletion(() -> {
logger.info("Task [{}] complete on {}", taskUniqueID, pathF);
});

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

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

@Override
public void run() {
logger.info("Task [{}] complete: {} is indexed", taskUniqueID, pathF);
logger.info("Task [{}] complete on {}", taskUniqueID, pathF);
}
});

taskManager.dispatch(task);

rettasks.add(task);
logger.info("Fired indexer {} for URI {}", pluginName, path.toString());
logger.debug("Fired indexer {} for URI {}", pluginName, path.toString());
RunningIndexTasks.getInstance().addTask(task);
}
} catch (RuntimeException ex) {
Expand Down Expand Up @@ -790,7 +776,7 @@ public void remove(URI uri) {
}

public void doRemove(URI uri, StorageInterface si) {
if (si.handles(uri)) {
if (Objects.equals(si.getScheme(), uri.getScheme())) {
si.remove(uri);
} else {
logger.warn("Storage Plugin does not handle URI: {},{}", uri, si);
Expand Down

0 comments on commit ba52762

Please sign in to comment.