tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject git commit: TEZ-253. Add ClusterInfo, broken by YARN-837. (sseth)
Date Mon, 17 Jun 2013 17:35:56 GMT
Updated Branches:
  refs/heads/master e1f91573e -> 973317c70


TEZ-253. Add ClusterInfo, broken by YARN-837. (sseth)


Project: http://git-wip-us.apache.org/repos/asf/incubator-tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tez/commit/973317c7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tez/tree/973317c7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tez/diff/973317c7

Branch: refs/heads/master
Commit: 973317c70d7aef298f65bf11b79f05fa99317299
Parents: e1f9157
Author: Siddharth Seth <sseth@apache.org>
Authored: Mon Jun 17 10:35:40 2013 -0700
Committer: Siddharth Seth <sseth@apache.org>
Committed: Mon Jun 17 10:35:40 2013 -0700

----------------------------------------------------------------------
 .../java/org/apache/tez/dag/app/AppContext.java |  1 -
 .../org/apache/tez/dag/app/ClusterInfo.java     | 47 ++++++++++++++++++++
 .../org/apache/tez/dag/app/DAGAppMaster.java    |  1 -
 .../tez/dag/app/dag/impl/TestTaskAttempt.java   |  2 +-
 4 files changed, 48 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/973317c7/tez-dag/src/main/java/org/apache/tez/dag/app/AppContext.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/AppContext.java b/tez-dag/src/main/java/org/apache/tez/dag/app/AppContext.java
index e3d5b78..20f1c59 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/AppContext.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/AppContext.java
@@ -21,7 +21,6 @@ package org.apache.tez.dag.app;
 import java.util.Map;
 
 import org.apache.hadoop.classification.InterfaceAudience;
-import org.apache.hadoop.yarn.ClusterInfo;
 import org.apache.hadoop.yarn.api.records.ApplicationAccessType;
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationId;

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/973317c7/tez-dag/src/main/java/org/apache/tez/dag/app/ClusterInfo.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/ClusterInfo.java b/tez-dag/src/main/java/org/apache/tez/dag/app/ClusterInfo.java
new file mode 100644
index 0000000..b307838
--- /dev/null
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/ClusterInfo.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.tez.dag.app;
+
+import org.apache.hadoop.yarn.api.records.Resource;
+import org.apache.tez.dag.api.TezUncheckedException;
+
+public class ClusterInfo {
+  private Resource maxContainerCapability;
+  private boolean initialized = false;
+
+  public ClusterInfo() {
+  }
+  
+  public ClusterInfo(Resource maxCapability) {
+    this.maxContainerCapability = maxCapability;
+    initialized = true;
+  }
+
+  public Resource getMaxContainerCapability() {
+    if (!initialized) {
+      throw new TezUncheckedException("ClusterInfo not initialized yet");
+    }
+    return maxContainerCapability;
+  }
+
+  public void setMaxContainerCapability(Resource maxContainerCapability) {
+    this.maxContainerCapability = maxContainerCapability;
+    initialized = true;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/973317c7/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
index 1bc6809..f8e8fb4 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
@@ -47,7 +47,6 @@ import org.apache.hadoop.security.token.TokenIdentifier;
 import org.apache.hadoop.service.CompositeService;
 import org.apache.hadoop.service.Service;
 import org.apache.hadoop.util.ShutdownHookManager;
-import org.apache.hadoop.yarn.ClusterInfo;
 import org.apache.hadoop.yarn.YarnUncaughtExceptionHandler;
 import org.apache.hadoop.yarn.api.ApplicationConstants;
 import org.apache.hadoop.yarn.api.ApplicationConstants.Environment;

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/973317c7/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java
index 89cb34a..474de2f 100644
--- a/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java
+++ b/tez-dag/src/test/java/org/apache/tez/dag/app/dag/impl/TestTaskAttempt.java
@@ -40,7 +40,6 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.RawLocalFileSystem;
 import org.apache.hadoop.security.Credentials;
 import org.apache.hadoop.security.token.Token;
-import org.apache.hadoop.yarn.ClusterInfo;
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.hadoop.yarn.api.records.ApplicationId;
 import org.apache.hadoop.yarn.api.records.Container;
@@ -58,6 +57,7 @@ import org.apache.tez.dag.api.TezConfiguration;
 import org.apache.tez.dag.api.VertexLocationHint.TaskLocationHint;
 import org.apache.tez.dag.api.oldrecords.TaskAttemptState;
 import org.apache.tez.dag.app.AppContext;
+import org.apache.tez.dag.app.ClusterInfo;
 import org.apache.tez.dag.app.ContainerHeartbeatHandler;
 import org.apache.tez.dag.app.TaskAttemptListener;
 import org.apache.tez.dag.app.TaskHeartbeatHandler;


Mime
View raw message