2727public class PrimaryUpdateAndCacheUtils {
2828
2929 public static final int DEFAULT_MAX_RETRY = 10 ;
30- public static final int RESOURCE_CACHE_POLL_TIMEOUT = 10000 ;
31- public static final int DEFAULT_SLEEP_FOR_CACHE_POLL_MILLIS = 50 ;
30+ public static final int DEFAULT_RESOURCE_CACHE_TIMEOUT_MILLIS = 10000 ;
31+ public static final int DEFAULT_RESOURCE_CACHE_POLL_PERIOD_MILLIS = 50 ;
3232
3333 private PrimaryUpdateAndCacheUtils () {}
3434
@@ -115,8 +115,8 @@ public static <P extends HasMetadata> P updateAndCacheResource(
115115 modificationFunction ,
116116 updateMethod ,
117117 DEFAULT_MAX_RETRY ,
118- RESOURCE_CACHE_POLL_TIMEOUT ,
119- DEFAULT_SLEEP_FOR_CACHE_POLL_MILLIS );
118+ DEFAULT_RESOURCE_CACHE_TIMEOUT_MILLIS ,
119+ DEFAULT_RESOURCE_CACHE_POLL_PERIOD_MILLIS );
120120 }
121121
122122 /**
@@ -134,12 +134,12 @@ public static <P extends HasMetadata> P updateAndCacheResource(
134134 * @param modificationFunction modifications to make on primary
135135 * @param updateMethod the update method implementation
136136 * @param maxRetry maximum number of retries before giving up
137- * @param cachePollTimeoutMillis maximum amount of milliseconds to wait for the updated resource to appear in cache
137+ * @param cachePollTimeoutMillis maximum amount of milliseconds to wait for the updated resource
138+ * to appear in cache
138139 * @param cachePollPeriodMillis cache polling period, in milliseconds
139140 * @param <P> primary type
140141 * @return the updated resource
141142 */
142- @ SuppressWarnings ("unchecked" )
143143 public static <P extends HasMetadata > P updateAndCacheResource (
144144 P resourceToUpdate ,
145145 Context <P > context ,
@@ -194,7 +194,8 @@ public static <P extends HasMetadata> P updateAndCacheResource(
194194 resourceToUpdate .getMetadata ().getNamespace (),
195195 e .getCode ());
196196 resourceToUpdate =
197- pollLocalCache (context , resourceToUpdate , cachePollTimeoutMillis , cachePollPeriodMillis );
197+ pollLocalCache (
198+ context , resourceToUpdate , cachePollTimeoutMillis , cachePollPeriodMillis );
198199 }
199200 }
200201 }
0 commit comments