-
Notifications
You must be signed in to change notification settings - Fork 142
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
[#719] feat(netty): Optimize allocation strategy #739
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -17,10 +17,12 @@ | |||
|
||||
package org.apache.uniffle.test; | ||||
|
||||
import java.lang.reflect.Field; | ||||
import java.util.Arrays; | ||||
import java.util.List; | ||||
import java.util.Map; | ||||
import java.util.Set; | ||||
import java.util.concurrent.ConcurrentHashMap; | ||||
|
||||
import com.google.common.collect.Lists; | ||||
import com.google.common.collect.Sets; | ||||
|
@@ -31,10 +33,12 @@ | |||
import org.apache.uniffle.client.request.RssGetShuffleAssignmentsRequest; | ||||
import org.apache.uniffle.client.response.RssApplicationInfoResponse; | ||||
import org.apache.uniffle.client.response.RssGetShuffleAssignmentsResponse; | ||||
import org.apache.uniffle.common.ClientType; | ||||
import org.apache.uniffle.common.PartitionRange; | ||||
import org.apache.uniffle.common.ShuffleRegisterInfo; | ||||
import org.apache.uniffle.common.ShuffleServerInfo; | ||||
import org.apache.uniffle.common.config.RssBaseConf; | ||||
import org.apache.uniffle.common.config.RssConf; | ||||
import org.apache.uniffle.common.rpc.StatusCode; | ||||
import org.apache.uniffle.common.storage.StorageInfo; | ||||
import org.apache.uniffle.common.storage.StorageMedia; | ||||
|
@@ -121,11 +125,28 @@ public void getShuffleRegisterInfoTest() { | |||
|
||||
@Test | ||||
public void getShuffleAssignmentsTest() throws Exception { | ||||
String appId = "getShuffleAssignmentsTest"; | ||||
final String appId = "getShuffleAssignmentsTest"; | ||||
CoordinatorTestUtils.waitForRegister(coordinatorClient,2); | ||||
// When the shuffleServerHeartbeat Test is completed before the current test, | ||||
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. Line 249 in 1021031
Because this shuffleServerConf modifies the netty port number of a server, there will be one less machine allocated. Therefore, in order to maintain the original test, we need to set the port number back to a negative number, which is equivalent to setting the label to GRPC .
|
||||
// the server's tags will be [ss_v4, GRPC_NETTY] and [ss_v4, GRPC], respectively. | ||||
// We need to remove the first machine's tag from GRPC_NETTY to GRPC | ||||
shuffleServers.get(0).stopServer(); | ||||
RssConf shuffleServerConf = shuffleServers.get(0).getShuffleServerConf(); | ||||
Class<RssConf> clazz = RssConf.class; | ||||
Field field = clazz.getDeclaredField("settings"); | ||||
field.setAccessible(true); | ||||
((ConcurrentHashMap) field.get(shuffleServerConf)).remove(ShuffleServerConf.NETTY_SERVER_PORT.key()); | ||||
String storageTypeJsonSource = String.format("{\"%s\": \"ssd\"}", baseDir); | ||||
withEnvironmentVariables("RSS_ENV_KEY", storageTypeJsonSource).execute(() -> { | ||||
ShuffleServer ss = new ShuffleServer((ShuffleServerConf) shuffleServerConf); | ||||
ss.start(); | ||||
shuffleServers.set(0, ss); | ||||
}); | ||||
Thread.sleep(5000); | ||||
// add tag when ClientType is `GRPC` | ||||
RssGetShuffleAssignmentsRequest request = new RssGetShuffleAssignmentsRequest( | ||||
appId, 1, 10, 4, 1, | ||||
Sets.newHashSet(Constants.SHUFFLE_SERVER_VERSION)); | ||||
Sets.newHashSet(Constants.SHUFFLE_SERVER_VERSION, ClientType.GRPC.name())); | ||||
RssGetShuffleAssignmentsResponse response = coordinatorClient.getShuffleAssignments(request); | ||||
Set<Integer> expectedStart = Sets.newHashSet(0, 4, 8); | ||||
|
||||
|
@@ -157,7 +178,7 @@ public void getShuffleAssignmentsTest() throws Exception { | |||
|
||||
request = new RssGetShuffleAssignmentsRequest( | ||||
appId, 1, 10, 4, 2, | ||||
Sets.newHashSet(Constants.SHUFFLE_SERVER_VERSION)); | ||||
Sets.newHashSet(Constants.SHUFFLE_SERVER_VERSION, ClientType.GRPC.name())); | ||||
response = coordinatorClient.getShuffleAssignments(request); | ||||
serverToPartitionRanges = response.getServerToPartitionRanges(); | ||||
assertEquals(2, serverToPartitionRanges.size()); | ||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we convert this method to
CheckValue#checkValueFunc
likeConfigUtil#POSITIVE_LONG_VALIDATOR
?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.
OK, i will try it.
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.
It doesn't seem to work because there is no
checkValue
on mr's client side.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.
I got it. My mistake.