3030
3131public class ExternalShuffleCleanupSuite {
3232
33- // Executor used to ensure cleanup happens synchronously in this thread.
33+ // Same-thread Executor used to ensure cleanup happens synchronously in test thread.
3434 Executor sameThreadExecutor = MoreExecutors .sameThreadExecutor ();
3535
3636 @ Test
37- public void cleanupDirs () throws IOException {
37+ public void noCleanupAndCleanup () throws IOException {
3838 TestShuffleDataContext dataContext = createSomeData ();
3939
4040 ExternalShuffleBlockManager manager = new ExternalShuffleBlockManager (sameThreadExecutor );
4141 manager .registerExecutor ("app" , "exec0" , dataContext .createExecutorInfo ("shuffleMgr" ));
42- manager .removeApplication ("app" , false /* cleanup */ );
42+ manager .applicationRemoved ("app" , false /* cleanup */ );
4343
4444 assertStillThere (dataContext );
4545
4646 manager .registerExecutor ("app" , "exec1" , dataContext .createExecutorInfo ("shuffleMgr" ));
47- manager .removeApplication ("app" , true /* cleanup */ );
47+ manager .applicationRemoved ("app" , true /* cleanup */ );
4848
4949 assertCleanedUp (dataContext );
5050 }
@@ -61,7 +61,7 @@ public void cleanupUsesExecutor() throws IOException {
6161 ExternalShuffleBlockManager manager = new ExternalShuffleBlockManager (noThreadExecutor );
6262
6363 manager .registerExecutor ("app" , "exec0" , dataContext .createExecutorInfo ("shuffleMgr" ));
64- manager .removeApplication ("app" , true /* cleanup */ );
64+ manager .applicationRemoved ("app" , true );
6565
6666 assertStillThere (dataContext );
6767
@@ -70,15 +70,15 @@ public void cleanupUsesExecutor() throws IOException {
7070 }
7171
7272 @ Test
73- public void cleanupMultipleExecutrs () throws IOException {
73+ public void cleanupMultipleExecutors () throws IOException {
7474 TestShuffleDataContext dataContext0 = createSomeData ();
7575 TestShuffleDataContext dataContext1 = createSomeData ();
7676
7777 ExternalShuffleBlockManager manager = new ExternalShuffleBlockManager (sameThreadExecutor );
7878
7979 manager .registerExecutor ("app" , "exec0" , dataContext0 .createExecutorInfo ("shuffleMgr" ));
8080 manager .registerExecutor ("app" , "exec1" , dataContext1 .createExecutorInfo ("shuffleMgr" ));
81- manager .removeApplication ("app" , true /* cleanup */ );
81+ manager .applicationRemoved ("app" , true );
8282
8383 assertCleanedUp (dataContext0 );
8484 assertCleanedUp (dataContext1 );
@@ -94,20 +94,20 @@ public void cleanupOnlyRemovedApp() throws IOException {
9494 manager .registerExecutor ("app-0" , "exec0" , dataContext0 .createExecutorInfo ("shuffleMgr" ));
9595 manager .registerExecutor ("app-1" , "exec0" , dataContext1 .createExecutorInfo ("shuffleMgr" ));
9696
97- manager .removeApplication ("app-nonexistent" , true /* cleanup */ );
97+ manager .applicationRemoved ("app-nonexistent" , true );
9898 assertStillThere (dataContext0 );
9999 assertStillThere (dataContext1 );
100100
101- manager .removeApplication ("app-0" , true /* cleanup */ );
101+ manager .applicationRemoved ("app-0" , true );
102102 assertCleanedUp (dataContext0 );
103103 assertStillThere (dataContext1 );
104104
105- manager .removeApplication ("app-1" , true /* cleanup */ );
105+ manager .applicationRemoved ("app-1" , true );
106106 assertCleanedUp (dataContext0 );
107107 assertCleanedUp (dataContext1 );
108108
109109 // Make sure it's not an error to cleanup multiple times
110- manager .removeApplication ("app-1" , true /* cleanup */ );
110+ manager .applicationRemoved ("app-1" , true );
111111 assertCleanedUp (dataContext0 );
112112 assertCleanedUp (dataContext1 );
113113 }
0 commit comments