Skip to content

Commit

Permalink
Rename module name to be more meaningful
Browse files Browse the repository at this point in the history
  • Loading branch information
maobaolong committed Jan 2, 2025
1 parent 1a8af58 commit 9549d63
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 113 deletions.
74 changes: 0 additions & 74 deletions client-mock-on-yarn/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
<module>integration-test/common</module>
<module>cli</module>
<module>server-common</module>
<module>client-mock-on-yarn</module>
<module>tools/client-simulation-yarn</module>
</modules>

<dependencies>
Expand Down
74 changes: 74 additions & 0 deletions tools/client-simulation-yarn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!--
~ 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.
-->

# Uniffle Client Simulation On Yarn - Usage Guide

## Parameter Description

| Parameter Name | Default Value | Description |
|----------------------------------------------|---------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `uniffle.client.sim.serverId` | None | Uniffle server ID |
| `uniffle.client.sim.container.num` | 3 | Number of containers to start in the Yarn application, which corresponds to the number of concurrent client processes |
| `uniffle.client.sim.threadCount` | 1 | Number of concurrent threads running in each container process. The actual number of working threads is `threadCount + 1` when each thread is concurrent. |
| `uniffle.client.sim.queueName` | default | Yarn resource queue name |
| `uniffle.client.sim.jarPath.list` | None | HDFS addresses of additional JARs or other resources to download to AM or Task local, separated by commas (e.g., HDFS address of RSS shaded JAR) |
| `uniffle.client.sim.tmp.hdfs.path` | None | A writable HDFS address for uploading temporary application resources |
| `uniffle.client.sim.shuffleCount` | 1 | Number of shuffles included in a single `sendShuffleData` request |
| `uniffle.client.sim.partitionCount` | 1 | Number of partitions included in each shuffle of a single `sendShuffleData` request |
| `uniffle.client.sim.blockCount` | 1 | Number of blocks included in each partition of a single `sendShuffleData` request |
| `uniffle.client.sim.blockSize` | 1024 | Size of each block in a single `sendShuffleData` request |
| `uniffle.client.sim.am.vCores` | 8 | Number of virtual cores specified when requesting the Application Master (AM) |
| `uniffle.client.sim.am.memory` | 4096 | Memory size (in MB) specified when requesting the AM |
| `uniffle.client.sim.container.vCores` | 2 | Number of virtual cores specified when requesting task containers |
| `uniffle.client.sim.container.memory` | 2048 | Memory size (in MB) specified when requesting task containers |
| `uniffle.client.sim.am.jvm.opts` | None | Additional JVM options for debugging when the execution result is abnormal |
| `uniffle.client.sim.container.jvm.opts` | None | Additional JVM options for debugging when the execution result is abnormal |

## Running Example

1. Change to the Hadoop directory and execute the test on Yarn program:

```bash
cd $HADOOP_HOME
```

2. Execute the example command:

```bash
$ bin/yarn jar rss-client-simulation-yarn-1.0-SNAPSHOT.jar \
-Duniffle.client.sim.serverId=<UNIFFLE_SERVER_ID> \
-Duniffle.client.sim.container.num=1000 \
-Duniffle.client.sim.queueName=<YOUR_QUEUE_NAME> \
-Duniffle.client.sim.jarPath.list=hdfs://ns1/tmp/rss-client-spark3-shaded.jar \
-Duniffle.client.sim.tmp.hdfs.path=hdfs://ns1/user/xx/tmp/uniffle-client-sim/ \
-Duniffle.client.sim.shuffleCount=5 \
-Duniffle.client.sim.partitionCount=50 \
-Duniffle.client.sim.blockCount=100 \
-Duniffle.client.sim.blockSize=10240 \
-Duniffle.client.sim.threadCount=10
```

3. Example Output:

```plaintext
24/12/30 15:03:47 INFO client.UniffleClientSimOnYarnClient: appId: application_1729845342052_5295913
...
Application killed: application_1729845342052_5295913
Application status: KILLED
```

This guide provides a comprehensive overview of how to run the Uniffle Client simulator on Yarn, including parameter descriptions and a step-by-step example. Adjust the parameters as needed for your specific use case.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
<groupId>org.apache.uniffle</groupId>
<artifactId>uniffle-parent</artifactId>
<version>0.11.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>rss-client-mock-on-yarn</artifactId>
<artifactId>rss-client-simulation-yarn</artifactId>
<packaging>jar</packaging>
<name>Apache Uniffle Mock Client On Yarn</name>
<name>Apache Uniffle Client Simulation On Yarn</name>
<properties>
<uniffle.version>0.9.1</uniffle.version>
</properties>
Expand Down Expand Up @@ -62,5 +63,4 @@
<scope>provided</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@
* limitations under the License.
*/

package org.apache.uniffle.client.mock;
package org.apache.uniffle.client.simulator;

