tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject [2/2] git commit: Re-apply correct patch. TEZ-402. Define a TezTaskContext for user code to interact with the AM. (hitesh)
Date Wed, 04 Sep 2013 21:06:22 GMT
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 <hitesh@apache.org>
Authored: Wed Sep 4 14:05:09 2013 -0700
Committer: Hitesh Shah <hitesh@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;
+  }
+
+}


Mime
View raw message