@@ -41,18 +41,18 @@ public class ShuffleSecretManager implements SecretKeyHolder {
4141 private static final String SPARK_SASL_USER = "sparkSaslUser" ;
4242
4343 /**
44- * Convert the given string to a byte buffer that can be converted back to a string
45- * through {@link #bytesToString(ByteBuffer)}. This is used if the external shuffle
46- * service represents shuffle secrets as bytes buffers instead of strings.
44+ * Convert the given string to a byte buffer. The resulting buffer can be converted back to
45+ * the same string through {@link #bytesToString(ByteBuffer)}. This is used if the external
46+ * shuffle service represents shuffle secrets as bytes buffers instead of strings.
4747 */
4848 public static ByteBuffer stringToBytes (String s ) {
4949 return ByteBuffer .wrap (s .getBytes (UTF8_CHARSET ));
5050 }
5151
5252 /**
53- * Convert the given byte buffer to a string that can be converted back to a byte
54- * buffer through {@link #stringToBytes(String)}. This is used if the external shuffle
55- * service represents shuffle secrets as bytes buffers instead of strings.
53+ * Convert the given byte buffer to a string. The resulting string can be converted back to
54+ * the same byte buffer through {@link #stringToBytes(String)}. This is used if the external
55+ * shuffle service represents shuffle secrets as bytes buffers instead of strings.
5656 */
5757 public static String bytesToString (ByteBuffer b ) {
5858 return new String (b .array (), UTF8_CHARSET );
@@ -63,9 +63,9 @@ public ShuffleSecretManager() {
6363 }
6464
6565 /**
66- * Register the specified application with its secret.
66+ * Register an application with its secret.
6767 * Executors need to first authenticate themselves with the same secret before
68- * the fetching shuffle files written by other executors in this application.
68+ * fetching shuffle files written by other executors in this application.
6969 */
7070 public void registerApp (String appId , String shuffleSecret ) {
7171 if (!shuffleSecretMap .contains (appId )) {
@@ -77,15 +77,15 @@ public void registerApp(String appId, String shuffleSecret) {
7777 }
7878
7979 /**
80- * Register the specified application with its secret specified as a byte buffer.
80+ * Register an application with its secret specified as a byte buffer.
8181 */
8282 public void registerApp (String appId , ByteBuffer shuffleSecret ) {
8383 registerApp (appId , bytesToString (shuffleSecret ));
8484 }
8585
8686 /**
87- * Unregister the specified application along with its secret.
88- * This is called when an application terminates.
87+ * Unregister an application along with its secret.
88+ * This is called when the application terminates.
8989 */
9090 public void unregisterApp (String appId ) {
9191 if (shuffleSecretMap .contains (appId )) {
@@ -105,10 +105,10 @@ public String getSaslUser(String appId) {
105105 }
106106
107107 /**
108- * Return the secret key registered with the specified application.
109- * This key is used to authenticate the executors in the application
110- * before they can fetch shuffle files from the external shuffle service.
111- * If the application is not registered, return null.
108+ * Return the secret key registered with the given application.
109+ * This key is used to authenticate the executors before they can fetch shuffle files
110+ * written by this application from the external shuffle service. If the specified
111+ * application is not registered, return null.
112112 */
113113 @ Override
114114 public String getSecretKey (String appId ) {
0 commit comments