9aman commented on code in PR #16848:
URL: https://github.com/apache/pinot/pull/16848#discussion_r2375302823
##########
pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/util/SegmentDeletionManagerTest.java:
##########
@@ -619,14 +643,32 @@ public boolean delete(URI uri, boolean forceDelete)
_tableDirs.remove(uri.getPath() + "/");
return true;
}
- // remote the segment
+ // remove the segment
String tableName = uri.getPath().substring(0,
uri.getPath().lastIndexOf("/") + 1);
return _tableDirs.get(tableName).remove(uri.getPath());
}
+ @Override
+ public boolean deleteBatch(List<URI> segmentUris, boolean forceDelete)
+ throws IOException {
+ // the expectation here is that the batch delete call is only limited to
segments.
+ URI segmentURI = segmentUris.get(0);
+ String tableName = segmentURI.getPath().substring(0,
segmentURI.getPath().lastIndexOf("/") + 1);
+ if (_tableDirs.containsKey(tableName)) {
+ // remove all the segments from the table directory
+ segmentUris.forEach(segmentUri ->
_tableDirs.get(tableName).remove(segmentUri.getPath()));
+ }
+ // the table does not exist and we return a true;
+ return true;
+ }
Review Comment:
Done
--
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]