Skip to content

Commit 8773705

Browse files
zsxwingAndrew Or
authored andcommitted
[SPARK-4883][Shuffle] Add a name to the directoryCleaner thread
Author: zsxwing <[email protected]> Closes #3734 from zsxwing/SPARK-4883 and squashes the following commits: e6f2b61 [zsxwing] Fix the name cc74727 [zsxwing] Add a name to the directoryCleaner thread
1 parent 39272c8 commit 8773705

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

network/shuffle/src/main/java/org/apache/spark/network/shuffle/ExternalShuffleBlockManager.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.apache.spark.network.buffer.ManagedBuffer;
3838
import org.apache.spark.network.shuffle.protocol.ExecutorShuffleInfo;
3939
import org.apache.spark.network.util.JavaUtils;
40+
import org.apache.spark.network.util.NettyUtils;
4041
import org.apache.spark.network.util.TransportConf;
4142

4243
/**
@@ -49,7 +50,7 @@
4950
* the Executor's memory, unlike the IndexShuffleBlockManager.
5051
*/
5152
public class ExternalShuffleBlockManager {
52-
private final Logger logger = LoggerFactory.getLogger(ExternalShuffleBlockManager.class);
53+
private static final Logger logger = LoggerFactory.getLogger(ExternalShuffleBlockManager.class);
5354

5455
// Map containing all registered executors' metadata.
5556
private final ConcurrentMap<AppExecId, ExecutorShuffleInfo> executors;
@@ -60,8 +61,9 @@ public class ExternalShuffleBlockManager {
6061
private final TransportConf conf;
6162

6263
public ExternalShuffleBlockManager(TransportConf conf) {
63-
// TODO: Give this thread a name.
64-
this(conf, Executors.newSingleThreadExecutor());
64+
this(conf, Executors.newSingleThreadExecutor(
65+
// Add `spark` prefix because it will run in NM in Yarn mode.
66+
NettyUtils.createThreadFactory("spark-shuffle-directory-cleaner")));
6567
}
6668

6769
// Allows tests to have more control over when directories are cleaned up.

0 commit comments

Comments
 (0)