You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tez.apache.org by hi...@apache.org on 2013/09/04 23:06:21 UTC

[1/2] git commit: Revert "TEZ-402. Define a TezTaskContext for user code to interact with the AM. (hitesh)"

Updated Branches:
  refs/heads/TEZ-398 5e17f1cc0 -> 2de8aa74d


Revert "TEZ-402. Define a TezTaskContext for user code to interact with the AM. (hitesh)"

This reverts commit 8fca5bb82707de17fd32f5dc31d28caeae499927.


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

Branch: refs/heads/TEZ-398
Commit: 1616d2c590c23f9f73ea69df0e6d6f95c1960222
Parents: 5e17f1c
Author: Hitesh Shah <hi...@apache.org>
Authored: Wed Sep 4 14:02:40 2013 -0700
Committer: Hitesh Shah <hi...@apache.org>
Committed: Wed Sep 4 14:02:40 2013 -0700

----------------------------------------------------------------------
 .../org/apache/tez/engine/newapi/Event.java     | 42 ---------
 .../apache/tez/engine/newapi/SystemEvent.java   | 30 -------
 .../tez/engine/newapi/TezInputContext.java      | 23 -----
 .../tez/engine/newapi/TezOutputContext.java     | 23 -----
 .../tez/engine/newapi/TezProcessorContext.java  | 25 ------
 .../tez/engine/newapi/TezRuntimeContext.java    | 44 ---------
 .../org/apache/tez/engine/newapi/UserEvent.java | 61 -------------
 .../events/system/InputDataErrorEvent.java      | 47 ----------
 .../engine/newapi/impl/TezEngineContext.java    | 65 --------------
 .../tez/engine/newapi/impl/UserEventIDInfo.java | 94 --------------------
 .../tez/engine/newapi/rpc/impl/InputSpec.java   | 51 -----------
 .../tez/engine/newapi/rpc/impl/OutputSpec.java  | 48 ----------
 .../tez/engine/newapi/rpc/impl/TaskSpec.java    | 48 ----------
 .../engine/newapi/rpc/impl/TezUserEvent.java    | 57 ------------
 14 files changed, 658 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/Event.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/Event.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/Event.java
