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 06:16:59 UTC
git commit: TEZ-402. Define a TezTaskContext for user code to
interact with the AM. (hitesh)
Updated Branches:
refs/heads/TEZ-398 e1ed31b07 -> 8fca5bb82
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/8fca5bb8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tez/tree/8fca5bb8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tez/diff/8fca5bb8
Branch: refs/heads/TEZ-398
Commit: 8fca5bb82707de17fd32f5dc31d28caeae499927
Parents: e1ed31b
Author: Hitesh Shah <hi...@apache.org>
Authored: Tue Sep 3 21:15:48 2013 -0700
Committer: Hitesh Shah <hi...@apache.org>
Committed: Tue Sep 3 21:15:48 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 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/8fca5bb8/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/8fca5bb8/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/8fca5bb8/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..0984fb5
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezInputContext.java
@@ -0,0 +1,23 @@
+/**
+ * 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/8fca5bb8/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..1c7deed
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezOutputContext.java
@@ -0,0 +1,23 @@
+/**
+ * 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/8fca5bb8/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..d344c02
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezProcessorContext.java
@@ -0,0 +1,25 @@
+/**
+ * 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/8fca5bb8/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
new file mode 100644
index 0000000..8f408bf
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/TezRuntimeContext.java
@@ -0,0 +1,44 @@
+/**
+ * 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/8fca5bb8/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..546400d
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/UserEvent.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;
+
+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/8fca5bb8/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..ae5e366
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/events/system/InputDataErrorEvent.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.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/8fca5bb8/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
new file mode 100644
index 0000000..3c0c75c
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/TezEngineContext.java
@@ -0,0 +1,65 @@
+/**
+ * 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/8fca5bb8/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
new file mode 100644
index 0000000..46a36b6
--- /dev/null
+++ b/tez-engine-api/src/main/java/org/apache/tez/engine/newapi/impl/UserEventIDInfo.java
@@ -0,0 +1,94 @@
+/**
+ * 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/8fca5bb8/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/8fca5bb8/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/8fca5bb8/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/8fca5bb8/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..3b8a5be
--- /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.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;
+ }
+
+}