48
48
*
49
49
*/
50
50
public class CallBuilder {
51
- static final String RESPONSE_COMPONENT_NAME = "response" ;
52
-
53
51
private static final LoggingFacade LOGGER = LoggingFactory .getLogger ("Operator" , "Operator" );
54
52
53
+ static final String RESPONSE_COMPONENT_NAME = "response" ;
54
+
55
+ private static int callRequestLimit = 500 ;
56
+ private static int callMaxRetryCount = 5 ;
57
+ private static int callTimeoutSeconds = 10 ;
58
+
59
+ public static void setTuningParameters (int callRequestLimit , int callMaxRetryCount , int callTimeoutSeconds ) {
60
+ CallBuilder .callRequestLimit = callRequestLimit ;
61
+ CallBuilder .callMaxRetryCount = callMaxRetryCount ;
62
+ CallBuilder .callTimeoutSeconds = callTimeoutSeconds ;
63
+ }
64
+
55
65
/**
56
66
* HTTP status code for "Not Found"
57
67
*/
@@ -65,9 +75,10 @@ public class CallBuilder {
65
75
public String fieldSelector = "" ;
66
76
public Boolean includeUninitialized = Boolean .FALSE ;
67
77
public String labelSelector = "" ;
68
- public Integer limit = 500 ;
78
+ public Integer limit = callRequestLimit ;
69
79
public String resourceVersion = "" ;
70
- public Integer timeoutSeconds = 30 ;
80
+ public Integer timeoutSeconds = callTimeoutSeconds ;
81
+ public Integer maxRetryCount = callMaxRetryCount ;
71
82
public Boolean watch = Boolean .FALSE ;
72
83
public Boolean exact = Boolean .FALSE ;
73
84
public Boolean export = Boolean .FALSE ;
@@ -1446,7 +1457,7 @@ public NextAction doPotentialRetry(Step conflictStep, Packet packet, ApiExceptio
1446
1457
}
1447
1458
1448
1459
NextAction na = new NextAction ();
1449
- if (statusCode == 0 && retryCount <= 2 ) {
1460
+ if (statusCode == 0 && retryCount <= maxRetryCount ) {
1450
1461
na .invoke (retryStep , packet );
1451
1462
} else {
1452
1463
LOGGER .info (MessageKeys .ASYNC_RETRY , String .valueOf (waitTime ));
0 commit comments