@@ -88,8 +88,8 @@ public enum AbortStatus {
88
88
private final AtomicReference <Stage > stage ;
89
89
private final AtomicReference <ShardGeneration > generation ;
90
90
private final AtomicReference <ShardSnapshotResult > shardSnapshotResult ; // only set in stage DONE
91
- private long startTime ;
92
- private long totalTime ;
91
+ private long startTimeMillis ;
92
+ private long totalTimeMillis ;
93
93
private int incrementalFileCount ;
94
94
private int totalFileCount ;
95
95
private int processedFileCount ;
@@ -102,8 +102,8 @@ public enum AbortStatus {
102
102
103
103
private IndexShardSnapshotStatus (
104
104
final Stage stage ,
105
- final long startTime ,
106
- final long totalTime ,
105
+ final long startTimeMillis ,
106
+ final long totalTimeMillis ,
107
107
final int incrementalFileCount ,
108
108
final int totalFileCount ,
109
109
final int processedFileCount ,
@@ -117,8 +117,8 @@ private IndexShardSnapshotStatus(
117
117
this .stage = new AtomicReference <>(Objects .requireNonNull (stage ));
118
118
this .generation = new AtomicReference <>(generation );
119
119
this .shardSnapshotResult = new AtomicReference <>();
120
- this .startTime = startTime ;
121
- this .totalTime = totalTime ;
120
+ this .startTimeMillis = startTimeMillis ;
121
+ this .totalTimeMillis = totalTimeMillis ;
122
122
this .incrementalFileCount = incrementalFileCount ;
123
123
this .totalFileCount = totalFileCount ;
124
124
this .processedFileCount = processedFileCount ;
@@ -130,14 +130,14 @@ private IndexShardSnapshotStatus(
130
130
}
131
131
132
132
public synchronized Copy moveToStarted (
133
- final long startTime ,
133
+ final long startTimeMillis ,
134
134
final int incrementalFileCount ,
135
135
final int totalFileCount ,
136
136
final long incrementalSize ,
137
137
final long totalSize
138
138
) {
139
139
if (stage .compareAndSet (Stage .INIT , Stage .STARTED )) {
140
- this .startTime = startTime ;
140
+ this .startTimeMillis = startTimeMillis ;
141
141
this .incrementalFileCount = incrementalFileCount ;
142
142
this .totalFileCount = totalFileCount ;
143
143
this .incrementalSize = incrementalSize ;
@@ -172,11 +172,11 @@ public synchronized Copy moveToFinalize() {
172
172
};
173
173
}
174
174
175
- public synchronized void moveToDone (final long endTime , final ShardSnapshotResult shardSnapshotResult ) {
175
+ public synchronized void moveToDone (final long endTimeMillis , final ShardSnapshotResult shardSnapshotResult ) {
176
176
assert shardSnapshotResult != null ;
177
177
assert shardSnapshotResult .getGeneration () != null ;
178
178
if (stage .compareAndSet (Stage .FINALIZE , Stage .DONE )) {
179
- this .totalTime = Math .max (0L , endTime - startTime );
179
+ this .totalTimeMillis = Math .max (0L , endTimeMillis - startTimeMillis );
180
180
this .shardSnapshotResult .set (shardSnapshotResult );
181
181
this .generation .set (shardSnapshotResult .getGeneration ());
182
182
} else {
@@ -191,8 +191,8 @@ public Stage getStage() {
191
191
return stage .get ();
192
192
}
193
193
194
- public long getTotalTime () {
195
- return totalTime ;
194
+ public long getTotalTimeMillis () {
195
+ return totalTimeMillis ;
196
196
}
197
197
198
198
public void addAbortListener (ActionListener <AbortStatus > listener ) {
@@ -225,7 +225,7 @@ private synchronized void abortAndMoveToStageIfNotCompleted(
225
225
public synchronized SnapshotsInProgress .ShardState moveToUnsuccessful (final Stage newStage , final String failure , final long endTime ) {
226
226
assert newStage == Stage .PAUSED || newStage == Stage .FAILURE : newStage ;
227
227
if (newStage == Stage .PAUSED && stage .compareAndSet (Stage .PAUSING , Stage .PAUSED )) {
228
- this .totalTime = Math .max (0L , endTime - startTime );
228
+ this .totalTimeMillis = Math .max (0L , endTime - startTimeMillis );
229
229
this .failure = failure ;
230
230
return SnapshotsInProgress .ShardState .PAUSED_FOR_NODE_REMOVAL ;
231
231
}
@@ -237,7 +237,7 @@ public synchronized SnapshotsInProgress.ShardState moveToUnsuccessful(final Stag
237
237
public synchronized void moveToFailed (final long endTime , final String failure ) {
238
238
if (stage .getAndSet (Stage .FAILURE ) != Stage .FAILURE ) {
239
239
abortListeners .onResponse (AbortStatus .NO_ABORT );
240
- this .totalTime = Math .max (0L , endTime - startTime );
240
+ this .totalTimeMillis = Math .max (0L , endTime - startTimeMillis );
241
241
this .failure = failure ;
242
242
}
243
243
}
@@ -297,8 +297,8 @@ public void updateStatusDescription(String statusString) {
297
297
public synchronized IndexShardSnapshotStatus .Copy asCopy () {
298
298
return new IndexShardSnapshotStatus .Copy (
299
299
stage .get (),
300
- startTime ,
301
- totalTime ,
300
+ startTimeMillis ,
301
+ totalTimeMillis ,
302
302
incrementalFileCount ,
303
303
totalFileCount ,
304
304
processedFileCount ,
@@ -471,9 +471,9 @@ public String toString() {
471
471
+ "stage="
472
472
+ stage
473
473
+ ", startTime="
474
- + startTime
474
+ + startTimeMillis
475
475
+ ", totalTime="
476
- + totalTime
476
+ + totalTimeMillis
477
477
+ ", incrementalFileCount="
478
478
+ incrementalFileCount
479
479
+ ", totalFileCount="
0 commit comments