2222import io .javaoperatorsdk .operator .processing .event .ResourceID ;
2323import io .javaoperatorsdk .operator .processing .event .source .ResourceAction ;
2424
25- @ SuppressWarnings ("unused" )
2625public class MDCUtils {
2726
2827 private static final String NAME = "resource.name" ;
@@ -58,11 +57,6 @@ public static void removeInformerEventInfo() {
5857 }
5958 }
6059
61- public static void withMDCForEvent (
62- HasMetadata resource , Runnable runnable , String eventSourceName ) {
63- withMDCForEvent (resource , null , runnable , eventSourceName );
64- }
65-
6660 public static void withMDCForEvent (
6761 HasMetadata resource , ResourceAction action , Runnable runnable , String eventSourceName ) {
6862 try {
@@ -73,24 +67,6 @@ public static void withMDCForEvent(
7367 }
7468 }
7569
76- public static void withMDCForResourceID (ResourceID resourceID , Runnable runnable ) {
77- try {
78- MDCUtils .addResourceIDInfo (resourceID );
79- runnable .run ();
80- } finally {
81- MDCUtils .removeResourceIDInfo ();
82- }
83- }
84-
85- public static void withMDCForPrimary (HasMetadata primary , Runnable runnable ) {
86- try {
87- MDCUtils .addResourceInfo (primary );
88- runnable .run ();
89- } finally {
90- MDCUtils .removeResourceInfo ();
91- }
92- }
93-
9470 public static void addResourceIDInfo (ResourceID resourceID ) {
9571 if (enabled ) {
9672 MDC .put (NAME , resourceID .getName ());
0 commit comments