@@ -207,18 +207,13 @@ public StageExecutionStats(
207207 this .runningSplits = runningSplits ;
208208 checkArgument (completedSplits >= 0 , "completedSplits is negative" );
209209 this .completedSplits = completedSplits ;
210- checkArgument (cumulativeUserMemory >= 0 , "cumulativeUserMemory is negative" );
211- this .cumulativeUserMemory = cumulativeUserMemory ;
212- checkArgument (cumulativeTotalMemory >= 0 , "cumulativeTotalMemory is negative" );
213- this .cumulativeTotalMemory = cumulativeTotalMemory ;
214- checkArgument (userMemoryReservationInBytes >= 0 , "userMemoryReservationInBytes is negative" );
215- this .userMemoryReservationInBytes = userMemoryReservationInBytes ;
216- checkArgument (totalMemoryReservationInBytes >= 0 , "totalMemoryReservationInBytes is negative" );
217- this .totalMemoryReservationInBytes = totalMemoryReservationInBytes ;
218- checkArgument (peakUserMemoryReservationInBytes >= 0 , "peakUserMemoryReservationInBytes is negative" );
219- this .peakUserMemoryReservationInBytes = peakUserMemoryReservationInBytes ;
220- checkArgument (peakNodeTotalMemoryReservationInBytes >= 0 , "peakNodeTotalMemoryReservationInBytes is negative" );
221- this .peakNodeTotalMemoryReservationInBytes = peakNodeTotalMemoryReservationInBytes ;
210+
211+ this .cumulativeUserMemory = (cumulativeUserMemory >= 0 ) ? cumulativeUserMemory : Long .MAX_VALUE ;
212+ this .cumulativeTotalMemory = (cumulativeTotalMemory >= 0 ) ? cumulativeTotalMemory : Long .MAX_VALUE ;
213+ this .userMemoryReservationInBytes = (userMemoryReservationInBytes >= 0 ) ? userMemoryReservationInBytes : Long .MAX_VALUE ;
214+ this .totalMemoryReservationInBytes = (totalMemoryReservationInBytes >= 0 ) ? totalMemoryReservationInBytes : Long .MAX_VALUE ;
215+ this .peakUserMemoryReservationInBytes = (peakUserMemoryReservationInBytes >= 0 ) ? peakUserMemoryReservationInBytes : Long .MAX_VALUE ;
216+ this .peakNodeTotalMemoryReservationInBytes = (peakNodeTotalMemoryReservationInBytes >= 0 ) ? peakNodeTotalMemoryReservationInBytes : Long .MAX_VALUE ;
222217
223218 this .totalScheduledTime = requireNonNull (totalScheduledTime , "totalScheduledTime is null" );
224219 this .totalCpuTime = requireNonNull (totalCpuTime , "totalCpuTime is null" );
@@ -227,29 +222,20 @@ public StageExecutionStats(
227222 this .fullyBlocked = fullyBlocked ;
228223 this .blockedReasons = ImmutableSet .copyOf (requireNonNull (blockedReasons , "blockedReasons is null" ));
229224
230- checkArgument (totalAllocationInBytes >= 0 , "totalAllocationInBytes is negative" );
231- this .totalAllocationInBytes = totalAllocationInBytes ;
232- checkArgument (rawInputDataSizeInBytes >= 0 , "rawInputDataSizeInBytes is negative" );
233- this .rawInputDataSizeInBytes = rawInputDataSizeInBytes ;
234- checkArgument (rawInputPositions >= 0 , "rawInputPositions is negative" );
235- this .rawInputPositions = rawInputPositions ;
225+ this .totalAllocationInBytes = (totalAllocationInBytes >= 0 ) ? totalAllocationInBytes : Long .MAX_VALUE ;
226+ this .rawInputDataSizeInBytes = (rawInputDataSizeInBytes >= 0 ) ? rawInputDataSizeInBytes : Long .MAX_VALUE ;
227+ this .rawInputPositions = (rawInputPositions >= 0 ) ? rawInputPositions : Long .MAX_VALUE ;
236228
237- checkArgument (processedInputDataSizeInBytes >= 0 , "processedInputDataSizeInBytes is negative" );
238- this .processedInputDataSizeInBytes = processedInputDataSizeInBytes ;
239- checkArgument (processedInputPositions >= 0 , "processedInputPositions is negative" );
240- this .processedInputPositions = processedInputPositions ;
229+ this .processedInputDataSizeInBytes = (processedInputDataSizeInBytes >= 0 ) ? processedInputDataSizeInBytes : Long .MAX_VALUE ;
230+ this .processedInputPositions = (processedInputPositions >= 0 ) ? processedInputPositions : Long .MAX_VALUE ;
241231
242- checkArgument (bufferedDataSizeInBytes >= 0 , "bufferedDataSizeInBytes is negative" );
243- this .bufferedDataSizeInBytes = bufferedDataSizeInBytes ;
232+ this .bufferedDataSizeInBytes = (bufferedDataSizeInBytes >= 0 ) ? bufferedDataSizeInBytes : Long .MAX_VALUE ;
244233
245- // An overflow could have occurred on this stat - handle this gracefully.
246234 this .outputDataSizeInBytes = (outputDataSizeInBytes >= 0 ) ? outputDataSizeInBytes : Long .MAX_VALUE ;
247235
248- checkArgument (outputPositions >= 0 , "outputPositions is negative" );
249- this .outputPositions = outputPositions ;
236+ this .outputPositions = (outputPositions >= 0 ) ? outputPositions : Long .MAX_VALUE ;
250237
251- checkArgument (physicalWrittenDataSizeInBytes >= 0 , "writtenDataSizeInBytes is negative" );
252- this .physicalWrittenDataSizeInBytes = physicalWrittenDataSizeInBytes ;
238+ this .physicalWrittenDataSizeInBytes = (physicalWrittenDataSizeInBytes >= 0 ) ? physicalWrittenDataSizeInBytes : Long .MAX_VALUE ;
253239
254240 this .gcInfo = requireNonNull (gcInfo , "gcInfo is null" );
255241
0 commit comments