KKcorps commented on code in PR #17194:
URL: https://github.com/apache/pinot/pull/17194#discussion_r2540631176
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/realtime/PinotLLCRealtimeSegmentManager.java:
##########
@@ -2264,17 +2264,17 @@ private boolean isTmpAndCanDelete(String filePath,
Set<String> downloadUrls, Pin
* @return the set of consuming segments for which commit was initiated
*/
public Set<String> forceCommit(String tableNameWithType, @Nullable String
partitionGroupIdsToCommit,
- @Nullable String segmentsToCommit, ForceCommitBatchConfig batchConfig) {
+ @Nullable String segmentsToCommit, @Nullable ForceCommitBatchConfig
batchConfig) {
IdealState idealState = getIdealState(tableNameWithType);
Set<String> allConsumingSegments = findConsumingSegments(idealState);
Set<String> targetConsumingSegments =
filterSegmentsToCommit(allConsumingSegments,
partitionGroupIdsToCommit, segmentsToCommit);
- int batchSize = batchConfig.getBatchSize();
- if (batchSize >= targetConsumingSegments.size()) {
+ if ((batchConfig == null) || (batchConfig.getBatchSize() >=
targetConsumingSegments.size())) {
// No need to divide segments in batches.
sendForceCommitMessageToServers(tableNameWithType,
targetConsumingSegments);
} else {
- List<Set<String>> segmentBatchList = getSegmentBatchList(idealState,
targetConsumingSegments, batchSize);
+ List<Set<String>> segmentBatchList =
+ getSegmentBatchList(idealState, targetConsumingSegments,
batchConfig.getBatchSize());
ExecutorService executor = Executors.newSingleThreadExecutor();
Review Comment:
You should use a cached executor service here. Don't create a new executor
on every method call
--
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]