浏览代码

YARN-1723. AMRMClientAsync missing blacklist addition and removal
functionality. Contributed by Bartosz Ługowski.

Siddharth Seth 10 年之前
父节点
当前提交
e04e8fa810

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -239,6 +239,9 @@ Release 2.7.0 - UNRELEASED
 
     YARN-1393. SLS: Add how-to-use instructions. (Wei Yan via kasha)
 
+    YARN-1723. AMRMClientAsync missing blacklist addition and removal
+    functionality. (Bartosz Ługowski via sseth)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 11 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/AMRMClientAsync.java

@@ -194,6 +194,17 @@ extends AbstractService {
    */
   public abstract int getClusterNodeCount();
 
+  /**
+   * Update application's blacklist with addition or removal resources.
+   *
+   * @param blacklistAdditions list of resources which should be added to the
+   *        application blacklist
+   * @param blacklistRemovals list of resources which should be removed from the
+   *        application blacklist
+   */
+  public abstract void updateBlacklist(List<String> blacklistAdditions,
+                                       List<String> blacklistRemovals);
+
   /**
    * Wait for <code>check</code> to return true for each 1000 ms.
    * See also {@link #waitFor(com.google.common.base.Supplier, int)}

+ 13 - 0
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/api/async/impl/AMRMClientAsyncImpl.java

@@ -205,6 +205,19 @@ extends AMRMClientAsync<T> {
   public int getClusterNodeCount() {
     return client.getClusterNodeCount();
   }
+
+  /**
+   * Update application's blacklist with addition or removal resources.
+   *
+   * @param blacklistAdditions list of resources which should be added to the
+   *        application blacklist
+   * @param blacklistRemovals list of resources which should be removed from the
+   *        application blacklist
+   */
+  public void updateBlacklist(List<String> blacklistAdditions,
+                              List<String> blacklistRemovals) {
+    client.updateBlacklist(blacklistAdditions, blacklistRemovals);
+  }
   
   private class HeartbeatThread extends Thread {
     public HeartbeatThread() {