Jackie-Jiang commented on code in PR #10511:
URL: https://github.com/apache/pinot/pull/10511#discussion_r1154021959
##########
pinot-common/src/main/java/org/apache/pinot/common/restlet/resources/StartReplaceSegmentsRequest.java:
##########
@@ -37,11 +37,11 @@ public class StartReplaceSegmentsRequest {
private final List<String> _segmentsTo;
public StartReplaceSegmentsRequest(@JsonProperty("segmentsFrom") @Nullable
List<String> segmentsFrom,
- @JsonProperty("segmentsTo") List<String> segmentsTo) {
+ @JsonProperty("segmentsTo") @Nullable List<String> segmentsTo) {
_segmentsFrom = (segmentsFrom == null) ? Collections.emptyList() :
segmentsFrom;
- _segmentsTo = segmentsTo;
- Preconditions
- .checkArgument(segmentsTo != null && !segmentsTo.isEmpty(),
"'segmentsTo' should not be null or empty");
+ _segmentsTo = (segmentsTo == null) ? Collections.emptyList() : segmentsTo;
+ Preconditions.checkArgument(!_segmentsFrom.isEmpty() ||
!_segmentsTo.isEmpty(),
+ "Both segmentsFrom and segmentsTo cannot be empty");
Review Comment:
(nit) This sentence is a little bit confusing :-P
```suggestion
"'segmentsFrom' and 'segmentsTo' cannot both be empty");
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]