use of org.apache.rya.indexing.pcj.fluo.client.util.QueryReportRenderer in project incubator-rya by apache.
the class QueryReportCommand method execute.
@Override
public void execute(final Connector accumulo, final String ryaTablePrefix, final RyaSailRepository rya, final FluoClient fluo, final String[] args) throws ArgumentsException, ExecutionException, UnsupportedQueryException {
checkNotNull(accumulo);
checkNotNull(ryaTablePrefix);
checkNotNull(rya);
checkNotNull(fluo);
checkNotNull(args);
log.trace("Executing the Get Query Report Command...");
// Parse the command line arguments.
final Parameters params = new Parameters();
try {
new JCommander(params, args);
} catch (final ParameterException e) {
throw new ArgumentsException("Could not create a new query because of invalid command line parameters.", e);
}
// Build the report using what is stored in Fluo.
log.trace("Building the report for Query ID: " + params.queryId);
final QueryReport queryReport = new GetQueryReport().getReport(fluo, params.queryId);
log.trace("Report built.");
// Format and print the report.
try {
final String reportString = new QueryReportRenderer().render(queryReport);
System.out.println(reportString);
} catch (final Exception e) {
throw new ExecutionException("Unable to render the query metadata report for output.", e);
}
log.trace("Finished executing the Get Query Report Command.");
}
Aggregations