Skip to content

Commit

Permalink
Addresses PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
noob-se7en committed Jan 17, 2025
1 parent 0cab772 commit de04824
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ public Map<String, String> forceCommit(
String partitionGroupIds,
@ApiParam(value = "Comma separated list of consuming segments to be committed") @QueryParam("segments")
String consumingSegments,
@ApiParam(value = "Max number of consuming segments to commit at once") @QueryParam("batchSize")
@ApiParam(value = "Max number of consuming segments to commit at once", defaultValue = "Integer.MAX_VALUE")
@QueryParam("batchSize")
Integer batchSize, @Context HttpHeaders headers) {
tableName = DatabaseUtils.translateTableName(tableName, headers);
if (partitionGroupIds != null && consumingSegments != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1962,8 +1962,13 @@ Map<String, Queue<String>> getInstanceToConsumingSegments(IdealState idealState,
for (String instance : instanceToStateMap.keySet()) {
String state = instanceToStateMap.get(instance);
if (state.equals(SegmentStateModel.CONSUMING)) {
instanceToConsumingSegments.putIfAbsent(instance, new LinkedList<>());
instanceToConsumingSegments.get(instance).add(segmentName);
instanceToConsumingSegments.compute(instance, (key, value) -> {
if (value == null) {
value = new LinkedList<>();
}
value.add(segmentName);
return value;
});
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1310,14 +1310,6 @@ public void getSegmentBatchList() {
List<Set<String>> segmentBatchList =
realtimeSegmentManager.getSegmentBatchList(idealState, targetConsumingSegment, 2);

// i1 = [seg0, seg4, seg5, seg6]
// i2 = [seg1, seg3]
// i3 = [seg2, seg3, seg4, seg5, seg6]
// i4 = [seg3]
// i5 = [seg4]
// i6 = [seg5]
// i7 = [seg6]

assert segmentBatchList.size() == 4;
Set<String> segmentsAdded = new HashSet<>();

Expand Down

0 comments on commit de04824

Please sign in to comment.