You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uniffle.apache.org by GitBox <gi...@apache.org> on 2022/07/05 10:27:19 UTC

[GitHub] [incubator-uniffle] zuston opened a new pull request, #30: Allow to specify custom tags to decide data placement

zuston opened a new pull request, #30:
URL: https://github.com/apache/incubator-uniffle/pull/30

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://github.com/Tencent/Firestorm/blob/master/CONTRIBUTING.md
     2. Ensure you have added or run the appropriate tests for your PR
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP]XXXX Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
   -->
   
   ### What changes were proposed in this pull request?
   Allow to specify custom tags to decide data placement.
   Changelog
   1. Introduce the conf of `rss.server.tags` for shuffle server
   2. Introduce the conf of `rss.client.data.placement.tags` for client to choose the data placement
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue.
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     3. If you fix some SQL features, you can provide some references of other DBMSes.
     4. If there is design documentation, please add the link.
     5. If there is a discussion in the mailing list, please add the link.
   -->
   
   
   ### Why are the changes needed?
   Sometimes, we hope the specified spark/mr job's shuffle data can be stored the specified group of shuffle servers, maybe due to DC location and so on.
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes.
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released versions or within the unreleased branches such as master.
   If no, write 'No'.
   -->
   
   
   ### How was this patch tested?
   UTs.
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   


-- 
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: dev-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
zuston commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r914911416


##########
client/src/main/java/org/apache/uniffle/client/util/RssClientConfig.java:
##########
@@ -56,6 +58,9 @@ public class RssClientConfig {
   // When the size of read buffer reaches the half of JVM region (i.e., 32m),
   // it will incur humongous allocation, so we set it to 14m.
   public static String RSS_CLIENT_READ_BUFFER_SIZE_DEFAULT_VALUE = "14m";
+  // The tags specified by rss client to determine shuffle data placement.
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS = "rss.client.data.placement.tags";
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS_DEFAULT_VALUES = Constants.SHUFFLE_SERVER_VERSION;

Review Comment:
   Got your thought.



-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
zuston commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r914810037


##########
client-spark/common/src/main/java/org/apache/spark/shuffle/RssSparkShuffleUtils.java:
##########
@@ -123,4 +127,15 @@ public static Configuration getRemoteStorageHadoopConf(
     }
     return readerHadoopConf;
   }
