Skip to content

Commit 6df90e5

Browse files
committed
move concurrently read fields to nested class
1 parent 07e714c commit 6df90e5

File tree

1 file changed

+6
-8
lines changed
  • extended/src/main/java/io/kubernetes/client/extended/pager

1 file changed

+6
-8
lines changed

extended/src/main/java/io/kubernetes/client/extended/pager/Pager.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@
2828
*/
2929
public class Pager<ApiType extends KubernetesObject, ApiListType extends KubernetesListObject>
3030
implements Iterable<ApiType> {
31-
private Integer limit;
32-
private ApiClient client;
33-
private Type listType;
34-
private Function<PagerParams, Call> listFunc;
35-
36-
private ApiListType listObjectCurrentPage;
31+
private final Integer limit;
32+
private final ApiClient client;
33+
private final Type listType;
34+
private final Function<PagerParams, Call> listFunc;
3735

3836
/**
3937
* Pagination in kubernetes list call depends on continue and limit variable
@@ -108,9 +106,9 @@ private class PagerIterator implements Iterator<ApiType> {
108106

109107
private boolean started;
110108
private String continueToken;
111-
private Call call;
112109
private int offsetCurrentPage;
113110
private int currentPageSize;
111+
private ApiListType listObjectCurrentPage;
114112

115113
/**
116114
* returns false if kubernetes server has exhausted List.
@@ -132,7 +130,7 @@ public boolean hasNext() {
132130

133131
protected void makeCall() {
134132
try {
135-
call = getNextCall(limit, continueToken);
133+
Call call = getNextCall(limit, continueToken);
136134

137135
listObjectCurrentPage = executeRequest(call);
138136
continueToken = listObjectCurrentPage.getMetadata().getContinue();

0 commit comments

Comments
 (0)