akg268 commented on code in PR #19251:
URL: https://github.com/apache/pinot/pull/19251#discussion_r3939051812
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeSegmentDataManager.java:
##########
@@ -335,7 +335,7 @@ public void deleteSegmentFile() {
private long _consumeStartTime = -1;
private long _lastLogTime = 0;
private int _lastConsumedCount = 0;
- private String _stopReason = null;
+ private SegmentCompletionProtocol.ReasonCode _stopReasonCode = null;
Review Comment:
Addressed. The fake realtime segment data manager now reflects
`_stopReasonCode` and reads it as `SegmentCompletionProtocol.ReasonCode`.
##########
pinot-common/src/main/java/org/apache/pinot/common/protocols/SegmentCompletionProtocol.java:
##########
@@ -150,6 +151,52 @@ public enum ControllerResponseStatus {
// (like size reaching close to its limit or number of col values for a col
is about to overflow int max)
public static final String REASON_INDEX_CAPACITY_THRESHOLD_BREACHED =
"indexCapacityThresholdBreached";
+ public enum ReasonCode {
+ ROW_LIMIT(REASON_ROW_LIMIT),
+ TIME_LIMIT(REASON_TIME_LIMIT),
+ END_OF_PARTITION_GROUP(REASON_END_OF_PARTITION_GROUP),
+ FORCE_COMMIT_MESSAGE_RECEIVED(REASON_FORCE_COMMIT_MESSAGE_RECEIVED),
+
INDEX_CAPACITY_THRESHOLD_BREACHED(REASON_INDEX_CAPACITY_THRESHOLD_BREACHED);
+
+ private final String _reason;
+
+ ReasonCode(String reason) {
+ _reason = reason;
+ }
+
+ public String getReason() {
+ return _reason;
+ }
+
+ public boolean shouldPickWinnerImmediately() {
+ return this == ROW_LIMIT || this == END_OF_PARTITION_GROUP;
+ }
+
+ public static ReasonCode fromCode(String reasonCode) {
Review Comment:
Addressed. The nullable parsing paths now carry `@Nullable`, including
`fromReasonCodeParam`, `fromCode`, `fromReason`, and `Params.getReasonCode()`.
--
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]