public class Constants {
public static final String KEY_PREFIX = "uniffle.mock.client";
public static final String KEY_PREFIX = "uniffle.client.sim.";
public static final String KEY_AM_MEMORY = KEY_PREFIX + "am.memory";
public static final String KEY_AM_VCORES = KEY_PREFIX + "am.vCores";
public static final String KEY_CONTAINER_MEMORY = KEY_PREFIX + ".container.memory";
public static final String KEY_CONTAINER_VCORES = KEY_PREFIX + ".container.vCores";
public static final String KEY_QUEUE_NAME = KEY_PREFIX + ".queueName";
public static final String KEY_CONTAINER_NUM = KEY_PREFIX + ".container.num";
public static final String KEY_CONTAINER_MEMORY = KEY_PREFIX + "container.memory";
public static final String KEY_CONTAINER_VCORES = KEY_PREFIX + "container.vCores";
public static final String KEY_QUEUE_NAME = KEY_PREFIX + "queueName";
public static final String KEY_CONTAINER_NUM = KEY_PREFIX + "container.num";
public static final int CONTAINER_NUM_DEFAULT = 3;
public static final String KEY_SERVER_ID = KEY_PREFIX + ".serverId";
public static final String KEY_SHUFFLE_COUNT = KEY_PREFIX + ".shuffleCount";
public static final String KEY_PARTITION_COUNT = KEY_PREFIX + ".partitionCount";
public static final String KEY_BLOCK_COUNT = KEY_PREFIX + ".blockCount";
public static final String KEY_BLOCK_SIZE = KEY_PREFIX + ".blockSize";
public static final String KEY_EXTRA_JAR_PATH_LIST = KEY_PREFIX + ".jarPath.list";
public static final String KEY_YARN_APP_ID = KEY_PREFIX + ".appId";
public static final String KEY_CONTAINER_INDEX = KEY_PREFIX + ".containerIndex";
public static final String KEY_AM_EXTRA_JVM_OPTS = KEY_PREFIX + ".am.jvm.opts";
public static final String KEY_CONTAINER_EXTRA_JVM_OPTS = KEY_PREFIX + ".container.jvm.opts";
public static final String KEY_TMP_HDFS_PATH = KEY_PREFIX + ".tmp.hdfs.path";
public static final String TMP_HDFS_PATH_DEFAULT = "./tmp/uniffle-mock-client/";
public static final String KEY_SERVER_ID = KEY_PREFIX + "serverId";
public static final String KEY_SHUFFLE_COUNT = KEY_PREFIX + "shuffleCount";
public static final String KEY_PARTITION_COUNT = KEY_PREFIX + "partitionCount";
public static final String KEY_BLOCK_COUNT = KEY_PREFIX + "blockCount";
public static final String KEY_BLOCK_SIZE = KEY_PREFIX + "blockSize";
public static final String KEY_EXTRA_JAR_PATH_LIST = KEY_PREFIX + "jarPath.list";
public static final String KEY_YARN_APP_ID = KEY_PREFIX + "appId";
public static final String KEY_CONTAINER_INDEX = KEY_PREFIX + "containerIndex";
public static final String KEY_AM_EXTRA_JVM_OPTS = KEY_PREFIX + "am.jvm.opts";
public static final String KEY_CONTAINER_EXTRA_JVM_OPTS = KEY_PREFIX + "container.jvm.opts";
public static final String KEY_TMP_HDFS_PATH = KEY_PREFIX + "tmp.hdfs.path";
public static final String TMP_HDFS_PATH_DEFAULT = "./tmp/uniffle-client-sim/";
public static final String JOB_CONF_NAME = "job.conf";
public static final String KEY_THREAD_COUNT = KEY_PREFIX + ".threadCount";
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.uniffle.client.mock;
package org.apache.uniffle.client.simulator;

import java.io.BufferedReader;
import java.io.FileInputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.uniffle.client.mock;
package org.apache.uniffle.client.simulator;

import java.nio.ByteBuffer;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.uniffle.client.mock;
package org.apache.uniffle.client.simulator;

import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -54,8 +54,8 @@
import org.apache.uniffle.common.ShuffleServerInfo;
import org.apache.uniffle.common.util.ThreadUtils;

public class UniffleMockClientOnYarnAppMaster {
private static final Logger LOG = LoggerFactory.getLogger(UniffleMockClientOnYarnAppMaster.class);
public class UniffleClientSimOnYarnAppMaster {
private static final Logger LOG = LoggerFactory.getLogger(UniffleClientSimOnYarnAppMaster.class);
private final Configuration conf;
private final String appId;
// object lock
Expand All @@ -68,11 +68,11 @@ public class UniffleMockClientOnYarnAppMaster {
NMClientAsyncImpl nmClientAsync;

public static void main(String[] args) {
UniffleMockClientOnYarnAppMaster master = new UniffleMockClientOnYarnAppMaster();
UniffleClientSimOnYarnAppMaster master = new UniffleClientSimOnYarnAppMaster();
master.run();
}

public UniffleMockClientOnYarnAppMaster() {
public UniffleClientSimOnYarnAppMaster() {
conf = new Configuration();
HadoopConfigApp hadoopConfigApp = new HadoopConfigApp(conf);
hadoopConfigApp.run(new String[] {"--conf", "./" + Constants.JOB_CONF_NAME});
Expand Down
Loading

0 comments on commit 9549d63

Please sign in to comment.