Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up logging around indexing tasks #691

Merged
merged 2 commits into from
May 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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())) {
Enet4 marked this conversation as resolved.
Show resolved Hide resolved
si.remove(uri);
} else {
logger.warn("Storage Plugin does not handle URI: {},{}", uri, si);
Expand Down
Loading