deleted file mode 100644
index f5bcdd8..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/Event.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * 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;
-
-/**
- * Base class for all events generated within the Tez execution engine.
- * Used as the primary mode of communication between the AM, Inputs, Processors
- * and Outputs.
- */
-public abstract class Event {
-
-  public static enum EventType {
-    SYSTEM,
-    USER
-  }
-
-  private final EventType eventType;
-
-  public Event(EventType eventType) {
-    this.eventType = eventType;
-  }
-
-  public EventType getEventType() {
-    return eventType;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/SystemEvent.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/SystemEvent.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/SystemEvent.java
deleted file mode 100644
index be22f57..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/SystemEvent.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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;
-
-/**
- * Base class for all system events that are understood by the Tez framework.
- * SystemEvents can be generated either by the framework or the user code.
- */
-public abstract class SystemEvent extends Event {
-
-  protected SystemEvent() {
-    super(EventType.SYSTEM);
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezInputContext.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezInputContext.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezInputContext.java
deleted file mode 100644
index 0984fb5..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezInputContext.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * 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;
-
-public interface TezInputContext extends TezRuntimeContext {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezOutputContext.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezOutputContext.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezOutputContext.java
deleted file mode 100644
index 1c7deed..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezOutputContext.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * 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;
-
-public interface TezOutputContext extends TezRuntimeContext {
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezProcessorContext.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezProcessorContext.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezProcessorContext.java
deleted file mode 100644
index d344c02..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezProcessorContext.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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;
-
-public interface TezProcessorContext extends TezRuntimeContext {
-
-  public void setProgress(float progress);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezRuntimeContext.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezRuntimeContext.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezRuntimeContext.java
deleted file mode 100644
index 8f408bf..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezRuntimeContext.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * 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;
-
-import java.util.List;
-
-import org.apache.tez.common.counters.TezCounters;
-import org.apache.tez.dag.api.TezConfiguration;
-
-public interface TezRuntimeContext {
-
-  public TezConfiguration getConfiguration();
-
-  public int getTaskID();
-
-  public int getAttemptID();
-
-  public String getVertexName();
-
-  public TezCounters getCounters();
-
-  public List<Event> getEvents();
-
-  public void sendEvents(List<Event> events);
-
-  public byte[] getUserPayload();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/UserEvent.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/UserEvent.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/UserEvent.java
deleted file mode 100644
index 546400d..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/UserEvent.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * 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;
-
-public class UserEvent extends Event {
-
-  /**
-   * Index(i) of the i-th (physical) Input or Output that generated an Event.
-   * For a Processor-generated event, this is ignored.
-   */
-  private final int sourceIndex;
-
-  private int targetIndex;
-
-  private final byte[] userPayload;
-
-  public UserEvent(int index,
-      byte[] userPayload) {
-    super(EventType.USER);
-    this.userPayload = userPayload;
-    this.sourceIndex = index;
-  }
-
-  public UserEvent(byte[] userPayload) {
-    this(0, userPayload);
-  }
-
-  public byte[] getUserPayload() {
-    return userPayload;
-  }
-
-  public int getSourceIndex() {
-    return sourceIndex;
-  }
-
-  public int getTargetIndex() {
-    return targetIndex;
-  }
-
-  void setTargetIndex(int targetIndex) {
-    this.targetIndex = targetIndex;
-  }
-
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/events/system/InputDataErrorEvent.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/events/system/InputDataErrorEvent.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/events/system/InputDataErrorEvent.java
deleted file mode 100644
index ae5e366..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/events/system/InputDataErrorEvent.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * 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.events.system;
-
-import org.apache.tez.engine.newapi.SystemEvent;
-
-/**
- * System event generated by an Input to indicate error when trying to
- * retrieve data.
- */
-public class InputDataErrorEvent extends SystemEvent {
-
-  private final String diagnostics;
-
-  private final int index;
-
-  protected InputDataErrorEvent(String diagnostics, int index) {
-    super();
-    this.diagnostics = diagnostics;
-    this.index = index;
-  }
-
-  public String getDiagnostics() {
-    return diagnostics;
-  }
-
-  public int getIndex() {
-    return index;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/TezEngineContext.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/TezEngineContext.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/TezEngineContext.java
deleted file mode 100644
index 3c0c75c..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/TezEngineContext.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/**
- * 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 java.util.Map;
-
-import org.apache.tez.dag.records.TezTaskAttemptID;
-import org.apache.tez.engine.newapi.Event;
-import org.apache.tez.engine.newapi.rpc.impl.TaskSpec;
-
-/**
- * Interface to the RPC layer ( umbilical ) between the Tez AM and
- * a Tez Container's JVM.
- */
-public interface TezEngineContext {
-
-  /**
-   * Heartbeat call back to the AM from the Container JVM
-   * @param events Events to be sent to the AM
-   * @return Events sent by the AM to the Container JVM which in turn will
-   * be handled either by the JVM or routed to the approrpiate instances of
-   * Input/Processor/Outputs with a particular Task Attempt.
-   */
-  public Event[] hearbeat(Event[] events);
-
-  /**
-   * Hook to ask the Tez AM for the next task to be run on the Container
-   * @return Next task to be run
-   */
-  public TaskSpec getNextTask();
-
-  /**
-   * Hook to query the Tez AM whether a particular Task Attempt can commit its
-   * output.
-   * @param attemptIDs Attempt IDs of the Tasks that are waiting to commit.
-   * @return Map of boolean flags indicating whether the respective task
-   * attempts can commit.
-   */
-  public Map<TezTaskAttemptID, Boolean>
-      canTaskCommit(List<TezTaskAttemptID> attemptIDs);
-
-  /**
-   * Inform the Tez AM that one ore more Task attempts have failed.
-   * @param attemptIDs Task Attempt IDs for the failed attempts.
-   */
-  public void taskFailed(List<TezTaskAttemptID> attemptIDs);
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/UserEventIDInfo.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/UserEventIDInfo.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/UserEventIDInfo.java
deleted file mode 100644
index 46a36b6..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/UserEventIDInfo.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * 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.engine.newapi.TezInputContext;
-import org.apache.tez.engine.newapi.TezOutputContext;
-import org.apache.tez.engine.newapi.TezProcessorContext;
-
-/**
- * Class that encapsulates all the information to identify the unique
- * object that either generated an Event or is the recipient of an Event.
- */
-public class UserEventIDInfo {
-
-  public static enum UserEventIDType {
-    INPUT,
-    PROCESSOR,
-    OUTPUT
-  }
-
-  /**
-   * Source Type ( one of Input/Output/Processor ) that generated the Event.
-   */
-  private final UserEventIDType sourceType;
-
-  /**
-   * Name of the vertex where the event was generated.
-   */
-  private final String sourceVertexName;
-
-  /**
-   * Index(i) of the i-th (physical) Input or Output that generated an Event.
-   * For a Processor-generated event, this is ignored.
-   */
-  private final int index;
-
-  private UserEventIDInfo(UserEventIDType sourceType,
-      String sourceVertexName,
-      int index) {
-    this.sourceType = sourceType;
-    this.sourceVertexName = sourceVertexName;
-    this.index = index;
-  }
-
-  public UserEventIDInfo(TezInputContext inputContext, int index) {
-    // TODO
-    this(UserEventIDType.INPUT,
-        inputContext.getVertexName(),
-        index);
-  }
-
-  public UserEventIDInfo(TezOutputContext outputContext, int index) {
-    // TODO
-    this(UserEventIDType.OUTPUT,
-        outputContext.getVertexName(),
-        index);
-  }
-
-  public UserEventIDInfo(TezProcessorContext processorContext) {
-    // TODO
-    this(UserEventIDType.PROCESSOR,
-        processorContext.getVertexName(),
-        0);
-  }
-
-  public UserEventIDType getSourceType() {
-    return sourceType;
-  }
-
-  public String getSourceVertexName() {
-    return sourceVertexName;
-  }
-
-  public int getIndex() {
-    return index;
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/InputSpec.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/InputSpec.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/InputSpec.java
deleted file mode 100644
index 200ec21..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/InputSpec.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * 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.rpc.impl;
-
-import org.apache.tez.dag.api.InputDescriptor;
-import org.apache.tez.dag.records.TezVertexID;
-
-/**
- * Serializable information of a given Physical Input.
- */
-public interface InputSpec {
-
-  /**
-   * @return The name of the Source Vertex whose Output is consumed by this
-   * Input.
-   */
-  public String getSourceVertexName();
-
-  /**
-   * @return The Vertex ID of the Source Vertex whose Output is consumed by this
-   * Input.
-   */
-  public TezVertexID getSourceVertexID();
-
-  /**
-   * @return {@link InputDescriptor}
-   */
-  public InputDescriptor getInputDescriptor();
-
-  /**
-   * @return The no. of physical edges mapping to this Input.
-   */
-  public int getPhysicalEdgeCount();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/OutputSpec.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/OutputSpec.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/OutputSpec.java
deleted file mode 100644
index 0cf41b6..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/OutputSpec.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * 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.rpc.impl;
-
-import org.apache.tez.dag.api.OutputDescriptor;
-import org.apache.tez.dag.records.TezVertexID;
-
-public interface OutputSpec {
-
-  /**
-   * @return The name of the Target Vertex whose Input is consumed by this
-   * Output.
-   */
-  public String getDestinationVertexName();
-
-  /**
-   * @return The Vertex ID of the Target Vertex whose Input is consumed by this
-   * Output.
-   */
-  public TezVertexID getDestinationVertexID();
-
-  /**
-   * @return {@link OutputDescriptor}
-   */
-  public OutputDescriptor getOutputDescriptor();
-
-  /**
-   * @return The no. of physical edges mapping to this Output.
-   */
-  public int getPhysicalEdgeCount();
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TaskSpec.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TaskSpec.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TaskSpec.java
deleted file mode 100644
index 8349d5b..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TaskSpec.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * 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.rpc.impl;
-
-import java.util.List;
-
-import org.apache.tez.dag.api.ProcessorDescriptor;
-
-/**
- * Serializable Task information that is sent across the Umbilical from the
- * Tez AM to the Tez Container's JVM.
- */
-public interface TaskSpec {
-
-  /**
-   * The Processor definition for the given Task
-   * @return {@link ProcessorDescriptor}
-   */
-  public ProcessorDescriptor getProcessorDescriptor();
-
-  /**
-   * The List of Inputs for this Task.
-   * @return {@link Input}
-   */
-  public List<InputSpec> getInputs();
-
-  /**
-   * The List of Outputs for this Task.
-   * @return {@link Output}
-   */
-  public List<OutputSpec> getOutputs();
-}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/1616d2c5/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TezUserEvent.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TezUserEvent.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TezUserEvent.java
deleted file mode 100644
index 3b8a5be..0000000
--- a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TezUserEvent.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * 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.rpc.impl;
-
-import org.apache.tez.engine.newapi.UserEvent;
-import org.apache.tez.engine.newapi.impl.UserEventIDInfo;
-
-public class TezUserEvent {
-
-  private final UserEvent userEvent;
-
-  private UserEventIDInfo sourceInfo;
-
-  private UserEventIDInfo targetInfo;
-
-  public TezUserEvent(UserEvent userEvent, UserEventIDInfo sourceInfo) {
-    this.userEvent = userEvent;
-    this.setSourceInfo(sourceInfo);
-  }
-
-  public UserEvent getUserEvent() {
-    return userEvent;
-  }
-
-  public UserEventIDInfo getSourceInfo() {
-    return sourceInfo;
-  }
-
-  public void setSourceInfo(UserEventIDInfo sourceInfo) {
-    this.sourceInfo = sourceInfo;
-  }
-
-  public UserEventIDInfo getTargetInfo() {
-    return targetInfo;
-  }
-
-  public void setTargetInfo(UserEventIDInfo targetInfo) {
-    this.targetInfo = targetInfo;
-  }
-
-}


[2/2] git commit: Re-apply correct patch. TEZ-402. Define a TezTaskContext for user code to interact with the AM. (hitesh)

Posted by hi...@apache.org.
Re-apply correct patch. TEZ-402. Define a TezTaskContext for user code to interact with the AM. (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/2de8aa74
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tez/tree/2de8aa74
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tez/diff/2de8aa74

Branch: refs/heads/TEZ-398
Commit: 2de8aa74d8bbd48d64a012183baecbcc4b191169
Parents: 1616d2c
Author: Hitesh Shah <hi...@apache.org>
Authored: Wed Sep 4 14:05:09 2013 -0700
Committer: Hitesh Shah <hi...@apache.org>
Committed: Wed Sep 4 14:05:09 2013 -0700

----------------------------------------------------------------------
 .../org/apache/tez/engine/newapi/Event.java     | 42 +++++++++++
 .../apache/tez/engine/newapi/SystemEvent.java   | 30 ++++++++
 .../tez/engine/newapi/TezInputContext.java      | 26 +++++++
 .../tez/engine/newapi/TezOutputContext.java     | 26 +++++++
 .../tez/engine/newapi/TezProcessorContext.java  | 32 ++++++++
 .../tez/engine/newapi/TezTaskContext.java       | 71 ++++++++++++++++++
 .../org/apache/tez/engine/newapi/UserEvent.java | 77 ++++++++++++++++++++
 .../events/system/InputDataErrorEvent.java      | 53 ++++++++++++++
 .../tez/engine/newapi/impl/EventMetaData.java   | 57 +++++++++++++++
 .../tez/engine/newapi/impl/TezUmbilical.java    | 61 ++++++++++++++++
 .../tez/engine/newapi/rpc/impl/InputSpec.java   | 51 +++++++++++++
 .../tez/engine/newapi/rpc/impl/OutputSpec.java  | 48 ++++++++++++
 .../tez/engine/newapi/rpc/impl/TaskSpec.java    | 48 ++++++++++++
 .../engine/newapi/rpc/impl/TezUserEvent.java    | 57 +++++++++++++++
 14 files changed, 679 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/Event.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/Event.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/Event.java
new file mode 100644
index 0000000..f5bcdd8
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/Event.java
@@ -0,0 +1,42 @@
+/**
+ * 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;
+
+/**
+ * Base class for all events generated within the Tez execution engine.
+ * Used as the primary mode of communication between the AM, Inputs, Processors
+ * and Outputs.
+ */
+public abstract class Event {
+
+  public static enum EventType {
+    SYSTEM,
+    USER
+  }
+
+  private final EventType eventType;
+
+  public Event(EventType eventType) {
+    this.eventType = eventType;
+  }
+
+  public EventType getEventType() {
+    return eventType;
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/SystemEvent.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/SystemEvent.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/SystemEvent.java
new file mode 100644
index 0000000..be22f57
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/SystemEvent.java
@@ -0,0 +1,30 @@
+/**
+ * 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;
+
+/**
+ * Base class for all system events that are understood by the Tez framework.
+ * SystemEvents can be generated either by the framework or the user code.
+ */
+public abstract class SystemEvent extends Event {
+
+  protected SystemEvent() {
+    super(EventType.SYSTEM);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezInputContext.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezInputContext.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezInputContext.java
new file mode 100644
index 0000000..38780ab
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezInputContext.java
@@ -0,0 +1,26 @@
+/**
+ * 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;
+
+/**
+ * Context handle for the Input to initialize itself.
+ */
+public interface TezInputContext extends TezTaskContext {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezOutputContext.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezOutputContext.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezOutputContext.java
new file mode 100644
index 0000000..3a0fceb
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezOutputContext.java
@@ -0,0 +1,26 @@
+/**
+ * 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;
+
+/**
+ * Context handle for the Output to initialize itself.
+ */
+public interface TezOutputContext extends TezTaskContext {
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezProcessorContext.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezProcessorContext.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezProcessorContext.java
new file mode 100644
index 0000000..dbf387a
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezProcessorContext.java
@@ -0,0 +1,32 @@
+/**
+ * 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;
+
+/**
+ * Context handle for the Processor to initialize itself.
+ */
+public interface TezProcessorContext extends TezTaskContext {
+
+  /**
+   * Set the overall progress of this Task Attempt
+   * @param progress Progress in the range from [0.0 - 1.0f]
+   */
+  public void setProgress(float progress);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezTaskContext.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezTaskContext.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezTaskContext.java
new file mode 100644
index 0000000..aff7cde
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezTaskContext.java
@@ -0,0 +1,71 @@
+/**
+ * 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;
+
+import java.util.List;
+
+import org.apache.tez.common.counters.TezCounters;
+import org.apache.tez.dag.api.TezConfiguration;
+
+/**
+ * Base interface for Context classes used to initialize the Input, Output
+ * and Processor instances.
+ */
+public interface TezTaskContext {
+
+  /**
+   * Get the Tez Configuration
+   * @return {@link TezConfiguration}
+   */
+  public TezConfiguration getConfiguration();
+
+  /**
+   * Get the index of this Task
+   * @return Task Index
+   */
+  public int getTaskIndex();
+
+  /**
+   * Get the current Task Attempt Number
+   * @return Attempt Number
+   */
+  public int getAttemptNumber();
+
+  /**
+   * Get the name of the Vertex
+   * @return Vertex Name
+   */
+  public String getVertexName();
+
+
+  public TezCounters getCounters();
+
+  /**
+   * Send Events to the AM and/or dependent Vertices
+   * @param events Events to be sent
+   */
+  public void sendEvents(List<Event> events);
+
+  /**
+   * Get the User Payload for the Input/Output/Processor
+   * @return User Payload
+   */
+  public byte[] getUserPayload();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/UserEvent.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/UserEvent.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/UserEvent.java
new file mode 100644
index 0000000..e95eec4
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/UserEvent.java
@@ -0,0 +1,77 @@
+/**
+ * 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;
+
+public class UserEvent extends Event {
+
+  /**
+   * Index(i) of the i-th (physical) Input or Output that generated an Event.
+   * For a Processor-generated event, this is ignored.
+   */
+  private final int sourceIndex;
+
+  /**
+   * Index(i) of the i-th (physical) Input or Output that is meant to receive
+   * this Event. For a Processor event, this is ignored.
+   */
+  private int targetIndex;
+
+  /**
+   * User Payload for this User Event
+   */
+  private final byte[] userPayload;
+
+  /**
+   * User Event constructor
+   * @param index Index to identify the physical edge of the input/output
+   * @param userPayload User Payload of the User Event
+   */
+  public UserEvent(int index,
+      byte[] userPayload) {
+    super(EventType.USER);
+    this.userPayload = userPayload;
+    this.sourceIndex = index;
+  }
+
+  /**
+   * Constructor for Processor-generated User Events
+   * @param userPayload
+   */
+  public UserEvent(byte[] userPayload) {
+    this(-1, userPayload);
+  }
+
+  public byte[] getUserPayload() {
+    return userPayload;
+  }
+
+  public int getSourceIndex() {
+    return sourceIndex;
+  }
+
+  public int getTargetIndex() {
+    return targetIndex;
+  }
+
+  void setTargetIndex(int targetIndex) {
+    this.targetIndex = targetIndex;
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/events/system/InputDataErrorEvent.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/events/system/InputDataErrorEvent.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/events/system/InputDataErrorEvent.java
new file mode 100644
index 0000000..0b55878
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/events/system/InputDataErrorEvent.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.events.system;
+
+import org.apache.tez.engine.newapi.SystemEvent;
+
+/**
+ * System event generated by an Input to indicate error when trying to
+ * retrieve data.
+ */
+public class InputDataErrorEvent extends SystemEvent {
+
+  /**
+   * Diagnostics/trace of the error that occurred on the Input's edge.
+   */
+  private final String diagnostics;
+
+  /**
+   * Index of the physical edge on which the error occurred.
+   */
+  private final int index;
+
+  protected InputDataErrorEvent(String diagnostics, int index) {
+    super();
+    this.diagnostics = diagnostics;
+    this.index = index;
+  }
+
+  public String getDiagnostics() {
+    return diagnostics;
+  }
+
+  public int getIndex() {
+    return index;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/EventMetaData.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/EventMetaData.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/EventMetaData.java
new file mode 100644
index 0000000..1ad133b
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/EventMetaData.java
@@ -0,0 +1,57 @@
+/**
+ * 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;
+
+/**
+ * Class that encapsulates all the information to identify the unique
+ * object that either generated an Event or is the recipient of an Event.
+ */
+public class EventMetaData {
+
+  public static enum EventGenerator {
+    INPUT,
+    PROCESSOR,
+    OUTPUT
+  }
+
+  /**
+   * Source Type ( one of Input/Output/Processor ) that generated the Event.
+   */
+  private final EventGenerator generator;
+
+  /**
+   * Name of the vertex where the event was generated.
+   */
+  private final String vertexName;
+
+  public EventMetaData(EventGenerator idType,
+      String vertexName) {
+    this.generator = idType;
+    this.vertexName = vertexName;
+  }
+
+  public EventGenerator getIDType() {
+    return generator;
+  }
+
+  public String getVertexName() {
+    return vertexName;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/TezUmbilical.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/TezUmbilical.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/TezUmbilical.java
new file mode 100644
index 0000000..cb8bd6d
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/TezUmbilical.java
@@ -0,0 +1,61 @@
+/**
+ * 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.dag.records.TezTaskAttemptID;
+import org.apache.tez.engine.newapi.Event;
+import org.apache.tez.engine.newapi.rpc.impl.TaskSpec;
+
+/**
+ * Interface to the RPC layer ( umbilical ) between the Tez AM and
+ * a Tez Container's JVM.
+ */
+public interface TezUmbilical {
+
+  /**
+   * Heartbeat call back to the AM from the Container JVM
+   * @param events Events to be sent to the AM
+   * @return Events sent by the AM to the Container JVM which in turn will
+   * be handled either by the JVM or routed to the appropriate instances of
+   * Input/Processor/Outputs with a particular Task Attempt.
+   */
+  public Event[] hearbeat(Event[] events);
+
+  /**
+   * Hook to ask the Tez AM for the next task to be run on the Container
+   * @return Next task to be run
+   */
+  public TaskSpec getNextTask();
+
+  /**
+   * Hook to query the Tez AM whether a particular Task Attempt can commit its
+   * output.
+   * @param attemptIDs Attempt IDs of the Tasks that are waiting to commit.
+   * @return Map of boolean flags indicating whether the respective task
+   * attempts can commit.
+   */
+  public boolean canTaskCommit(TezTaskAttemptID attemptID);
+
+  /**
+   * Inform the Tez AM that one or more Task attempts have failed.
+   * @param attemptIDs Task Attempt IDs for the failed attempts.
+   */
+  public void taskFailed(TezTaskAttemptID attemptID);
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/InputSpec.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/InputSpec.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/InputSpec.java
new file mode 100644
index 0000000..200ec21
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/InputSpec.java
@@ -0,0 +1,51 @@
+/**
+ * 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.rpc.impl;
+
+import org.apache.tez.dag.api.InputDescriptor;
+import org.apache.tez.dag.records.TezVertexID;
+
+/**
+ * Serializable information of a given Physical Input.
+ */
+public interface InputSpec {
+
+  /**
+   * @return The name of the Source Vertex whose Output is consumed by this
+   * Input.
+   */
+  public String getSourceVertexName();
+
+  /**
+   * @return The Vertex ID of the Source Vertex whose Output is consumed by this
+   * Input.
+   */
+  public TezVertexID getSourceVertexID();
+
+  /**
+   * @return {@link InputDescriptor}
+   */
+  public InputDescriptor getInputDescriptor();
+
+  /**
+   * @return The no. of physical edges mapping to this Input.
+   */
+  public int getPhysicalEdgeCount();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/OutputSpec.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/OutputSpec.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/OutputSpec.java
new file mode 100644
index 0000000..0cf41b6
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/OutputSpec.java
@@ -0,0 +1,48 @@
+/**
+ * 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.rpc.impl;
+
+import org.apache.tez.dag.api.OutputDescriptor;
+import org.apache.tez.dag.records.TezVertexID;
+
+public interface OutputSpec {
+
+  /**
+   * @return The name of the Target Vertex whose Input is consumed by this
+   * Output.
+   */
+  public String getDestinationVertexName();
+
+  /**
+   * @return The Vertex ID of the Target Vertex whose Input is consumed by this
+   * Output.
+   */
+  public TezVertexID getDestinationVertexID();
+
+  /**
+   * @return {@link OutputDescriptor}
+   */
+  public OutputDescriptor getOutputDescriptor();
+
+  /**
+   * @return The no. of physical edges mapping to this Output.
+   */
+  public int getPhysicalEdgeCount();
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TaskSpec.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TaskSpec.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TaskSpec.java
new file mode 100644
index 0000000..8349d5b
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TaskSpec.java
@@ -0,0 +1,48 @@
+/**
+ * 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.rpc.impl;
+
+import java.util.List;
+
+import org.apache.tez.dag.api.ProcessorDescriptor;
+
+/**
+ * Serializable Task information that is sent across the Umbilical from the
+ * Tez AM to the Tez Container's JVM.
+ */
+public interface TaskSpec {
+
+  /**
+   * The Processor definition for the given Task
+   * @return {@link ProcessorDescriptor}
+   */
+  public ProcessorDescriptor getProcessorDescriptor();
+
+  /**
+   * The List of Inputs for this Task.
+   * @return {@link Input}
+   */
+  public List<InputSpec> getInputs();
+
+  /**
+   * The List of Outputs for this Task.
+   * @return {@link Output}
+   */
+  public List<OutputSpec> getOutputs();
+}

http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/2de8aa74/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TezUserEvent.java
----------------------------------------------------------------------
diff --git a/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TezUserEvent.java b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TezUserEvent.java
new file mode 100644
index 0000000..03d5b7b
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/rpc/impl/TezUserEvent.java
@@ -0,0 +1,57 @@
+/**
+ * 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.rpc.impl;
+
+import org.apache.tez.engine.newapi.UserEvent;
+import org.apache.tez.engine.newapi.impl.EventMetaData;
+
+public class TezUserEvent {
+
+  private final UserEvent userEvent;
+
+  private EventMetaData sourceInfo;
+
+  private EventMetaData targetInfo;
+
+  public TezUserEvent(UserEvent userEvent, EventMetaData sourceInfo) {
+    this.userEvent = userEvent;
+    this.setSourceInfo(sourceInfo);
+  }
+
+  public UserEvent getUserEvent() {
+    return userEvent;
+  }
+
+  public EventMetaData getSourceInfo() {
+    return sourceInfo;
+  }
+
+  public void setSourceInfo(EventMetaData sourceInfo) {
+    this.sourceInfo = sourceInfo;
+  }
+
+  public EventMetaData getTargetInfo() {
+    return targetInfo;
+  }
+
+  public void setTargetInfo(EventMetaData targetInfo) {
+    this.targetInfo = targetInfo;
+  }
+
+}