Remove info log and using JsonUtils to convert the Ingestion Pipeline (#14759)

This commit is contained in:
Mohit Yadav 2024-01-17 17:25:33 +05:30 committed by GitHub
parent bfbd953b53
commit 70b74d7d4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 12 deletions

View File

@ -273,14 +273,12 @@ public abstract class AbstractEventConsumer
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
// Must Have , Before Execute the Init, Quartz Requires a Non-Arg Constructor
this.init(jobExecutionContext);
// Poll Events from Change Event Table
List<ChangeEvent> batch = pollEvents(offset, 100);
int batchSize = batch.size();
try {
this.init(jobExecutionContext);
// Poll Events from Change Event Table
List<ChangeEvent> batch = pollEvents(offset, 100);
int batchSize = batch.size();
// Retry Failed Events
Set<FailedEvent> failedEventsList =
JsonUtils.convertValue(
@ -293,7 +291,9 @@ public abstract class AbstractEventConsumer
.toList();
batch.addAll(failedChangeEvents);
}
} catch (Exception e) {
LOG.error("Error in executing the Job : {} ", e.getMessage());
} finally {
if (!batch.isEmpty()) {
// Publish Events
alertMetrics.withTotalEvents(alertMetrics.getTotalEvents() + batch.size());
@ -303,9 +303,6 @@ public abstract class AbstractEventConsumer
offset += batchSize;
commit(jobExecutionContext);
}
} catch (Exception e) {
LOG.error("Error in executing the Job : {} ", e.getMessage());
} finally {
// Call stop to close the client
this.stop();
}

View File

@ -85,6 +85,6 @@ public class EmailPublisher extends AbstractEventConsumer {
@Override
public void stop() {
LOG.info("Email Publisher Stopped");
LOG.debug("Email Publisher Stopped");
}
}

View File

@ -297,7 +297,8 @@ public class AlertsRuleEvaluator {
}
for (FieldChange fieldChange : changeEvent.getChangeDescription().getFieldsUpdated()) {
if (fieldChange.getName().equals("pipelineStatus") && fieldChange.getNewValue() != null) {
PipelineStatus pipelineStatus = (PipelineStatus) fieldChange.getNewValue();
PipelineStatus pipelineStatus =
JsonUtils.convertValue(fieldChange.getNewValue(), PipelineStatus.class);
PipelineStatusType status = pipelineStatus.getPipelineState();
for (String givenStatus : pipelineState) {
if (givenStatus.equals(status.value())) {