tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject git commit: TEZ-415. Initial work on Tez*Context impls to aid integration. (hitesh)
Date Wed, 04 Sep 2013 21:39:40 GMT
Updated Branches:
  refs/heads/TEZ-398 2de8aa74d -> 73e1b6c4c


TEZ-415. Initial work on Tez*Context impls to aid integration. (hitesh)


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

Branch: refs/heads/TEZ-398
Commit: 73e1b6c4cb15ef3885fe05a9fe006ac43c99ac5b
Parents: 2de8aa7
Author: Hitesh Shah <hitesh@apache.org>
Authored: Wed Sep 4 14:38:51 2013 -0700
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Wed Sep 4 14:38:51 2013 -0700

----------------------------------------------------------------------
 .../engine/newapi/impl/TezInputContextImpl.java | 53 ++++++++++++++++
 .../newapi/impl/TezOutputContextImpl.java       | 32 ++++++++++
 .../newapi/impl/TezProcessorContextImpl.java    | 58 +++++++++++++++++
 .../engine/newapi/impl/TezTaskContextImpl.java  | 67 ++++++++++++++++++++
 4 files changed, 210 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/73e1b6c4/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezInputContextImpl.java
----------------------------------------------------------------------
diff --git a/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezInputContextImpl.java
b/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezInputContextImpl.java
new file mode 100644
index 0000000..2047e59
--- /dev/null
+++ b/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezInputContextImpl.java
@@ -0,0 +1,53 @@
+/**
+ * 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.engine.newapi.impl;
+
+import java.util.List;
+
+import org.apache.tez.common.counters.TezCounters;
+import org.apache.tez.dag.api.TezConfiguration;
+import org.apache.tez.dag.records.TezTaskAttemptID;
+import org.apache.tez.engine.newapi.Event;
+import org.apache.tez.engine.newapi.TezInputContext;
+
+public class TezInputContextImpl extends TezTaskContextImpl
+    implements TezInputContext {
+
+  private final byte[] userPayload;
+
+  public TezInputContextImpl(TezConfiguration tezConf, String vertexName,
+      TezTaskAttemptID taskAttemptID, TezCounters counters,
+      byte[] userPayload) {
+    super(tezConf, vertexName, taskAttemptID, counters);
+    this.userPayload = userPayload;
+  }
+
+  @Override
+  public void sendEvents(List<Event> events) {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public byte[] getUserPayload() {
+    return userPayload;
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/73e1b6c4/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezOutputContextImpl.java
----------------------------------------------------------------------
diff --git a/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezOutputContextImpl.java
b/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezOutputContextImpl.java
new file mode 100644
index 0000000..5bb7917
--- /dev/null
+++ b/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezOutputContextImpl.java
@@ -0,0 +1,32 @@
+package org.apache.tez.engine.newapi.impl;
+
+import java.util.List;
+
+import org.apache.tez.common.counters.TezCounters;
+import org.apache.tez.dag.api.TezConfiguration;
+import org.apache.tez.dag.records.TezTaskAttemptID;
+import org.apache.tez.engine.newapi.Event;
+
+public class TezOutputContextImpl extends TezTaskContextImpl {
+
+  private final byte[] userPayload;
+
+  public TezOutputContextImpl(TezConfiguration tezConf, String vertexName,
+      TezTaskAttemptID taskAttemptID, TezCounters counters,
+      byte[] userPayload) {
+    super(tezConf, vertexName, taskAttemptID, counters);
+    this.userPayload = userPayload;
+  }
+
+  @Override
+  public void sendEvents(List<Event> events) {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public byte[] getUserPayload() {
+    return userPayload;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/73e1b6c4/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezProcessorContextImpl.java
----------------------------------------------------------------------
diff --git a/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezProcessorContextImpl.java
b/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezProcessorContextImpl.java
new file mode 100644
index 0000000..26e6978
--- /dev/null
+++ b/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezProcessorContextImpl.java
@@ -0,0 +1,58 @@
+/**
+ * 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.engine.newapi.impl;
+
+import java.util.List;
+
+import org.apache.tez.common.counters.TezCounters;
+import org.apache.tez.dag.api.TezConfiguration;
+import org.apache.tez.dag.records.TezTaskAttemptID;
+import org.apache.tez.engine.newapi.Event;
+import org.apache.tez.engine.newapi.TezProcessorContext;
+
+public class TezProcessorContextImpl extends TezTaskContextImpl
+  implements TezProcessorContext {
+
+  private final byte[] userPayload;
+
+  public TezProcessorContextImpl(TezConfiguration tezConf, String vertexName,
+      TezTaskAttemptID taskAttemptID, TezCounters counters,
+      byte[] userPayload) {
+    super(tezConf, vertexName, taskAttemptID, counters);
+    this.userPayload = userPayload;
+  }
+
+  @Override
+  public void sendEvents(List<Event> events) {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public byte[] getUserPayload() {
+    return userPayload;
+  }
+
+  @Override
+  public void setProgress(float progress) {
+    // TODO Auto-generated method stub
+
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/73e1b6c4/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezTaskContextImpl.java
----------------------------------------------------------------------
diff --git a/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezTaskContextImpl.java
b/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezTaskContextImpl.java
new file mode 100644
index 0000000..2feeb85
--- /dev/null
+++ b/tez-engine/src/main/java/org/apache/tez/engine/newapi/impl/TezTaskContextImpl.java
@@ -0,0 +1,67 @@
+/**
+ * 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.engine.newapi.impl;
+
+import org.apache.tez.common.counters.TezCounters;
+import org.apache.tez.dag.api.TezConfiguration;
+import org.apache.tez.dag.records.TezTaskAttemptID;
+import org.apache.tez.engine.newapi.TezTaskContext;
+
+public abstract class TezTaskContextImpl implements TezTaskContext {
+
+  private final TezConfiguration tezConf;
+  private final String vertexName;
+  private final TezTaskAttemptID taskAttemptID;
+  private final TezCounters counters;
+
+  public TezTaskContextImpl(TezConfiguration tezConf,
+      String vertexName, TezTaskAttemptID taskAttemptID,
+      TezCounters counters) {
+    this.tezConf = tezConf;
+    this.vertexName = vertexName;
+    this.taskAttemptID = taskAttemptID;
+    this.counters = counters;
+  }
+
+  @Override
+  public TezConfiguration getConfiguration() {
+    return tezConf;
+  }
+
+  @Override
+  public int getTaskIndex() {
+    return taskAttemptID.getTaskID().getId();
+  }
+
+  @Override
+  public int getAttemptNumber() {
+    return taskAttemptID.getId();
+  }
+
+  @Override
+  public String getVertexName() {
+    return vertexName;
+  }
+
+  @Override
+  public TezCounters getCounters() {
+    return counters;
+  }
+
+}


Mime
View raw message