Search in sources :

Example 1 with IssueEventBuilder

use of org.apache.gobblin.runtime.troubleshooter.IssueEventBuilder in project incubator-gobblin by apache.

the class AutomaticTroubleshooterImpl method reportJobIssuesAsEvents.

@Override
public void reportJobIssuesAsEvents(EventSubmitter eventSubmitter) throws TroubleshooterException {
    if (config.isDisableEventReporting()) {
        log.info("Troubleshooter will not report issues as GobblinTrackingEvents. Remove the following property to re-enable it: " + ConfigurationKeys.TROUBLESHOOTER_DISABLE_EVENT_REPORTING);
        return;
    }
    List<Issue> issues = issueRepository.getAll();
    log.info("Reporting troubleshooter issues as Gobblin tracking events. Issue count: " + issues.size());
    for (Issue issue : issues) {
        IssueEventBuilder eventBuilder = new IssueEventBuilder(IssueEventBuilder.JOB_ISSUE);
        eventBuilder.setIssue(issue);
        eventSubmitter.submit(eventBuilder);
    }
}
Also used : IssueEventBuilder(org.apache.gobblin.runtime.troubleshooter.IssueEventBuilder) Issue(org.apache.gobblin.runtime.troubleshooter.Issue)

Example 2 with IssueEventBuilder

use of org.apache.gobblin.runtime.troubleshooter.IssueEventBuilder in project gobblin by apache.

the class AutomaticTroubleshooterImpl method reportJobIssuesAsEvents.

@Override
public void reportJobIssuesAsEvents(EventSubmitter eventSubmitter) throws TroubleshooterException {
    if (config.isDisableEventReporting()) {
        log.info("Troubleshooter will not report issues as GobblinTrackingEvents. Remove the following property to re-enable it: " + ConfigurationKeys.TROUBLESHOOTER_DISABLE_EVENT_REPORTING);
        return;
    }
    List<Issue> issues = issueRepository.getAll();
    log.info("Reporting troubleshooter issues as Gobblin tracking events. Issue count: " + issues.size());
    for (Issue issue : issues) {
        IssueEventBuilder eventBuilder = new IssueEventBuilder(IssueEventBuilder.JOB_ISSUE);
        eventBuilder.setIssue(issue);
        eventSubmitter.submit(eventBuilder);
    }
}
Also used : IssueEventBuilder(org.apache.gobblin.runtime.troubleshooter.IssueEventBuilder) Issue(org.apache.gobblin.runtime.troubleshooter.Issue)

Aggregations

Issue (org.apache.gobblin.runtime.troubleshooter.Issue)2 IssueEventBuilder (org.apache.gobblin.runtime.troubleshooter.IssueEventBuilder)2