kfaraz commented on code in PR #13967:
URL: https://github.com/apache/druid/pull/13967#discussion_r1170086928
##########
server/src/main/java/org/apache/druid/metadata/SqlSegmentsMetadataManager.java:
##########
@@ -772,6 +780,20 @@ public int markSegmentsAsUnused(Set<SegmentId> segmentIds)
);
}
+ @Override
+ public int markSegmentAsHandedOff(SegmentId segmentId)
+ {
+ if (!segmentHandedOffStatus.contains(segmentId)) {
+ segmentHandedOffStatus.add(segmentId);
+ return connector.getDBI().withHandle(
+ handle ->
+ SqlSegmentsMetadataQuery.forHandle(handle, connector,
dbTables.get(), jsonMapper)
+ .markSegmentAsHandedOff(segmentId)
+ );
+ }
+ return 0;
Review Comment:
If you intend to always return 0, you can make this a void method.
Alternatively, return 1 when you update the table, 0 when the segment is
already handed off.
##########
processing/src/main/java/org/apache/druid/query/QueryException.java:
##########
@@ -112,6 +113,7 @@ public static FailType fromErrorCode(String errorCode)
switch (errorCode) {
case QUERY_CANCELED_ERROR_CODE:
+ case UNAVAILABLE_SEGMENTS_ERROR_CODE:
return FailType.CANCELED;
Review Comment:
I don't think this is a cancellation scenario. FailType should probably be
runtime failure.
--
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]