1212import io .kubernetes .client .models .V1Volume ;
1313import io .kubernetes .client .models .V1VolumeMount ;
1414import java .util .List ;
15- import java .util .Map ;
16- import java .util .concurrent .atomic .AtomicBoolean ;
17- import javax .validation .constraints .NotNull ;
1815import oracle .kubernetes .operator .JobWatcher ;
1916import oracle .kubernetes .operator .LabelConstants ;
2017import oracle .kubernetes .operator .ProcessingConstants ;
2118import oracle .kubernetes .operator .TuningParameters ;
22- import oracle .kubernetes .operator .TuningParameters .WatchTuning ;
2319import oracle .kubernetes .operator .calls .CallResponse ;
2420import oracle .kubernetes .operator .logging .LoggingFacade ;
2521import oracle .kubernetes .operator .logging .LoggingFactory ;
@@ -115,32 +111,18 @@ List<V1EnvVar> getConfiguredEnvVars(TuningParameters tuningParameters) {
115111 /**
116112 * Factory for {@link Step} that creates WebLogic domain introspector job.
117113 *
118- * @param tuning Watch tuning parameters
119114 * @param next Next processing step
120- * @param jws Map of JobWatcher objects, keyed by the string value of the name of a namespace
121- * @param isStopping Stop signal
122115 * @return Step for creating job
123116 */
124- public static Step createDomainIntrospectorJobStep (
125- WatchTuning tuning ,
126- Step next ,
127- @ NotNull Map <String , JobWatcher > jws ,
128- @ NotNull AtomicBoolean isStopping ) {
117+ public static Step createDomainIntrospectorJobStep (Step next ) {
129118
130- return new DomainIntrospectorJobStep (tuning , next , jws , isStopping );
119+ return new DomainIntrospectorJobStep (next );
131120 }
132121
133122 static class DomainIntrospectorJobStep extends Step {
134- private final WatchTuning tuning ;
135- private final Map <String , JobWatcher > jws ;
136- private final AtomicBoolean isStopping ;
137123
138- DomainIntrospectorJobStep (
139- WatchTuning tuning , Step next , Map <String , JobWatcher > jws , AtomicBoolean isStopping ) {
124+ DomainIntrospectorJobStep (Step next ) {
140125 super (next );
141- this .tuning = tuning ;
142- this .jws = jws ;
143- this .isStopping = isStopping ;
144126 }
145127
146128 @ Override
@@ -149,12 +131,12 @@ public NextAction apply(Packet packet) {
149131 if (runIntrospector (packet , info )) {
150132 JobStepContext context = new DomainIntrospectorJobStepContext (info , packet );
151133
152- packet .putIfAbsent (START_TIME , Long . valueOf ( System .currentTimeMillis () ));
134+ packet .putIfAbsent (START_TIME , System .currentTimeMillis ());
153135
154136 return doNext (
155137 context .createNewJob (
156138 readDomainIntrospectorPodLogStep (
157- tuning , ConfigMapHelper .createSitConfigMapStep (getNext ()), jws , isStopping )),
139+ ConfigMapHelper .createSitConfigMapStep (getNext ()))),
158140 packet );
159141 }
160142
@@ -167,10 +149,7 @@ private static boolean runIntrospector(Packet packet, DomainPresenceInfo info) {
167149 LOGGER .fine ("runIntrospector topology: " + config );
168150 LOGGER .fine ("runningServersCount: " + runningServersCount (info ));
169151 LOGGER .fine ("creatingServers: " + creatingServers (info ));
170- if (config == null || (runningServersCount (info ) == 0 && creatingServers (info ))) {
171- return true ;
172- }
173- return false ;
152+ return config == null || (runningServersCount (info ) == 0 && creatingServers (info ));
174153 }
175154
176155 private static int runningServersCount (DomainPresenceInfo info ) {
@@ -180,7 +159,7 @@ private static int runningServersCount(DomainPresenceInfo info) {
180159 /**
181160 * TODO: Enhance determination of when we believe we're creating WLS managed server pods.
182161 *
183- * @param info
162+ * @param info the domain presence info
184163 * @return True, if creating servers
185164 */
186165 static boolean creatingServers (DomainPresenceInfo info ) {
@@ -262,43 +241,35 @@ String getJobDeletedMessageKey() {
262241 return MessageKeys .JOB_DELETED ;
263242 }
264243
265- protected void logJobDeleted (String domainUID , String namespace , String jobName ) {
244+ void logJobDeleted (String domainUID , String namespace , String jobName ) {
266245 LOGGER .info (getJobDeletedMessageKey (), domainUID , namespace , jobName );
267246 }
268247
269248 private Step deleteJob (Step next ) {
270249 String jobName = JobHelper .createJobName (this .domainUID );
271250 logJobDeleted (this .domainUID , namespace , jobName );
272- Step step =
273- new CallBuilder ()
274- .deleteJobAsync (
275- jobName ,
276- this .namespace ,
277- new V1DeleteOptions ().propagationPolicy ("Foreground" ),
278- new DefaultResponseStep <>(next ));
279- return step ;
251+ return new CallBuilder ()
252+ .deleteJobAsync (
253+ jobName ,
254+ this .namespace ,
255+ new V1DeleteOptions ().propagationPolicy ("Foreground" ),
256+ new DefaultResponseStep <>(next ));
280257 }
281258 }
282259
283- private static Step createWatchDomainIntrospectorJobReadyStep (
284- WatchTuning tuning , Step next , Map <String , JobWatcher > jws , AtomicBoolean isStopping ) {
285- return new WatchDomainIntrospectorJobReadyStep (tuning , next , jws , isStopping );
260+ private static Step createWatchDomainIntrospectorJobReadyStep (Step next ) {
261+ return new WatchDomainIntrospectorJobReadyStep (next );
286262 }
287263
288264 /**
289265 * Factory for {@link Step} that reads WebLogic domain introspector job results from pod's log.
290266 *
291- * @param tuning Watch tuning parameters
292267 * @param next Next processing step
293268 * @return Step for reading WebLogic domain introspector pod log
294269 */
295- static Step readDomainIntrospectorPodLogStep (
296- WatchTuning tuning , Step next , Map <String , JobWatcher > jws , AtomicBoolean isStopping ) {
270+ private static Step readDomainIntrospectorPodLogStep (Step next ) {
297271 return createWatchDomainIntrospectorJobReadyStep (
298- tuning ,
299- readDomainIntrospectorPodStep (new ReadDomainIntrospectorPodLogStep (next )),
300- jws ,
301- isStopping );
272+ readDomainIntrospectorPodStep (new ReadDomainIntrospectorPodLogStep (next )));
302273 }
303274
304275 private static class ReadDomainIntrospectorPodLogStep extends Step {
@@ -318,16 +289,14 @@ public NextAction apply(Packet packet) {
318289 }
319290
320291 private Step readDomainIntrospectorPodLog (String jobPodName , String namespace , Step next ) {
321- Step step =
322- new CallBuilder ()
323- .readPodLogAsync (
324- jobPodName , namespace , new ReadDomainIntrospectorPodLogResponseStep (next ));
325- return step ;
292+ return new CallBuilder ()
293+ .readPodLogAsync (
294+ jobPodName , namespace , new ReadDomainIntrospectorPodLogResponseStep (next ));
326295 }
327296 }
328297
329298 private static class ReadDomainIntrospectorPodLogResponseStep extends ResponseStep <String > {
330- public ReadDomainIntrospectorPodLogResponseStep (Step nextStep ) {
299+ ReadDomainIntrospectorPodLogResponseStep (Step nextStep ) {
331300 super (nextStep );
332301 }
333302
@@ -376,7 +345,7 @@ private void cleanupJobArtifacts(Packet packet) {
376345 * @param next Next processing step
377346 * @return Step for reading WebLogic domain introspector pod
378347 */
379- public static Step readDomainIntrospectorPodStep (Step next ) {
348+ private static Step readDomainIntrospectorPodStep (Step next ) {
380349 return new ReadDomainIntrospectorPodStep (next );
381350 }
382351
@@ -396,24 +365,18 @@ public NextAction apply(Packet packet) {
396365 }
397366
398367 private Step readDomainIntrospectorPod (String domainUID , String namespace , Step next ) {
399-
400- Step step =
401- new CallBuilder ()
402- .withLabelSelectors (LabelConstants .JOBNAME_LABEL )
403- .listPodAsync (namespace , new PodListStep (domainUID , namespace , next ));
404-
405- return step ;
368+ return new CallBuilder ()
369+ .withLabelSelectors (LabelConstants .JOBNAME_LABEL )
370+ .listPodAsync (namespace , new PodListStep (domainUID , namespace , next ));
406371 }
407372 }
408373
409374 private static class PodListStep extends ResponseStep <V1PodList > {
410- private final String ns ;
411375 private final String domainUID ;
412376
413377 PodListStep (String domainUID , String ns , Step next ) {
414378 super (next );
415379 this .domainUID = domainUID ;
416- this .ns = ns ;
417380 }
418381
419382 @ Override
0 commit comments