+
+  public static Set<String> getDataPlacementTags(SparkConf sparkConf) {
+    Set<String> placementTags = new HashSet<>();

Review Comment:
   server assignment tag?



-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
zuston commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r914817602


##########
client/src/main/java/org/apache/uniffle/client/util/RssClientConfig.java:
##########
@@ -56,6 +58,9 @@ public class RssClientConfig {
   // When the size of read buffer reaches the half of JVM region (i.e., 32m),
   // it will incur humongous allocation, so we set it to 14m.
   public static String RSS_CLIENT_READ_BUFFER_SIZE_DEFAULT_VALUE = "14m";
+  // The tags specified by rss client to determine shuffle data placement.
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS = "rss.client.data.placement.tags";
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS_DEFAULT_VALUES = Constants.SHUFFLE_SERVER_VERSION;

Review Comment:
   Ok,I will remove the default value of this conf



-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi merged pull request #30: Allow to specify custom tags to decide the assignment of servers

Posted by GitBox <gi...@apache.org>.
jerqi merged PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r913771982


##########
server/src/main/java/org/apache/uniffle/server/ShuffleServer.java:
##########
@@ -157,8 +159,18 @@ private void initialization() throws Exception {
 
     setServer();
 
+    setServerTags();
+  }
+
+  private void setServerTags() {

Review Comment:
   Method `initServerTags()` may be better. `setServerTags` is like a setter. A setter should have a ninput parameter in general.



-- 
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: dev-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-uniffle] zuston commented on pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
zuston commented on PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#issuecomment-1174904429

   @jerqi Could u help review?


-- 
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: dev-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r914889940


##########
client/src/main/java/org/apache/uniffle/client/util/RssClientConfig.java:
##########
@@ -56,6 +58,9 @@ public class RssClientConfig {
   // When the size of read buffer reaches the half of JVM region (i.e., 32m),
   // it will incur humongous allocation, so we set it to 14m.
   public static String RSS_CLIENT_READ_BUFFER_SIZE_DEFAULT_VALUE = "14m";
+  // The tags specified by rss client to determine shuffle data placement.
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS = "rss.client.data.placement.tags";
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS_DEFAULT_VALUES = Constants.SHUFFLE_SERVER_VERSION;

Review Comment:
   Actually,  our client tags should contain version tag in any time.



-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] codecov-commenter commented on pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#issuecomment-1178515675

   # [Codecov](https://codecov.io/gh/apache/incubator-uniffle/pull/30?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#30](https://codecov.io/gh/apache/incubator-uniffle/pull/30?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (d7bb0fc) into [master](https://codecov.io/gh/apache/incubator-uniffle/commit/bba68a91b1fa2dd92e798e6f84bc4c1b8d22c780?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bba68a9) will **decrease** coverage by `0.81%`.
   > The diff coverage is `56.52%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master      #30      +/-   ##
   ============================================
   - Coverage     56.83%   56.02%   -0.82%     
   + Complexity     1204     1133      -71     
   ============================================
     Files           152      143       -9     
     Lines          8401     8054     -347     
     Branches        813      786      -27     
   ============================================
   - Hits           4775     4512     -263     
   + Misses         3368     3292      -76     
   + Partials        258      250       -8     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/incubator-uniffle/pull/30?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...apache/hadoop/mapreduce/v2/app/RssMRAppMaster.java](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LW1yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvbWFwcmVkdWNlL3YyL2FwcC9Sc3NNUkFwcE1hc3Rlci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...rg/apache/uniffle/client/util/RssClientConfig.java](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NsaWVudC91dGlsL1Jzc0NsaWVudENvbmZpZy5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [.../java/org/apache/uniffle/server/ShuffleServer.java](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9TaHVmZmxlU2VydmVyLmphdmE=) | `72.26% <71.42%> (-0.30%)` | :arrow_down: |
   | [.../java/org/apache/hadoop/mapreduce/RssMRConfig.java](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LW1yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9oYWRvb3AvbWFwcmVkdWNlL1Jzc01SQ29uZmlnLmphdmE=) | `91.66% <100.00%> (+0.75%)` | :arrow_up: |
   | [...he/uniffle/client/impl/ShuffleWriteClientImpl.java](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL2NsaWVudC9pbXBsL1NodWZmbGVXcml0ZUNsaWVudEltcGwuamF2YQ==) | `25.98% <100.00%> (ø)` | |
   | [...a/org/apache/uniffle/server/ShuffleServerConf.java](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9TaHVmZmxlU2VydmVyQ29uZi5qYXZh) | `99.30% <100.00%> (+0.01%)` | :arrow_up: |
   | [...org/apache/uniffle/server/ShuffleFlushManager.java](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9TaHVmZmxlRmx1c2hNYW5hZ2VyLmphdmE=) | `76.70% <0.00%> (-1.71%)` | :arrow_down: |
   | [...e/uniffle/server/storage/SingleStorageManager.java](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9zdG9yYWdlL1NpbmdsZVN0b3JhZ2VNYW5hZ2VyLmphdmE=) | `65.57% <0.00%> (-1.64%)` | :arrow_down: |
   | [.../java/org/apache/spark/shuffle/RssSparkConfig.java](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LXNwYXJrL2NvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc3Bhcmsvc2h1ZmZsZS9Sc3NTcGFya0NvbmZpZy5qYXZh) | | |
   | [...org/apache/spark/shuffle/RssSparkShuffleUtils.java](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y2xpZW50LXNwYXJrL2NvbW1vbi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc3Bhcmsvc2h1ZmZsZS9Sc3NTcGFya1NodWZmbGVVdGlscy5qYXZh) | | |
   | ... and [7 more](https://codecov.io/gh/apache/incubator-uniffle/pull/30/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/incubator-uniffle/pull/30?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/incubator-uniffle/pull/30?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [bba68a9...d7bb0fc](https://codecov.io/gh/apache/incubator-uniffle/pull/30?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
jerqi commented on PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#issuecomment-1175009954

   You should add some integration test cases.


-- 
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: dev-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
zuston commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r913792858


##########
server/src/main/java/org/apache/uniffle/server/ShuffleServer.java:
##########
@@ -157,8 +159,18 @@ private void initialization() throws Exception {
 
     setServer();
 
+    setServerTags();
+  }
+
+  private void setServerTags() {

Review Comment:
   Sounds great!



-- 
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: dev-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r913752459


##########
server/src/main/java/org/apache/uniffle/server/ShuffleServer.java:
##########
@@ -262,7 +274,7 @@ public StorageManager getStorageManager() {
   }
 
   public Set<String> getTags() {
-    return tags;
+    return Collections.unmodifiableSet(tags);

Review Comment:
   Why do we need `Collections.unmodifiableSet`?



-- 
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: dev-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-uniffle] jerqi commented on pull request #30: Allow to specify custom tags to decide the assignment of servers

Posted by GitBox <gi...@apache.org>.
jerqi commented on PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#issuecomment-1178633241

   Would you like to add some docs about this feature in another pr?


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
zuston commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r914811152


##########
client/src/main/java/org/apache/uniffle/client/util/RssClientConfig.java:
##########
@@ -56,6 +58,9 @@ public class RssClientConfig {
   // When the size of read buffer reaches the half of JVM region (i.e., 32m),
   // it will incur humongous allocation, so we set it to 14m.
   public static String RSS_CLIENT_READ_BUFFER_SIZE_DEFAULT_VALUE = "14m";
+  // The tags specified by rss client to determine shuffle data placement.
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS = "rss.client.data.placement.tags";

Review Comment:
   rss.client.shuffle-server.assignment.tags ?



-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r913771982


##########
server/src/main/java/org/apache/uniffle/server/ShuffleServer.java:
##########
@@ -157,8 +159,18 @@ private void initialization() throws Exception {
 
     setServer();
 
+    setServerTags();
+  }
+
+  private void setServerTags() {

Review Comment:
   Method `initServerTags()` may be better. `setServerTags` is like a setter. A setter should have an input parameter in general.



-- 
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: dev-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r914888041


##########
client/src/main/java/org/apache/uniffle/client/util/RssClientConfig.java:
##########
@@ -56,6 +58,9 @@ public class RssClientConfig {
   // When the size of read buffer reaches the half of JVM region (i.e., 32m),
   // it will incur humongous allocation, so we set it to 14m.
   public static String RSS_CLIENT_READ_BUFFER_SIZE_DEFAULT_VALUE = "14m";
+  // The tags specified by rss client to determine shuffle data placement.
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS = "rss.client.data.placement.tags";

Review Comment:
   `rss.client.assignment.tags` will be better.



-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] jerqi commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
jerqi commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r914714650


##########
client/src/main/java/org/apache/uniffle/client/util/RssClientConfig.java:
##########
@@ -56,6 +58,9 @@ public class RssClientConfig {
   // When the size of read buffer reaches the half of JVM region (i.e., 32m),
   // it will incur humongous allocation, so we set it to 14m.
   public static String RSS_CLIENT_READ_BUFFER_SIZE_DEFAULT_VALUE = "14m";
+  // The tags specified by rss client to determine shuffle data placement.
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS = "rss.client.data.placement.tags";

Review Comment:
   Could we give it a better name ?
   The reason is as below:
   https://github.com/apache/incubator-uniffle/pull/30#issuecomment-1175014084



##########
client-spark/common/src/main/java/org/apache/spark/shuffle/RssSparkShuffleUtils.java:
##########
@@ -123,4 +127,15 @@ public static Configuration getRemoteStorageHadoopConf(
     }
     return readerHadoopConf;
   }
+
+  public static Set<String> getDataPlacementTags(SparkConf sparkConf) {
+    Set<String> placementTags = new HashSet<>();
+    String tagsRaw = sparkConf.get(RssSparkConfig.RSS_CLIENT_DATA_PLACEMENT_TAGS,

Review Comment:
   ditto?



##########
integration-test/common/src/test/java/org/apache/uniffle/test/AssignmentWithTagsTest.java:
##########
@@ -0,0 +1,199 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.uniffle.test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.uniffle.client.impl.ShuffleWriteClientImpl;
+import org.apache.uniffle.client.util.ClientType;
+import org.apache.uniffle.common.ShuffleAssignmentsInfo;
+import org.apache.uniffle.common.util.Constants;
+import org.apache.uniffle.coordinator.CoordinatorConf;
+import org.apache.uniffle.coordinator.CoordinatorServer;
+import org.apache.uniffle.server.ShuffleServer;
+import org.apache.uniffle.server.ShuffleServerConf;
+import org.apache.uniffle.storage.util.StorageType;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Sets;
+import com.google.common.io.Files;
+
+/**
+ * This class is to test the conf of {@code org.apache.uniffle.server.ShuffleServerConf.Tags}
+ * and {@code RssClientConfig.RSS_CLIENT_DATA_PLACEMENT_TAGS}
+ */
+public class AssignmentWithTagsTest extends CoordinatorTestBase {
+    private static final Logger LOG = LoggerFactory.getLogger(AssignmentWithTagsTest.class);
+
+    // KV: tag -> shuffle server id
+    private static Map<String, List<Integer>> tagOfShufflePorts = new HashMap<>();
+
+    private static List<Integer> findAvailablePorts(int num) throws IOException {
+        List<ServerSocket> sockets = new ArrayList<>();
+        List<Integer> ports = new ArrayList<>();
+
+        for (int i = 0; i < num; i++) {
+            ServerSocket socket = new ServerSocket(0);
+            ports.add(socket.getLocalPort());
+            sockets.add(socket);
+        }
+
+        for (ServerSocket socket : sockets) {
+            socket.close();
+        }
+
+        return ports;
+    }
+
+    private static void createAndStartShuffleServerWithTags(Set<String> tags) throws Exception {
+        ShuffleServerConf shuffleServerConf = getShuffleServerConf();
+        shuffleServerConf.setLong("rss.server.app.expired.withoutHeartbeat", 4000);
+
+        File tmpDir = Files.createTempDir();
+        tmpDir.deleteOnExit();
+
+        File dataDir1 = new File(tmpDir, "data1");
+        File dataDir2 = new File(tmpDir, "data2");
+        String basePath = dataDir1.getAbsolutePath() + "," + dataDir2.getAbsolutePath();
+
+        shuffleServerConf.setString("rss.storage.type", StorageType.LOCALFILE.name());
+        shuffleServerConf.setString("rss.storage.basePath", basePath);
+        shuffleServerConf.setString("rss.server.tags", StringUtils.join(tags, ","));
+
+        List<Integer> ports = findAvailablePorts(2);
+        shuffleServerConf.setInteger("rss.rpc.server.port", ports.get(0));
+        shuffleServerConf.setInteger("rss.jetty.http.port", ports.get(1));
+
+        for (String tag : tags) {
+            tagOfShufflePorts.putIfAbsent(tag, new ArrayList<>());
+            tagOfShufflePorts.get(tag).add(ports.get(0));
+        }
+        tagOfShufflePorts.putIfAbsent(Constants.SHUFFLE_SERVER_VERSION, new ArrayList<>());
+        tagOfShufflePorts.get(Constants.SHUFFLE_SERVER_VERSION).add(ports.get(0));
+
+        LOG.info("Shuffle server data dir: {}, rpc port: {}, http port: {}", dataDir1 + "," + dataDir2,
+                ports.get(0), ports.get(1));
+
+        ShuffleServer server = new ShuffleServer(shuffleServerConf);
+        shuffleServers.add(server);
+        server.start();
+    }
+
+    @BeforeAll
+    public static void setupServers() throws Exception {
+        CoordinatorConf coordinatorConf = getCoordinatorConf();
+        createCoordinatorServer(coordinatorConf);
+
+        for (CoordinatorServer coordinator : coordinators) {
+            coordinator.start();
+        }
+
+        for (int i = 0; i < 2; i ++) {
+            createAndStartShuffleServerWithTags(Sets.newHashSet());
+        }
+
+        for (int i = 0; i < 2; i++) {
+            createAndStartShuffleServerWithTags(Sets.newHashSet("fixed"));
+        }
+

Review Comment:
   Could we add another server with another tag?



##########
client/src/main/java/org/apache/uniffle/client/util/RssClientConfig.java:
##########
@@ -56,6 +58,9 @@ public class RssClientConfig {
   // When the size of read buffer reaches the half of JVM region (i.e., 32m),
   // it will incur humongous allocation, so we set it to 14m.
   public static String RSS_CLIENT_READ_BUFFER_SIZE_DEFAULT_VALUE = "14m";
+  // The tags specified by rss client to determine shuffle data placement.
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS = "rss.client.data.placement.tags";
+  public static String RSS_CLIENT_DATA_PLACEMENT_TAGS_DEFAULT_VALUES = Constants.SHUFFLE_SERVER_VERSION;

Review Comment:
   A shuffle server can have multiple tags. The version tag shouldn't be overrided the configurable tags.



##########
client-mr/src/main/java/org/apache/hadoop/mapreduce/v2/app/RssMRAppMaster.java:
##########
@@ -115,11 +117,19 @@ public static void main(String[] args) {
       LOG.info("Registering coordinators {}", coordinators);
       client.registerCoordinators(coordinators);
 
+      // Get the configured data placement tags and it will also add default shuffle version tag.
+      Set<String> dataPlacementTags = new HashSet<>();
+      String tagsRaw = conf.get(RssMRConfig.RSS_CLIENT_DATA_PLACEMENT_TAGS,

Review Comment:
   rawTags?



##########
client-spark/common/src/main/java/org/apache/spark/shuffle/RssSparkShuffleUtils.java:
##########
@@ -123,4 +127,15 @@ public static Configuration getRemoteStorageHadoopConf(
     }
     return readerHadoopConf;
   }
+
+  public static Set<String> getDataPlacementTags(SparkConf sparkConf) {
+    Set<String> placementTags = new HashSet<>();

Review Comment:
   Could we give the variable a better name?



-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org


[GitHub] [incubator-uniffle] zuston commented on pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
zuston commented on PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#issuecomment-1175012690

   > You should add some integration test cases.
   
   Yes, i’m doing it. Sorry not to add it firstly.


-- 
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: dev-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-uniffle] jerqi commented on pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
jerqi commented on PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#issuecomment-1175014084

   Em...If we use HDFS to store data, the shuffle server will not store data, `data placement` is a little inappropriate, Could we give a better name?


-- 
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: dev-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-uniffle] zuston commented on a diff in pull request #30: Allow to specify custom tags to decide data placement

Posted by GitBox <gi...@apache.org>.
zuston commented on code in PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#discussion_r913759364


##########
server/src/main/java/org/apache/uniffle/server/ShuffleServer.java:
##########
@@ -262,7 +274,7 @@ public StorageManager getStorageManager() {
   }
 
   public Set<String> getTags() {
-    return tags;
+    return Collections.unmodifiableSet(tags);

Review Comment:
   I think this method is to return read -only tags. 



-- 
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: dev-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-uniffle] zuston commented on pull request #30: Allow to specify custom tags to decide the assignment of servers

Posted by GitBox <gi...@apache.org>.
zuston commented on PR #30:
URL: https://github.com/apache/incubator-uniffle/pull/30#issuecomment-1178673383

   > Would you like to add some docs about this feature in another pr? Because this feature brings some user-facing changes, we need some docs.
   
   Glad to do. I will open another PR to finish.


-- 
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: issues-unsubscribe@uniffle.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org