Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7839#discussion_r36354315
  
    --- Diff: 
network/yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java
 ---
    @@ -181,4 +249,44 @@ public ByteBuffer getMetaData() {
         return ByteBuffer.allocate(0);
       }
     
    +  private Map<String, List<Entry<AppExecId, ExecutorShuffleInfo>>> 
reloadRegisteredExecutors()
    +      throws IOException, ClassNotFoundException {
    +    if (registeredExecutorFile != null && registeredExecutorFile.exists()) 
{
    +      logger.info("Reloading executors from {}", registeredExecutorFile);
    +      return reloadRegisteredExecutors(registeredExecutorFile);
    +    } else {
    +      logger.info("No executor info to reload");
    +      return new HashMap<>();
    +    }
    +  }
    +
    +
    +  @VisibleForTesting
    +  static Map<String, List<Entry<AppExecId, ExecutorShuffleInfo>>> 
reloadRegisteredExecutors(
    +      File file
    +  ) throws IOException, ClassNotFoundException {
    +    Map<String, List<Entry<AppExecId, ExecutorShuffleInfo>>> result = new 
HashMap<>();
    +    ObjectInputStream in = null;
    +    try {
    +      in = new ObjectInputStream(new FileInputStream(file));
    +      Map<AppExecId, ExecutorShuffleInfo> registeredExecutors =
    --- End diff --
    
    Sean was cleaning up `-Xlint` warning, so it would be nice to silence this 
one (`@SuppressWarnings("unchecked")`).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to