Skip to content

Commit 94c9402

Browse files
committed
Change metrics type from int to long in StepExecution
1 parent c5b45f4 commit 94c9402

File tree

15 files changed

+59
-58
lines changed

15 files changed

+59
-58
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/StepContribution.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@
2828
@SuppressWarnings("serial")
2929
public class StepContribution implements Serializable {
3030

31-
private volatile int readCount = 0;
31+
private volatile long readCount = 0;
3232

33-
private volatile int writeCount = 0;
33+
private volatile long writeCount = 0;
3434

35-
private volatile int filterCount = 0;
35+
private volatile long filterCount = 0;
3636

37-
private final int parentSkipCount;
37+
private final long parentSkipCount;
3838

39-
private volatile int readSkipCount;
39+
private volatile long readSkipCount;
4040

41-
private volatile int writeSkipCount;
41+
private volatile long writeSkipCount;
4242

43-
private volatile int processSkipCount;
43+
private volatile long processSkipCount;
4444

4545
private ExitStatus exitStatus = ExitStatus.EXECUTING;
4646

@@ -78,7 +78,7 @@ public ExitStatus getExitStatus() {
7878
*
7979
* @param count int amount to increment by.
8080
*/
81-
public void incrementFilterCount(int count) {
81+
public void incrementFilterCount(long count) {
8282
filterCount += count;
8383
}
8484

@@ -94,7 +94,7 @@ public void incrementReadCount() {
9494
*
9595
* @param count int amount to increment by.
9696
*/
97-
public void incrementWriteCount(int count) {
97+
public void incrementWriteCount(long count) {
9898
writeCount += count;
9999
}
100100

@@ -103,7 +103,7 @@ public void incrementWriteCount(int count) {
103103
*
104104
* @return the item counter.
105105
*/
106-
public int getReadCount() {
106+
public long getReadCount() {
107107
return readCount;
108108
}
109109

@@ -112,7 +112,7 @@ public int getReadCount() {
112112
*
113113
* @return the item counter.
114114
*/
115-
public int getWriteCount() {
115+
public long getWriteCount() {
116116
return writeCount;
117117
}
118118

@@ -121,15 +121,15 @@ public int getWriteCount() {
121121
*
122122
* @return the filter counter
123123
*/
124-
public int getFilterCount() {
124+
public long getFilterCount() {
125125
return filterCount;
126126
}
127127

128128
/**
129129
* @return the sum of skips accumulated in the parent {@link StepExecution}
130130
* and this <code>StepContribution</code>.
131131
*/
132-
public int getStepSkipCount() {
132+
public long getStepSkipCount() {
133133
return readSkipCount + writeSkipCount + processSkipCount + parentSkipCount;
134134
}
135135

@@ -138,7 +138,7 @@ public int getStepSkipCount() {
138138
* <code>StepContribution</code> (not including skips accumulated in the
139139
* parent {@link StepExecution}).
140140
*/
141-
public int getSkipCount() {
141+
public long getSkipCount() {
142142
return readSkipCount + writeSkipCount + processSkipCount;
143143
}
144144

@@ -154,7 +154,7 @@ public void incrementReadSkipCount() {
154154
*
155155
* @param count int amount to increment by.
156156
*/
157-
public void incrementReadSkipCount(int count) {
157+
public void incrementReadSkipCount(long count) {
158158
readSkipCount += count;
159159
}
160160

@@ -175,14 +175,14 @@ public void incrementProcessSkipCount() {
175175
/**
176176
* @return the read skip count
177177
*/
178-
public int getReadSkipCount() {
178+
public long getReadSkipCount() {
179179
return readSkipCount;
180180
}
181181

182182
/**
183183
* @return the write skip count
184184
*/
185-
public int getWriteSkipCount() {
185+
public long getWriteSkipCount() {
186186
return writeSkipCount;
187187
}
188188

@@ -191,7 +191,7 @@ public int getWriteSkipCount() {
191191
*
192192
* @return the process skip count
193193
*/
194-
public int getProcessSkipCount() {
194+
public long getProcessSkipCount() {
195195
return processSkipCount;
196196
}
197197

spring-batch-core/src/main/java/org/springframework/batch/core/StepExecution.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,19 +44,19 @@ public class StepExecution extends Entity {
4444

4545
private volatile BatchStatus status = BatchStatus.STARTING;
4646

47-
private volatile int readCount = 0;
47+
private volatile long readCount = 0;
4848

49-
private volatile int writeCount = 0;
49+
private volatile long writeCount = 0;
5050

51-
private volatile int commitCount = 0;
51+
private volatile long commitCount = 0;
5252

53-
private volatile int rollbackCount = 0;
53+
private volatile long rollbackCount = 0;
5454

55-
private volatile int readSkipCount = 0;
55+
private volatile long readSkipCount = 0;
5656

57-
private volatile int processSkipCount = 0;
57+
private volatile long processSkipCount = 0;
5858

59-
private volatile int writeSkipCount = 0;
59+
private volatile long writeSkipCount = 0;
6060

6161
private volatile Date startTime = new Date(System.currentTimeMillis());
6262

@@ -70,7 +70,7 @@ public class StepExecution extends Entity {
7070

7171
private volatile boolean terminateOnly;
7272

73-
private volatile int filterCount;
73+
private volatile long filterCount;
7474

7575
private transient volatile List<Throwable> failureExceptions = new CopyOnWriteArrayList<>();
7676

@@ -140,7 +140,7 @@ public void setExecutionContext(ExecutionContext executionContext) {
140140
*
141141
* @return the current number of commits
142142
*/
143-
public int getCommitCount() {
143+
public long getCommitCount() {
144144
return commitCount;
145145
}
146146

@@ -149,7 +149,7 @@ public int getCommitCount() {
149149
*
150150
* @param commitCount the current number of commits
151151
*/
152-
public void setCommitCount(int commitCount) {
152+
public void setCommitCount(long commitCount) {
153153
this.commitCount = commitCount;
154154
}
155155

@@ -176,7 +176,7 @@ public void setEndTime(Date endTime) {
176176
*
177177
* @return the current number of items read for this execution
178178
*/
179-
public int getReadCount() {
179+
public long getReadCount() {
180180
return readCount;
181181
}
182182

@@ -185,7 +185,7 @@ public int getReadCount() {
185185
*
186186
* @param readCount the current number of read items for this execution
187187
*/
188-
public void setReadCount(int readCount) {
188+
public void setReadCount(long readCount) {
189189
this.readCount = readCount;
190190
}
191191

@@ -194,7 +194,7 @@ public void setReadCount(int readCount) {
194194
*
195195
* @return the current number of items written for this execution
196196
*/
197-
public int getWriteCount() {
197+
public long getWriteCount() {
198198
return writeCount;
199199
}
200200

@@ -203,7 +203,7 @@ public int getWriteCount() {
203203
*
204204
* @param writeCount the current number of written items for this execution
205205
*/
206-
public void setWriteCount(int writeCount) {
206+
public void setWriteCount(long writeCount) {
207207
this.writeCount = writeCount;
208208
}
209209

@@ -212,7 +212,7 @@ public void setWriteCount(int writeCount) {
212212
*
213213
* @return the current number of rollbacks for this execution
214214
*/
215-
public int getRollbackCount() {
215+
public long getRollbackCount() {
216216
return rollbackCount;
217217
}
218218

@@ -221,7 +221,7 @@ public int getRollbackCount() {
221221
*
222222
* @return the current number of items filtered out of this execution
223223
*/
224-
public int getFilterCount() {
224+
public long getFilterCount() {
225225
return filterCount;
226226
}
227227

@@ -230,15 +230,15 @@ public int getFilterCount() {
230230
* @param filterCount the number of items filtered out of this execution to
231231
* set
232232
*/
233-
public void setFilterCount(int filterCount) {
233+
public void setFilterCount(long filterCount) {
234234
this.filterCount = filterCount;
235235
}
236236

237237
/**
238238
* Setter for number of rollbacks for this execution
239239
* @param rollbackCount int the number of rollbacks.
240240
*/
241-
public void setRollbackCount(int rollbackCount) {
241+
public void setRollbackCount(long rollbackCount) {
242242
this.rollbackCount = rollbackCount;
243243
}
244244

@@ -383,7 +383,7 @@ public void setTerminateOnly() {
383383
/**
384384
* @return the total number of items skipped.
385385
*/
386-
public int getSkipCount() {
386+
public long getSkipCount() {
387387
return readSkipCount + processSkipCount + writeSkipCount;
388388
}
389389

@@ -410,14 +410,14 @@ public JobParameters getJobParameters() {
410410
/**
411411
* @return the number of records skipped on read
412412
*/
413-
public int getReadSkipCount() {
413+
public long getReadSkipCount() {
414414
return readSkipCount;
415415
}
416416

417417
/**
418418
* @return the number of records skipped on write
419419
*/
420-
public int getWriteSkipCount() {
420+
public long getWriteSkipCount() {
421421
return writeSkipCount;
422422
}
423423

@@ -426,7 +426,7 @@ public int getWriteSkipCount() {
426426
*
427427
* @param readSkipCount int containing read skip count to be used for the step execution.
428428
*/
429-
public void setReadSkipCount(int readSkipCount) {
429+
public void setReadSkipCount(long readSkipCount) {
430430
this.readSkipCount = readSkipCount;
431431
}
432432

@@ -435,14 +435,14 @@ public void setReadSkipCount(int readSkipCount) {
435435
*
436436
* @param writeSkipCount int containing write skip count to be used for the step execution.
437437
*/
438-
public void setWriteSkipCount(int writeSkipCount) {
438+
public void setWriteSkipCount(long writeSkipCount) {
439439
this.writeSkipCount = writeSkipCount;
440440
}
441441

442442
/**
443443
* @return the number of records skipped during processing
444444
*/
445-
public int getProcessSkipCount() {
445+
public long getProcessSkipCount() {
446446
return processSkipCount;
447447
}
448448

@@ -451,7 +451,7 @@ public int getProcessSkipCount() {
451451
*
452452
* @param processSkipCount int containing process skip count to be used for the step execution.
453453
*/
454-
public void setProcessSkipCount(int processSkipCount) {
454+
public void setProcessSkipCount(long processSkipCount) {
455455
this.processSkipCount = processSkipCount;
456456
}
457457

spring-batch-core/src/main/java/org/springframework/batch/core/jsr/step/item/JsrFaultTolerantChunkProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public I recover(RetryContext context) throws Exception {
193193
* @param e the cause of the skip
194194
* @param skipCount the current skip count
195195
*/
196-
private boolean shouldSkip(SkipPolicy policy, Throwable e, int skipCount) {
196+
private boolean shouldSkip(SkipPolicy policy, Throwable e, long skipCount) {
197197
try {
198198
return policy.shouldSkip(e, skipCount);
199199
}

spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ private void callProcessSkipListener(I item, Throwable e) {
514514
* @param e the cause of the skip
515515
* @param skipCount the current skip count
516516
*/
517-
private boolean shouldSkip(SkipPolicy policy, Throwable e, int skipCount) {
517+
private boolean shouldSkip(SkipPolicy policy, Throwable e, long skipCount) {
518518
try {
519519
return policy.shouldSkip(e, skipCount);
520520
}

spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public void postProcess(StepContribution contribution, Chunk<I> chunk) {
130130
* @param e the cause of the skip
131131
* @param skipCount the current skip count
132132
*/
133-
private boolean shouldSkip(SkipPolicy policy, Throwable e, int skipCount) {
133+
private boolean shouldSkip(SkipPolicy policy, Throwable e, long skipCount) {
134134
try {
135135
return policy.shouldSkip(e, skipCount);
136136
}

spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/AlwaysSkipItemSkipPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public class AlwaysSkipItemSkipPolicy implements SkipPolicy {
2727

2828
@Override
29-
public boolean shouldSkip(Throwable t, int skipCount) {
29+
public boolean shouldSkip(Throwable t, long skipCount) {
3030
return true;
3131
}
3232

spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/CompositeSkipPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void setSkipPolicies(SkipPolicy[] skipPolicies) {
3636
}
3737

3838
@Override
39-
public boolean shouldSkip(Throwable t, int skipCount) throws SkipLimitExceededException {
39+
public boolean shouldSkip(Throwable t, long skipCount) throws SkipLimitExceededException {
4040
for (SkipPolicy policy : skipPolicies) {
4141
if (policy.shouldSkip(t, skipCount)) {
4242
return true;

spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/ExceptionClassifierSkipPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public void setPolicyMap(Map<Class<? extends Throwable>, SkipPolicy> policyMap)
6666
* @throws SkipLimitExceededException if a limit is exceeded
6767
*/
6868
@Override
69-
public boolean shouldSkip(Throwable t, int skipCount) throws SkipLimitExceededException {
69+
public boolean shouldSkip(Throwable t, long skipCount) throws SkipLimitExceededException {
7070
return classifier.classify(t).shouldSkip(t, skipCount);
7171
}
7272

spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/LimitCheckingItemSkipPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ public void setSkippableExceptionMap(Map<Class<? extends Throwable>, Boolean> sk
124124
* {@link SkipLimitExceededException} will be thrown.
125125
*/
126126
@Override
127-
public boolean shouldSkip(Throwable t, int skipCount) {
127+
public boolean shouldSkip(Throwable t, long skipCount) {
128128
if (skippableExceptionClassifier.classify(t)) {
129129
if (skipCount < skipLimit) {
130130
return true;

spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/NeverSkipItemSkipPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
public class NeverSkipItemSkipPolicy implements SkipPolicy{
2626

2727
@Override
28-
public boolean shouldSkip(Throwable t, int skipCount) {
28+
public boolean shouldSkip(Throwable t, long skipCount) {
2929
return false;
3030
}
3131

spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/SkipPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ public interface SkipPolicy {
3838
* @throws SkipLimitExceededException if a limit is breached
3939
* @throws IllegalArgumentException if the exception is null
4040
*/
41-
boolean shouldSkip(Throwable t, int skipCount) throws SkipLimitExceededException;
41+
boolean shouldSkip(Throwable t, long skipCount) throws SkipLimitExceededException;
4242

4343
}

0 commit comments

Comments
 (0)