mirror of https://github.com/apache/druid.git
avoid throwing exceptions fix#3389 (#3441)
* avoid throwing exceptions * log alert * fix comments
This commit is contained in:
parent
d108461838
commit
6a1cd7fc66
|
@ -57,7 +57,7 @@ public class GraphiteEmitter implements Emitter
|
|||
.setDaemon(true)
|
||||
.setNameFormat("GraphiteEmitter-%s")
|
||||
.build()); // Thread pool of two in order to schedule flush runnable
|
||||
private AtomicLong countLostEvents = new AtomicLong(0);
|
||||
private AtomicLong countLostEvents = new AtomicLong(0);
|
||||
|
||||
public GraphiteEmitter(
|
||||
GraphiteEmitterConfig graphiteEmitterConfig,
|
||||
|
@ -117,14 +117,19 @@ public class GraphiteEmitter implements Emitter
|
|||
catch (InterruptedException e) {
|
||||
log.error(e, "got interrupted with message [%s]", e.getMessage());
|
||||
Thread.currentThread().interrupt();
|
||||
|
||||
}
|
||||
} else if (!emitterList.isEmpty() && event instanceof AlertEvent) {
|
||||
for (Emitter emitter : emitterList) {
|
||||
emitter.emit(event);
|
||||
}
|
||||
} else if (event instanceof AlertEvent) {
|
||||
AlertEvent alertEvent = (AlertEvent) event;
|
||||
log.error(
|
||||
"The following alert is dropped, description is [%s], severity is [%s]",
|
||||
alertEvent.getDescription(), alertEvent.getSeverity()
|
||||
);
|
||||
} else {
|
||||
throw new ISE("unknown event type [%s]", event.getClass());
|
||||
log.error("unknown event type [%s]", event.getClass());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -168,7 +173,7 @@ public class GraphiteEmitter implements Emitter
|
|||
log.error(e, e.getMessage());
|
||||
if (e instanceof InterruptedException) {
|
||||
Thread.currentThread().interrupt();
|
||||
} else if (e instanceof SocketException){
|
||||
} else if (e instanceof SocketException) {
|
||||
pickledGraphite.connect();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue