-
Notifications
You must be signed in to change notification settings - Fork 283
Prioritized Partitions Simulation #3028
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,7 @@ public class DataNodeTracker { | |
| * @param replicaThrottleDurationMs throttle duration for replicas | ||
| */ | ||
| public DataNodeTracker(DataNodeId dataNodeId, List<RemoteReplicaInfo> remoteReplicas, int maxActiveGroupSize, | ||
| int startGroupId, Time time, long replicaThrottleDurationMs) { | ||
| int startGroupId, Time time, long replicaThrottleDurationMs, boolean isReplicaPrioritzationEnabled, int replicationMaxPrioritizedReplicas) { | ||
| this.dataNodeId = dataNodeId; | ||
| this.activeGroupTrackers = new ArrayList<>(); | ||
|
|
||
|
|
@@ -61,7 +61,13 @@ public DataNodeTracker(DataNodeId dataNodeId, List<RemoteReplicaInfo> remoteRepl | |
|
|
||
| // for each of smaller array of remote replicas create active group trackers with consecutive group ids | ||
| for (List<RemoteReplicaInfo> remoteReplicaList : remoteReplicaSegregatedList) { | ||
| ActiveGroupTracker activeGroupTracker = new ActiveGroupTracker(currentGroupId, remoteReplicaList.stream() | ||
| int size = remoteReplicaList.size(); | ||
| if (isReplicaPrioritzationEnabled) { | ||
| int maxSize = replicationMaxPrioritizedReplicas/100 * size; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You will not be able to get accurate data from this methodology. As replicas for partition can be in different threads and different data node tracker. So you will stop one replica and not stop another replica. Also after each iteration, the list could change and different partition will be picked up. |
||
| size = Math.min(size, maxSize); | ||
| } | ||
|
|
||
| ActiveGroupTracker activeGroupTracker = new ActiveGroupTracker(currentGroupId, remoteReplicaList.subList(0, size).stream() | ||
| .map(remoteReplicaInfo -> new ReplicaTracker(remoteReplicaInfo, time, replicaThrottleDurationMs)) | ||
| .collect(Collectors.toList())); | ||
| activeGroupTrackers.add(activeGroupTracker); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets extract this code piece so that its a single point where this logic resides. Currently this is being evaluated at 2 places and any change in one place must be replicated to the other location. Roughly :-