Class EventRecorder
- java.lang.Object
-
- org.apache.flink.kubernetes.operator.utils.EventRecorder
-
public class EventRecorder extends java.lang.Object
Helper class for creating Kubernetes events for Flink resources.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EventRecorder.Component
The component of events.static class
EventRecorder.Reason
The reason codes of events.static class
EventRecorder.Type
The type of the events.
-
Constructor Summary
Constructors Constructor Description EventRecorder(java.util.function.BiConsumer<AbstractFlinkResource<?,?>,io.fabric8.kubernetes.api.model.Event> eventListenerFlinkResource, java.util.function.BiConsumer<FlinkStateSnapshot,io.fabric8.kubernetes.api.model.Event> eventListenerFlinkStateSnapshot)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EventRecorder
create(io.fabric8.kubernetes.client.KubernetesClient client, java.util.Collection<FlinkResourceListener> listeners)
boolean
triggerEvent(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, io.fabric8.kubernetes.client.KubernetesClient client)
boolean
triggerEvent(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client)
boolean
triggerEvent(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, EventRecorder.Reason reason, java.lang.String message, EventRecorder.Component component, java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client)
boolean
triggerEvent(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, EventRecorder.Reason reason, EventRecorder.Component component, java.lang.String message, io.fabric8.kubernetes.client.KubernetesClient client)
boolean
triggerEventOnce(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client)
boolean
triggerEventOnce(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, EventRecorder.Reason reason, java.lang.String message, EventRecorder.Component component, java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client)
boolean
triggerEventWithInterval(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client, java.time.Duration interval)
boolean
triggerEventWithLabels(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client, java.time.Duration interval, java.util.function.Predicate<java.util.Map<java.lang.String,java.lang.String>> dedupePredicate, java.util.Map<java.lang.String,java.lang.String> labels)
boolean
triggerSnapshotEvent(FlinkStateSnapshot resource, EventRecorder.Type type, EventRecorder.Reason reason, EventRecorder.Component component, java.lang.String message, io.fabric8.kubernetes.client.KubernetesClient client)
-
-
-
Constructor Detail
-
EventRecorder
public EventRecorder(java.util.function.BiConsumer<AbstractFlinkResource<?,?>,io.fabric8.kubernetes.api.model.Event> eventListenerFlinkResource, java.util.function.BiConsumer<FlinkStateSnapshot,io.fabric8.kubernetes.api.model.Event> eventListenerFlinkStateSnapshot)
-
-
Method Detail
-
triggerSnapshotEvent
public boolean triggerSnapshotEvent(FlinkStateSnapshot resource, EventRecorder.Type type, EventRecorder.Reason reason, EventRecorder.Component component, java.lang.String message, io.fabric8.kubernetes.client.KubernetesClient client)
-
triggerEvent
public boolean triggerEvent(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, EventRecorder.Reason reason, EventRecorder.Component component, java.lang.String message, io.fabric8.kubernetes.client.KubernetesClient client)
-
triggerEventOnce
public boolean triggerEventOnce(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, EventRecorder.Reason reason, java.lang.String message, EventRecorder.Component component, java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client)
-
triggerEvent
public boolean triggerEvent(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, EventRecorder.Reason reason, java.lang.String message, EventRecorder.Component component, @Nullable java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client)
-
triggerEvent
public boolean triggerEvent(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client)
-
triggerEventWithInterval
public boolean triggerEventWithInterval(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client, @Nullable java.time.Duration interval)
- Parameters:
interval
- Interval for dedupe. Null mean no dedupe.- Returns:
-
triggerEventOnce
public boolean triggerEventOnce(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client)
-
triggerEventWithLabels
public boolean triggerEventWithLabels(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, @Nullable java.lang.String messageKey, io.fabric8.kubernetes.client.KubernetesClient client, @Nullable java.time.Duration interval, @Nullable java.util.function.Predicate<java.util.Map<java.lang.String,java.lang.String>> dedupePredicate, @Nullable java.util.Map<java.lang.String,java.lang.String> labels)
- Parameters:
interval
- Interval for dedupe. Null mean no dedupe.dedupePredicate
- Predicate for dedupe algorithm..labels
- Labels to store in meta data for dedupe. Do nothing if null.- Returns:
-
triggerEvent
public boolean triggerEvent(AbstractFlinkResource<?,?> resource, EventRecorder.Type type, java.lang.String reason, java.lang.String message, EventRecorder.Component component, io.fabric8.kubernetes.client.KubernetesClient client)
-
create
public static EventRecorder create(io.fabric8.kubernetes.client.KubernetesClient client, java.util.Collection<FlinkResourceListener> listeners)
-
-