hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r1087462 [7/20] - in /hadoop/mapreduce/branches/MR-279: ./ mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapred/ mr-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/jobhistory/ mr-client/h...
Date Thu, 31 Mar 2011 22:23:34 GMT
Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskAttemptResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskAttemptResponsePBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskAttemptResponsePBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskAttemptResponsePBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,41 @@
+package org.apache.hadoop.mapreduce.v2.api.protocolrecords.impl.pb;
+
+
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.KillTaskAttemptResponse;
+import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.KillTaskAttemptResponseProto;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class KillTaskAttemptResponsePBImpl extends ProtoBase<KillTaskAttemptResponseProto> implements KillTaskAttemptResponse {
+  KillTaskAttemptResponseProto proto = KillTaskAttemptResponseProto.getDefaultInstance();
+  KillTaskAttemptResponseProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  public KillTaskAttemptResponsePBImpl() {
+    builder = KillTaskAttemptResponseProto.newBuilder();
+  }
+
+  public KillTaskAttemptResponsePBImpl(KillTaskAttemptResponseProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public KillTaskAttemptResponseProto getProto() {
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = KillTaskAttemptResponseProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+
+
+
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskRequestPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskRequestPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskRequestPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskRequestPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,91 @@
+package org.apache.hadoop.mapreduce.v2.api.protocolrecords.impl.pb;
+
+
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.KillTaskRequest;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
+import org.apache.hadoop.mapreduce.v2.api.records.impl.pb.TaskIdPBImpl;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskIdProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.KillTaskRequestProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.KillTaskRequestProtoOrBuilder;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class KillTaskRequestPBImpl extends ProtoBase<KillTaskRequestProto> implements KillTaskRequest {
+  KillTaskRequestProto proto = KillTaskRequestProto.getDefaultInstance();
+  KillTaskRequestProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private TaskId taskId = null;
+  
+  
+  public KillTaskRequestPBImpl() {
+    builder = KillTaskRequestProto.newBuilder();
+  }
+
+  public KillTaskRequestPBImpl(KillTaskRequestProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public KillTaskRequestProto getProto() {
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.taskId != null) {
+      builder.setTaskId(convertToProtoFormat(this.taskId));
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = KillTaskRequestProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public TaskId getTaskId() {
+    KillTaskRequestProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.taskId != null) {
+      return this.taskId;
+    }
+    if (!p.hasTaskId()) {
+      return null;
+    }
+    this.taskId = convertFromProtoFormat(p.getTaskId());
+    return this.taskId;
+  }
+
+  @Override
+  public void setTaskId(TaskId taskId) {
+    maybeInitBuilder();
+    if (taskId == null) 
+      builder.clearTaskId();
+    this.taskId = taskId;
+  }
+
+  private TaskIdPBImpl convertFromProtoFormat(TaskIdProto p) {
+    return new TaskIdPBImpl(p);
+  }
+
+  private TaskIdProto convertToProtoFormat(TaskId t) {
+    return ((TaskIdPBImpl)t).getProto();
+  }
+
+
+
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskResponsePBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskResponsePBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskResponsePBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/protocolrecords/impl/pb/KillTaskResponsePBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,41 @@
+package org.apache.hadoop.mapreduce.v2.api.protocolrecords.impl.pb;
+
+
+import org.apache.hadoop.mapreduce.v2.api.protocolrecords.KillTaskResponse;
+import org.apache.hadoop.mapreduce.v2.proto.MRServiceProtos.KillTaskResponseProto;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class KillTaskResponsePBImpl extends ProtoBase<KillTaskResponseProto> implements KillTaskResponse {
+  KillTaskResponseProto proto = KillTaskResponseProto.getDefaultInstance();
+  KillTaskResponseProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  public KillTaskResponsePBImpl() {
+    builder = KillTaskResponseProto.newBuilder();
+  }
+
+  public KillTaskResponsePBImpl(KillTaskResponseProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public KillTaskResponseProto getProto() {
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = KillTaskResponseProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+
+
+
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Counter.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Counter.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Counter.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Counter.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,11 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public interface Counter {
+  public abstract String getName();
+  public abstract String getDisplayName();
+  public abstract long getValue();
+  
+  public abstract void setName(String name);
+  public abstract void setDisplayName(String displayName);
+  public abstract void setValue(long value);
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/CounterGroup.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/CounterGroup.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/CounterGroup.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/CounterGroup.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,19 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+import java.util.Map;
+
+public interface CounterGroup {
+  public abstract String getName();
+  public abstract String getDisplayName();
+  
+  public abstract Map<String, Counter> getAllCounters();
+  public abstract Counter getCounter(String key);
+  
+  public abstract void setName(String name);
+  public abstract void setDisplayName(String displayName);
+  
+  public abstract void addAllCounters(Map<String, Counter> counters);
+  public abstract void setCounter(String key, Counter value);
+  public abstract void removeCounter(String key);
+  public abstract void clearCounters();
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Counters.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Counters.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Counters.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Counters.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,13 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+import java.util.Map;
+
+public interface Counters {
+  public abstract Map<String, CounterGroup> getAllCounterGroups();
+  public abstract CounterGroup getCounterGroup(String key);
+  
+  public abstract void addAllCounterGroups(Map<String, CounterGroup> counterGroups);
+  public abstract void setCounterGroup(String key, CounterGroup value);
+  public abstract void removeCounterGroup(String key);
+  public abstract void clearCounterGroups();
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobId.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobId.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobId.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobId.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,12 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+
+public interface JobId {
+  public abstract ApplicationId getAppId();
+  public abstract int getId();
+  
+  public abstract void setAppId(ApplicationId appId);
+  public abstract void setId(int id);
+
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobReport.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobReport.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobReport.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobReport.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,21 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public interface JobReport {
+  public abstract JobId getJobId();
+  public abstract JobState getJobState();
+  public abstract float getMapProgress();
+  public abstract float getReduceProgress();
+  public abstract float getCleanupProgress();
+  public abstract float getSetupProgress();
+  public abstract long getStartTime();
+  public abstract long getFinishTime();
+
+  public abstract void setJobId(JobId jobId);
+  public abstract void setJobState(JobState jobState);
+  public abstract void setMapProgress(float progress);
+  public abstract void setReduceProgress(float progress);
+  public abstract void setCleanupProgress(float progress);
+  public abstract void setSetupProgress(float progress);
+  public abstract void setStartTime(long startTime);
+  public abstract void setFinishTime(long finishTime);
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobState.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobState.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobState.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/JobState.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,11 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public enum JobState {
+  NEW,
+  RUNNING,
+  SUCCEEDED,
+  FAILED,
+  KILL_WAIT,
+  KILLED,
+  ERROR
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Phase.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Phase.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Phase.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/Phase.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public enum Phase {
+  STARTING, MAP, SHUFFLE, SORT, REDUCE, CLEANUP
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptCompletionEvent.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptCompletionEvent.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptCompletionEvent.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptCompletionEvent.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,15 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public interface TaskAttemptCompletionEvent {
+  public abstract TaskAttemptId getAttemptId();
+  public abstract TaskAttemptCompletionEventStatus getStatus();
+  public abstract String getMapOutputServerAddress();
+  public abstract int getAttemptRunTime();
+  public abstract int getEventId();
+  
+  public abstract void setAttemptId(TaskAttemptId taskAttemptId);
+  public abstract void setStatus(TaskAttemptCompletionEventStatus status);
+  public abstract void setMapOutputServerAddress(String address);
+  public abstract void setAttemptRunTime(int runTime);
+  public abstract void setEventId(int eventId);
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptCompletionEventStatus.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptCompletionEventStatus.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptCompletionEventStatus.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptCompletionEventStatus.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,9 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public enum TaskAttemptCompletionEventStatus {
+  FAILED,
+  KILLED,
+  SUCCEEDED,
+  OBSOLETE,
+  TIPFAILED
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptId.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptId.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptId.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptId.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,9 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public interface TaskAttemptId {
+  public abstract TaskId getTaskId();
+  public abstract int getId();
+  
+  public abstract void setTaskId(TaskId taskId);
+  public abstract void setId(int id);
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptReport.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptReport.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptReport.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptReport.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,24 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public interface TaskAttemptReport {
+  public abstract TaskAttemptId getTaskAttemptId();
+  public abstract TaskAttemptState getTaskAttemptState();
+  public abstract float getProgress();
+  public abstract long getStartTime();
+  public abstract long getFinishTime();
+  public abstract Counters getCounters();
+  public abstract String getDiagnosticInfo();
+  public abstract String getStateString();
+  public abstract Phase getPhase();
+
+  public abstract void setTaskAttemptId(TaskAttemptId taskAttemptId);
+  public abstract void setTaskAttemptState(TaskAttemptState taskAttemptState);
+  public abstract void setProgress(float progress);
+  public abstract void setStartTime(long startTime);
+  public abstract void setFinishTime(long finishTime);
+  public abstract void setCounters(Counters counters);
+  public abstract void setDiagnosticInfo(String diagnosticInfo);
+  public abstract void setStateString(String stateString);
+  public abstract void setPhase(Phase phase);
+  
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptState.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptState.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptState.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskAttemptState.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,17 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public enum TaskAttemptState {
+  NEW, 
+  UNASSIGNED, 
+  ASSIGNED, 
+  RUNNING, 
+  COMMIT_PENDING, 
+  SUCCESS_CONTAINER_CLEANUP, 
+  SUCCEEDED, 
+  FAIL_CONTAINER_CLEANUP, 
+  FAIL_TASK_CLEANUP, 
+  FAILED, 
+  KILL_CONTAINER_CLEANUP, 
+  KILL_TASK_CLEANUP, 
+  KILLED
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskId.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskId.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskId.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskId.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,11 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public interface TaskId {
+  public abstract JobId getJobId();
+  public abstract  TaskType getTaskType();
+  public abstract int getId();
+  
+  public abstract void setJobId(JobId jobId);
+  public abstract void setTaskType(TaskType taskType);
+  public abstract void setId(int id);
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskReport.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskReport.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskReport.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskReport.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,42 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+import java.util.List;
+
+public interface TaskReport {
+  public abstract TaskId getTaskId();
+  public abstract TaskState getTaskState();
+  public abstract float getProgress();
+  public abstract long getStartTime();
+  public abstract long getFinishTime();
+  public abstract Counters getCounters();
+  
+  public abstract List<TaskAttemptId> getRunningAttemptsList();
+  public abstract TaskAttemptId getRunningAttempt(int index);
+  public abstract int getRunningAttemptsCount();
+  
+  public abstract TaskAttemptId getSuccessfulAttempt();
+  
+  public abstract List<String> getDiagnosticsList();
+  public abstract String getDiagnostics(int index);
+  public abstract int getDiagnosticsCount();
+  
+  
+  public abstract void setTaskId(TaskId taskId);
+  public abstract void setTaskState(TaskState taskState);
+  public abstract void setProgress(float progress);
+  public abstract void setStartTime(long startTime);
+  public abstract void setFinishTime(long finishTime);
+  public abstract void setCounters(Counters counters);
+  
+  public abstract void addAllRunningAttempts(List<TaskAttemptId> taskAttempts);
+  public abstract void addRunningAttempt(TaskAttemptId taskAttempt);
+  public abstract void removeRunningAttempt(int index);
+  public abstract void clearRunningAttempts();
+  
+  public abstract void setSuccessfulAttempt(TaskAttemptId taskAttempt)
+;
+  public abstract void addAllDiagnostics(List<String> diagnostics);
+  public abstract void addDiagnostics(String diagnostics);
+  public abstract void removeDiagnostics(int index);
+  public abstract void clearDiagnostics();
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskState.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskState.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskState.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskState.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public enum TaskState {
+  NEW, SCHEDULED, RUNNING, SUCCEEDED, FAILED, KILL_WAIT, KILLED
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskType.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskType.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskType.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/TaskType.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,5 @@
+package org.apache.hadoop.mapreduce.v2.api.records;
+
+public enum TaskType {
+  MAP, REDUCE
+}

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CounterGroupPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CounterGroupPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CounterGroupPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CounterGroupPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,189 @@
+package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
+
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.hadoop.mapreduce.v2.api.records.Counter;
+import org.apache.hadoop.mapreduce.v2.api.records.CounterGroup;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.CounterGroupProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.CounterGroupProtoOrBuilder;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.CounterProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.StringCounterMapProto;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class CounterGroupPBImpl extends ProtoBase<CounterGroupProto> implements CounterGroup {
+  CounterGroupProto proto = CounterGroupProto.getDefaultInstance();
+  CounterGroupProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private Map<String, Counter> counters = null;
+  
+  
+  public CounterGroupPBImpl() {
+    builder = CounterGroupProto.newBuilder();
+  }
+
+  public CounterGroupPBImpl(CounterGroupProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public CounterGroupProto getProto() {
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.counters != null) {
+      addContersToProto();
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = CounterGroupProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public String getName() {
+    CounterGroupProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasName()) {
+      return null;
+    }
+    return (p.getName());
+  }
+
+  @Override
+  public void setName(String name) {
+    maybeInitBuilder();
+    if (name == null) {
+      builder.clearName();
+      return;
+    }
+    builder.setName((name));
+  }
+  @Override
+  public String getDisplayName() {
+    CounterGroupProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasDisplayName()) {
+      return null;
+    }
+    return (p.getDisplayName());
+  }
+
+  @Override
+  public void setDisplayName(String displayName) {
+    maybeInitBuilder();
+    if (displayName == null) {
+      builder.clearDisplayName();
+      return;
+    }
+    builder.setDisplayName((displayName));
+  }
+  @Override
+  public Map<String, Counter> getAllCounters() {
+    initCounters();
+    return this.counters;
+  }
+  @Override
+  public Counter getCounter(String key) {
+    initCounters();
+    return this.counters.get(key);
+  }
+  
+  private void initCounters() {
+    if (this.counters != null) {
+      return;
+    }
+    CounterGroupProtoOrBuilder p = viaProto ? proto : builder;
+    List<StringCounterMapProto> list = p.getCountersList();
+    this.counters = new HashMap<String, Counter>();
+
+    for (StringCounterMapProto c : list) {
+      this.counters.put(c.getKey(), convertFromProtoFormat(c.getValue()));
+    }
+  }
+  
+  @Override
+  public void addAllCounters(final Map<String, Counter> counters) {
+    if (counters == null)
+      return;
+    initCounters();
+    this.counters.putAll(counters);
+  }
+  
+  private void addContersToProto() {
+    maybeInitBuilder();
+    builder.clearCounters();
+    if (counters == null)
+      return;
+    Iterable<StringCounterMapProto> iterable = new Iterable<StringCounterMapProto>() {
+      
+      @Override
+      public Iterator<StringCounterMapProto> iterator() {
+        return new Iterator<StringCounterMapProto>() {
+          
+          Iterator<String> keyIter = counters.keySet().iterator();
+          
+          @Override
+          public void remove() {
+            throw new UnsupportedOperationException();
+          }
+          
+          @Override
+          public StringCounterMapProto next() {
+            String key = keyIter.next();
+            return StringCounterMapProto.newBuilder().setKey(key).setValue(convertToProtoFormat(counters.get(key))).build();
+          }
+          
+          @Override
+          public boolean hasNext() {
+            return keyIter.hasNext();
+          }
+        };
+      }
+    };
+    builder.addAllCounters(iterable);
+  }
+  @Override
+  public void setCounter(String key, Counter val) {
+    initCounters();
+    this.counters.put(key, val);
+  }
+  @Override
+  public void removeCounter(String key) {
+    initCounters();
+    this.counters.remove(key);
+  }
+  @Override
+  public void clearCounters() {
+    initCounters();
+    this.counters.clear();
+  }
+
+  private CounterPBImpl convertFromProtoFormat(CounterProto p) {
+    return new CounterPBImpl(p);
+  }
+
+  private CounterProto convertToProtoFormat(Counter t) {
+    return ((CounterPBImpl)t).getProto();
+  }
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CounterPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CounterPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CounterPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CounterPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,89 @@
+package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
+
+
+import org.apache.hadoop.mapreduce.v2.api.records.Counter;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.CounterProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.CounterProtoOrBuilder;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class CounterPBImpl extends ProtoBase<CounterProto> implements Counter {
+  CounterProto proto = CounterProto.getDefaultInstance();
+  CounterProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  public CounterPBImpl() {
+    builder = CounterProto.newBuilder();
+  }
+
+  public CounterPBImpl(CounterProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public CounterProto getProto() {
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = CounterProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public String getName() {
+    CounterProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasName()) {
+      return null;
+    }
+    return (p.getName());
+  }
+
+  @Override
+  public void setName(String name) {
+    maybeInitBuilder();
+    if (name == null) {
+      builder.clearName();
+      return;
+    }
+    builder.setName((name));
+  }
+  @Override
+  public long getValue() {
+    CounterProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getValue());
+  }
+
+  @Override
+  public void setValue(long value) {
+    maybeInitBuilder();
+    builder.setValue((value));
+  }
+  @Override
+  public String getDisplayName() {
+    CounterProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasDisplayName()) {
+      return null;
+    }
+    return (p.getDisplayName());
+  }
+
+  @Override
+  public void setDisplayName(String displayName) {
+    maybeInitBuilder();
+    if (displayName == null) {
+      builder.clearDisplayName();
+      return;
+    }
+    builder.setDisplayName((displayName));
+  }
+
+
+
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CountersPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CountersPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CountersPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/CountersPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,153 @@
+package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
+
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.hadoop.mapreduce.v2.api.records.CounterGroup;
+import org.apache.hadoop.mapreduce.v2.api.records.Counters;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.CounterGroupProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.CountersProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.CountersProtoOrBuilder;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.StringCounterGroupMapProto;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class CountersPBImpl extends ProtoBase<CountersProto> implements Counters {
+  CountersProto proto = CountersProto.getDefaultInstance();
+  CountersProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private Map<String, CounterGroup> counterGroups = null;
+  
+  
+  public CountersPBImpl() {
+    builder = CountersProto.newBuilder();
+  }
+
+  public CountersPBImpl(CountersProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public CountersProto getProto() {
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.counterGroups != null) {
+      addCounterGroupsToProto();
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = CountersProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public Map<String, CounterGroup> getAllCounterGroups() {
+    initCounterGroups();
+    return this.counterGroups;
+  }
+  @Override
+  public CounterGroup getCounterGroup(String key) {
+    initCounterGroups();
+    return this.counterGroups.get(key);
+  }
+  
+  private void initCounterGroups() {
+    if (this.counterGroups != null) {
+      return;
+    }
+    CountersProtoOrBuilder p = viaProto ? proto : builder;
+    List<StringCounterGroupMapProto> list = p.getCounterGroupsList();
+    this.counterGroups = new HashMap<String, CounterGroup>();
+
+    for (StringCounterGroupMapProto c : list) {
+      this.counterGroups.put(c.getKey(), convertFromProtoFormat(c.getValue()));
+    }
+  }
+  
+  @Override
+  public void addAllCounterGroups(final Map<String, CounterGroup> counterGroups) {
+    if (counterGroups == null)
+      return;
+    initCounterGroups();
+    this.counterGroups.putAll(counterGroups);
+  }
+  
+  private void addCounterGroupsToProto() {
+    maybeInitBuilder();
+    builder.clearCounterGroups();
+    if (counterGroups == null)
+      return;
+    Iterable<StringCounterGroupMapProto> iterable = new Iterable<StringCounterGroupMapProto>() {
+      
+      @Override
+      public Iterator<StringCounterGroupMapProto> iterator() {
+        return new Iterator<StringCounterGroupMapProto>() {
+          
+          Iterator<String> keyIter = counterGroups.keySet().iterator();
+          
+          @Override
+          public void remove() {
+            throw new UnsupportedOperationException();
+          }
+          
+          @Override
+          public StringCounterGroupMapProto next() {
+            String key = keyIter.next();
+            return StringCounterGroupMapProto.newBuilder().setKey(key).setValue(convertToProtoFormat(counterGroups.get(key))).build();
+          }
+          
+          @Override
+          public boolean hasNext() {
+            return keyIter.hasNext();
+          }
+        };
+      }
+    };
+    builder.addAllCounterGroups(iterable);
+  }
+  @Override
+  public void setCounterGroup(String key, CounterGroup val) {
+    initCounterGroups();
+    this.counterGroups.put(key, val);
+  }
+  @Override
+  public void removeCounterGroup(String key) {
+    initCounterGroups();
+    this.counterGroups.remove(key);
+  }
+  @Override
+  public void clearCounterGroups() {
+    initCounterGroups();
+    this.counterGroups.clear();
+  }
+
+  private CounterGroupPBImpl convertFromProtoFormat(CounterGroupProto p) {
+    return new CounterGroupPBImpl(p);
+  }
+
+  private CounterGroupProto convertToProtoFormat(CounterGroup t) {
+    return ((CounterGroupPBImpl)t).getProto();
+  }
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/JobIdPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/JobIdPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/JobIdPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/JobIdPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,104 @@
+package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
+
+
+import org.apache.hadoop.mapreduce.v2.api.records.JobId;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.JobIdProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.JobIdProtoOrBuilder;
+import org.apache.hadoop.yarn.api.records.ApplicationId;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+import org.apache.hadoop.yarn.api.records.impl.pb.ApplicationIdPBImpl;
+import org.apache.hadoop.yarn.proto.YarnProtos.ApplicationIdProto;
+
+
+    
+public class JobIdPBImpl extends ProtoBase<JobIdProto> implements JobId {
+  JobIdProto proto = JobIdProto.getDefaultInstance();
+  JobIdProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private ApplicationId applicationId = null;
+//  boolean hasLocalAppId = false;
+  
+  
+  public JobIdPBImpl() {
+    builder = JobIdProto.newBuilder();
+  }
+
+  public JobIdPBImpl(JobIdProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+
+  @Override
+  public JobIdProto getProto() {
+  
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.applicationId != null && !((ApplicationIdPBImpl)this.applicationId).getProto().equals(builder.getAppId()))   {
+      builder.setAppId(convertToProtoFormat(this.applicationId));
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = JobIdProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public ApplicationId getAppId() {
+    JobIdProtoOrBuilder p = viaProto ? proto : builder;
+    if (applicationId != null) {
+      return applicationId;
+    } // Else via proto
+    if (!p.hasAppId()) {
+      return null;
+    }
+    applicationId = convertFromProtoFormat(p.getAppId());
+    return applicationId;
+  }
+
+  @Override
+  public void setAppId(ApplicationId appId) {
+    maybeInitBuilder();
+    if (appId == null) {
+      builder.clearAppId();
+    }
+    this.applicationId = appId;
+//    builder.setAppId(convertToProtoFormat(appId));
+  }
+  @Override
+  public int getId() {
+    JobIdProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getId());
+  }
+
+  @Override
+  public void setId(int id) {
+    maybeInitBuilder();
+    builder.setId((id));
+  }
+
+  private ApplicationIdPBImpl convertFromProtoFormat(ApplicationIdProto p) {
+    return new ApplicationIdPBImpl(p);
+  }
+
+  private ApplicationIdProto convertToProtoFormat(ApplicationId t) {
+    return ((ApplicationIdPBImpl)t).getProto();
+  }
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/JobReportPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/JobReportPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/JobReportPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/JobReportPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,185 @@
+package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
+
+
+import org.apache.hadoop.mapreduce.v2.api.records.JobId;
+import org.apache.hadoop.mapreduce.v2.api.records.JobReport;
+import org.apache.hadoop.mapreduce.v2.api.records.JobState;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.JobIdProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.JobReportProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.JobReportProtoOrBuilder;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.JobStateProto;
+import org.apache.hadoop.mapreduce.v2.util.MRProtoUtils;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class JobReportPBImpl extends ProtoBase<JobReportProto> implements JobReport {
+  JobReportProto proto = JobReportProto.getDefaultInstance();
+  JobReportProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private JobId jobId = null;
+  
+  
+  public JobReportPBImpl() {
+    builder = JobReportProto.newBuilder();
+  }
+
+  public JobReportPBImpl(JobReportProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public JobReportProto getProto() {
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.jobId != null) {
+      builder.setJobId(convertToProtoFormat(this.jobId));
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = JobReportProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public JobId getJobId() {
+    JobReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.jobId != null) {
+      return this.jobId;
+    }
+    if (!p.hasJobId()) {
+      return null;
+    }
+    this.jobId = convertFromProtoFormat(p.getJobId());
+    return this.jobId;
+  }
+
+  @Override
+  public void setJobId(JobId jobId) {
+    maybeInitBuilder();
+    if (jobId == null) 
+      builder.clearJobId();
+    this.jobId = jobId;
+  }
+  @Override
+  public JobState getJobState() {
+    JobReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasJobState()) {
+      return null;
+    }
+    return convertFromProtoFormat(p.getJobState());
+  }
+
+  @Override
+  public void setJobState(JobState jobState) {
+    maybeInitBuilder();
+    if (jobState == null) {
+      builder.clearJobState();
+      return;
+    }
+    builder.setJobState(convertToProtoFormat(jobState));
+  }
+  @Override
+  public float getMapProgress() {
+    JobReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getMapProgress());
+  }
+
+  @Override
+  public void setMapProgress(float mapProgress) {
+    maybeInitBuilder();
+    builder.setMapProgress((mapProgress));
+  }
+  @Override
+  public float getReduceProgress() {
+    JobReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getReduceProgress());
+  }
+
+  @Override
+  public void setReduceProgress(float reduceProgress) {
+    maybeInitBuilder();
+    builder.setReduceProgress((reduceProgress));
+  }
+  @Override
+  public float getCleanupProgress() {
+    JobReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getCleanupProgress());
+  }
+
+  @Override
+  public void setCleanupProgress(float cleanupProgress) {
+    maybeInitBuilder();
+    builder.setCleanupProgress((cleanupProgress));
+  }
+  @Override
+  public float getSetupProgress() {
+    JobReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getSetupProgress());
+  }
+
+  @Override
+  public void setSetupProgress(float setupProgress) {
+    maybeInitBuilder();
+    builder.setSetupProgress((setupProgress));
+  }
+  @Override
+  public long getStartTime() {
+    JobReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getStartTime());
+  }
+
+  @Override
+  public void setStartTime(long startTime) {
+    maybeInitBuilder();
+    builder.setStartTime((startTime));
+  }
+  @Override
+  public long getFinishTime() {
+    JobReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getFinishTime());
+  }
+
+  @Override
+  public void setFinishTime(long finishTime) {
+    maybeInitBuilder();
+    builder.setFinishTime((finishTime));
+  }
+
+  private JobIdPBImpl convertFromProtoFormat(JobIdProto p) {
+    return new JobIdPBImpl(p);
+  }
+
+  private JobIdProto convertToProtoFormat(JobId t) {
+    return ((JobIdPBImpl)t).getProto();
+  }
+
+  private JobStateProto convertToProtoFormat(JobState e) {
+    return MRProtoUtils.convertToProtoFormat(e);
+  }
+
+  private JobState convertFromProtoFormat(JobStateProto e) {
+    return MRProtoUtils.convertFromProtoFormat(e);
+  }
+
+
+
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptCompletionEventPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptCompletionEventPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptCompletionEventPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptCompletionEventPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,159 @@
+package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
+
+
+import org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptCompletionEvent;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptCompletionEventStatus;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptCompletionEventProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptCompletionEventProtoOrBuilder;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptCompletionEventStatusProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptIdProto;
+import org.apache.hadoop.mapreduce.v2.util.MRProtoUtils;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class TaskAttemptCompletionEventPBImpl extends ProtoBase<TaskAttemptCompletionEventProto> implements TaskAttemptCompletionEvent {
+  TaskAttemptCompletionEventProto proto = TaskAttemptCompletionEventProto.getDefaultInstance();
+  TaskAttemptCompletionEventProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private TaskAttemptId taskAttemptId = null;
+  
+  
+  public TaskAttemptCompletionEventPBImpl() {
+    builder = TaskAttemptCompletionEventProto.newBuilder();
+  }
+
+  public TaskAttemptCompletionEventPBImpl(TaskAttemptCompletionEventProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public TaskAttemptCompletionEventProto getProto() {
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.taskAttemptId != null) {
+      builder.setAttemptId(convertToProtoFormat(this.taskAttemptId));
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = TaskAttemptCompletionEventProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public TaskAttemptId getAttemptId() {
+    TaskAttemptCompletionEventProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.taskAttemptId != null) {
+      return this.taskAttemptId;
+    }
+    if (!p.hasAttemptId()) {
+      return null;
+    }
+    this.taskAttemptId = convertFromProtoFormat(p.getAttemptId());
+    return this.taskAttemptId;
+  }
+
+  @Override
+  public void setAttemptId(TaskAttemptId attemptId) {
+    maybeInitBuilder();
+    if (attemptId == null) 
+      builder.clearAttemptId();
+    this.taskAttemptId = attemptId;
+  }
+  @Override
+  public TaskAttemptCompletionEventStatus getStatus() {
+    TaskAttemptCompletionEventProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasStatus()) {
+      return null;
+    }
+    return convertFromProtoFormat(p.getStatus());
+  }
+
+  @Override
+  public void setStatus(TaskAttemptCompletionEventStatus status) {
+    maybeInitBuilder();
+    if (status == null) {
+      builder.clearStatus();
+      return;
+    }
+    builder.setStatus(convertToProtoFormat(status));
+  }
+  @Override
+  public String getMapOutputServerAddress() {
+    TaskAttemptCompletionEventProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasMapOutputServerAddress()) {
+      return null;
+    }
+    return (p.getMapOutputServerAddress());
+  }
+
+  @Override
+  public void setMapOutputServerAddress(String mapOutputServerAddress) {
+    maybeInitBuilder();
+    if (mapOutputServerAddress == null) {
+      builder.clearMapOutputServerAddress();
+      return;
+    }
+    builder.setMapOutputServerAddress((mapOutputServerAddress));
+  }
+  @Override
+  public int getAttemptRunTime() {
+    TaskAttemptCompletionEventProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getAttemptRunTime());
+  }
+
+  @Override
+  public void setAttemptRunTime(int attemptRunTime) {
+    maybeInitBuilder();
+    builder.setAttemptRunTime((attemptRunTime));
+  }
+  @Override
+  public int getEventId() {
+    TaskAttemptCompletionEventProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getEventId());
+  }
+
+  @Override
+  public void setEventId(int eventId) {
+    maybeInitBuilder();
+    builder.setEventId((eventId));
+  }
+
+  private TaskAttemptIdPBImpl convertFromProtoFormat(TaskAttemptIdProto p) {
+    return new TaskAttemptIdPBImpl(p);
+  }
+
+  private TaskAttemptIdProto convertToProtoFormat(TaskAttemptId t) {
+    return ((TaskAttemptIdPBImpl)t).getProto();
+  }
+
+  private TaskAttemptCompletionEventStatusProto convertToProtoFormat(TaskAttemptCompletionEventStatus e) {
+    return MRProtoUtils.convertToProtoFormat(e);
+  }
+
+  private TaskAttemptCompletionEventStatus convertFromProtoFormat(TaskAttemptCompletionEventStatusProto e) {
+    return MRProtoUtils.convertFromProtoFormat(e);
+  }
+
+
+
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptIdPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptIdPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptIdPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptIdPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,98 @@
+package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
+
+
+import org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptIdProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptIdProtoOrBuilder;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskIdProto;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class TaskAttemptIdPBImpl extends ProtoBase<TaskAttemptIdProto> implements TaskAttemptId {
+  TaskAttemptIdProto proto = TaskAttemptIdProto.getDefaultInstance();
+  TaskAttemptIdProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private TaskId taskId = null;
+  
+  
+  public TaskAttemptIdPBImpl() {
+    builder = TaskAttemptIdProto.newBuilder();
+  }
+
+  public TaskAttemptIdPBImpl(TaskAttemptIdProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public TaskAttemptIdProto getProto() {
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.taskId != null && !((TaskIdPBImpl)this.taskId).getProto().equals(builder.getTaskId())) {
+      builder.setTaskId(convertToProtoFormat(this.taskId));
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = TaskAttemptIdProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public int getId() {
+    TaskAttemptIdProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getId());
+  }
+
+  @Override
+  public void setId(int id) {
+    maybeInitBuilder();
+    builder.setId((id));
+  }
+  @Override
+  public TaskId getTaskId() {
+    TaskAttemptIdProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.taskId != null) {
+      return this.taskId;
+    }
+    if (!p.hasTaskId()) {
+      return null;
+    }
+    taskId = convertFromProtoFormat(p.getTaskId());
+    return taskId;
+  }
+
+  @Override
+  public void setTaskId(TaskId taskId) {
+    maybeInitBuilder();
+    if (taskId == null)
+      builder.clearTaskId();
+    this.taskId = taskId;
+  }
+
+  private TaskIdPBImpl convertFromProtoFormat(TaskIdProto p) {
+    return new TaskIdPBImpl(p);
+  }
+
+  private TaskIdProto convertToProtoFormat(TaskId t) {
+    return ((TaskIdPBImpl)t).getProto();
+  }
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptReportPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptReportPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptReportPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskAttemptReportPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,250 @@
+package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
+
+
+import org.apache.hadoop.mapreduce.v2.api.records.Counters;
+import org.apache.hadoop.mapreduce.v2.api.records.Phase;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptReport;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptState;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.CountersProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.PhaseProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptIdProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptReportProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptReportProtoOrBuilder;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptStateProto;
+import org.apache.hadoop.mapreduce.v2.util.MRProtoUtils;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class TaskAttemptReportPBImpl extends ProtoBase<TaskAttemptReportProto> implements TaskAttemptReport {
+  TaskAttemptReportProto proto = TaskAttemptReportProto.getDefaultInstance();
+  TaskAttemptReportProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private TaskAttemptId taskAttemptId = null;
+  private Counters counters = null;
+  
+  
+  public TaskAttemptReportPBImpl() {
+    builder = TaskAttemptReportProto.newBuilder();
+  }
+
+  public TaskAttemptReportPBImpl(TaskAttemptReportProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public TaskAttemptReportProto getProto() {
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.taskAttemptId != null) {
+      builder.setTaskAttemptId(convertToProtoFormat(this.taskAttemptId));
+    }
+    if (this.counters != null) {
+      builder.setCounters(convertToProtoFormat(this.counters));
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = TaskAttemptReportProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public Counters getCounters() {
+    TaskAttemptReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.counters != null) {
+      return this.counters;
+    }
+    if (!p.hasCounters()) {
+      return null;
+    }
+    this.counters = convertFromProtoFormat(p.getCounters());
+    return this.counters;
+  }
+
+  @Override
+  public void setCounters(Counters counters) {
+    maybeInitBuilder();
+    if (counters == null) 
+      builder.clearCounters();
+    this.counters = counters;
+  }
+  @Override
+  public long getStartTime() {
+    TaskAttemptReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getStartTime());
+  }
+
+  @Override
+  public void setStartTime(long startTime) {
+    maybeInitBuilder();
+    builder.setStartTime((startTime));
+  }
+  @Override
+  public long getFinishTime() {
+    TaskAttemptReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getFinishTime());
+  }
+
+  @Override
+  public void setFinishTime(long finishTime) {
+    maybeInitBuilder();
+    builder.setFinishTime((finishTime));
+  }
+  @Override
+  public TaskAttemptId getTaskAttemptId() {
+    TaskAttemptReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.taskAttemptId != null) {
+      return this.taskAttemptId;
+    }
+    if (!p.hasTaskAttemptId()) {
+      return null;
+    }
+    this.taskAttemptId = convertFromProtoFormat(p.getTaskAttemptId());
+    return this.taskAttemptId;
+  }
+
+  @Override
+  public void setTaskAttemptId(TaskAttemptId taskAttemptId) {
+    maybeInitBuilder();
+    if (taskAttemptId == null) 
+      builder.clearTaskAttemptId();
+    this.taskAttemptId = taskAttemptId;
+  }
+  @Override
+  public TaskAttemptState getTaskAttemptState() {
+    TaskAttemptReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasTaskAttemptState()) {
+      return null;
+    }
+    return convertFromProtoFormat(p.getTaskAttemptState());
+  }
+
+  @Override
+  public void setTaskAttemptState(TaskAttemptState taskAttemptState) {
+    maybeInitBuilder();
+    if (taskAttemptState == null) {
+      builder.clearTaskAttemptState();
+      return;
+    }
+    builder.setTaskAttemptState(convertToProtoFormat(taskAttemptState));
+  }
+  @Override
+  public float getProgress() {
+    TaskAttemptReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getProgress());
+  }
+
+  @Override
+  public void setProgress(float progress) {
+    maybeInitBuilder();
+    builder.setProgress((progress));
+  }
+  @Override
+  public String getDiagnosticInfo() {
+    TaskAttemptReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasDiagnosticInfo()) {
+      return null;
+    }
+    return (p.getDiagnosticInfo());
+  }
+
+  @Override
+  public void setDiagnosticInfo(String diagnosticInfo) {
+    maybeInitBuilder();
+    if (diagnosticInfo == null) {
+      builder.clearDiagnosticInfo();
+      return;
+    }
+    builder.setDiagnosticInfo((diagnosticInfo));
+  }
+  @Override
+  public String getStateString() {
+    TaskAttemptReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasStateString()) {
+      return null;
+    }
+    return (p.getStateString());
+  }
+
+  @Override
+  public void setStateString(String stateString) {
+    maybeInitBuilder();
+    if (stateString == null) {
+      builder.clearStateString();
+      return;
+    }
+    builder.setStateString((stateString));
+  }
+  @Override
+  public Phase getPhase() {
+    TaskAttemptReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasPhase()) {
+      return null;
+    }
+    return convertFromProtoFormat(p.getPhase());
+  }
+
+  @Override
+  public void setPhase(Phase phase) {
+    maybeInitBuilder();
+    if (phase == null) {
+      builder.clearPhase();
+      return;
+    }
+    builder.setPhase(convertToProtoFormat(phase));
+  }
+
+  private CountersPBImpl convertFromProtoFormat(CountersProto p) {
+    return new CountersPBImpl(p);
+  }
+
+  private CountersProto convertToProtoFormat(Counters t) {
+    return ((CountersPBImpl)t).getProto();
+  }
+
+  private TaskAttemptIdPBImpl convertFromProtoFormat(TaskAttemptIdProto p) {
+    return new TaskAttemptIdPBImpl(p);
+  }
+
+  private TaskAttemptIdProto convertToProtoFormat(TaskAttemptId t) {
+    return ((TaskAttemptIdPBImpl)t).getProto();
+  }
+
+  private TaskAttemptStateProto convertToProtoFormat(TaskAttemptState e) {
+    return MRProtoUtils.convertToProtoFormat(e);
+  }
+
+  private TaskAttemptState convertFromProtoFormat(TaskAttemptStateProto e) {
+    return MRProtoUtils.convertFromProtoFormat(e);
+  }
+
+  private PhaseProto convertToProtoFormat(Phase e) {
+    return MRProtoUtils.convertToProtoFormat(e);
+  }
+
+  private Phase convertFromProtoFormat(PhaseProto e) {
+    return MRProtoUtils.convertFromProtoFormat(e);
+  }
+
+
+
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskIdPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskIdPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskIdPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskIdPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,128 @@
+package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
+
+
+import org.apache.hadoop.mapreduce.v2.api.records.JobId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskType;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.JobIdProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskIdProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskIdProtoOrBuilder;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskTypeProto;
+import org.apache.hadoop.mapreduce.v2.util.MRProtoUtils;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class TaskIdPBImpl extends ProtoBase<TaskIdProto> implements TaskId {
+  TaskIdProto proto = TaskIdProto.getDefaultInstance();
+  TaskIdProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private JobId jobId = null;
+  
+  
+  public TaskIdPBImpl() {
+    builder = TaskIdProto.newBuilder(proto);
+  }
+
+  public TaskIdPBImpl(TaskIdProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public TaskIdProto getProto() {
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.jobId != null && !((JobIdPBImpl)this.jobId).getProto().equals(builder.getJobId()) ) {
+      builder.setJobId(convertToProtoFormat(this.jobId));
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = TaskIdProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public int getId() {
+    TaskIdProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getId());
+  }
+
+  @Override
+  public void setId(int id) {
+    maybeInitBuilder();
+    builder.setId((id));
+  }
+  @Override
+  public JobId getJobId() {
+    TaskIdProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.jobId != null) {
+      return this.jobId;
+    }
+    if (!p.hasJobId()) {
+      return null;
+    }
+    jobId = convertFromProtoFormat(p.getJobId());
+    return jobId;
+  }
+
+  @Override
+  public void setJobId(JobId jobId) {
+    maybeInitBuilder();
+    if (jobId == null)
+      builder.clearJobId();
+    this.jobId = jobId;
+  }
+  @Override
+  public TaskType getTaskType() {
+    TaskIdProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasTaskType()) {
+      return null;
+    }
+    return convertFromProtoFormat(p.getTaskType());
+  }
+
+  @Override
+  public void setTaskType(TaskType taskType) {
+    maybeInitBuilder();
+    if (taskType == null) {
+      builder.clearTaskType();
+      return;
+    }
+    builder.setTaskType(convertToProtoFormat(taskType));
+  }
+
+  private JobIdPBImpl convertFromProtoFormat(JobIdProto p) {
+    return new JobIdPBImpl(p);
+  }
+
+  private JobIdProto convertToProtoFormat(JobId t) {
+    return ((JobIdPBImpl)t).getProto();
+  }
+
+  private TaskTypeProto convertToProtoFormat(TaskType e) {
+    return MRProtoUtils.convertToProtoFormat(e);
+  }
+
+  private TaskType convertFromProtoFormat(TaskTypeProto e) {
+    return MRProtoUtils.convertFromProtoFormat(e);
+  }
+
+}  

Added: hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskReportPBImpl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskReportPBImpl.java?rev=1087462&view=auto
==============================================================================
--- hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskReportPBImpl.java (added)
+++ hadoop/mapreduce/branches/MR-279/mr-client/hadoop-mapreduce-client-common/src/main/java/org/apache/hadoop/mapreduce/v2/api/records/impl/pb/TaskReportPBImpl.java Thu Mar 31 22:23:22 2011
@@ -0,0 +1,376 @@
+package org.apache.hadoop.mapreduce.v2.api.records.impl.pb;
+
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.hadoop.mapreduce.v2.api.records.Counters;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskAttemptId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskId;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskReport;
+import org.apache.hadoop.mapreduce.v2.api.records.TaskState;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.CountersProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskAttemptIdProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskIdProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskReportProto;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskReportProtoOrBuilder;
+import org.apache.hadoop.mapreduce.v2.proto.MRProtos.TaskStateProto;
+import org.apache.hadoop.mapreduce.v2.util.MRProtoUtils;
+import org.apache.hadoop.yarn.api.records.ProtoBase;
+
+
+    
+public class TaskReportPBImpl extends ProtoBase<TaskReportProto> implements TaskReport {
+  TaskReportProto proto = TaskReportProto.getDefaultInstance();
+  TaskReportProto.Builder builder = null;
+  boolean viaProto = false;
+  
+  private TaskId taskId = null;
+  private Counters counters = null;
+  private List<TaskAttemptId> runningAttempts = null;
+  private TaskAttemptId successfulAttemptId = null;
+  private List<String> diagnostics = null;
+  
+  
+  public TaskReportPBImpl() {
+    builder = TaskReportProto.newBuilder();
+  }
+
+  public TaskReportPBImpl(TaskReportProto proto) {
+    this.proto = proto;
+    viaProto = true;
+  }
+  
+  public TaskReportProto getProto() {
+      mergeLocalToProto();
+    proto = viaProto ? proto : builder.build();
+    viaProto = true;
+    return proto;
+  }
+
+  private void mergeLocalToBuilder() {
+    if (this.taskId != null) {
+      builder.setTaskId(convertToProtoFormat(this.taskId));
+    }
+    if (this.counters != null) {
+      builder.setCounters(convertToProtoFormat(this.counters));
+    }
+    if (this.runningAttempts != null) {
+      addRunningAttemptsToProto();
+    }
+    if (this.successfulAttemptId != null) {
+      builder.setSuccessfulAttempt(convertToProtoFormat(this.successfulAttemptId));
+    }
+    if (this.diagnostics != null) {
+      addDiagnosticsToProto();
+    }
+  }
+
+  private void mergeLocalToProto() {
+    if (viaProto) 
+      maybeInitBuilder();
+    mergeLocalToBuilder();
+    proto = builder.build();
+    viaProto = true;
+  }
+
+  private void maybeInitBuilder() {
+    if (viaProto || builder == null) {
+      builder = TaskReportProto.newBuilder(proto);
+    }
+    viaProto = false;
+  }
+    
+  
+  @Override
+  public Counters getCounters() {
+    TaskReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.counters != null) {
+      return this.counters;
+    }
+    if (!p.hasCounters()) {
+      return null;
+    }
+    this.counters = convertFromProtoFormat(p.getCounters());
+    return this.counters;
+  }
+
+  @Override
+  public void setCounters(Counters counters) {
+    maybeInitBuilder();
+    if (counters == null) 
+      builder.clearCounters();
+    this.counters = counters;
+  }
+  @Override
+  public long getStartTime() {
+    TaskReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getStartTime());
+  }
+
+  @Override
+  public void setStartTime(long startTime) {
+    maybeInitBuilder();
+    builder.setStartTime((startTime));
+  }
+  @Override
+  public long getFinishTime() {
+    TaskReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getFinishTime());
+  }
+
+  @Override
+  public void setFinishTime(long finishTime) {
+    maybeInitBuilder();
+    builder.setFinishTime((finishTime));
+  }
+  @Override
+  public TaskId getTaskId() {
+    TaskReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.taskId != null) {
+      return this.taskId;
+    }
+    if (!p.hasTaskId()) {
+      return null;
+    }
+    this.taskId = convertFromProtoFormat(p.getTaskId());
+    return this.taskId;
+  }
+
+  @Override
+  public void setTaskId(TaskId taskId) {
+    maybeInitBuilder();
+    if (taskId == null) 
+      builder.clearTaskId();
+    this.taskId = taskId;
+  }
+  @Override
+  public float getProgress() {
+    TaskReportProtoOrBuilder p = viaProto ? proto : builder;
+    return (p.getProgress());
+  }
+
+  @Override
+  public void setProgress(float progress) {
+    maybeInitBuilder();
+    builder.setProgress((progress));
+  }
+  @Override
+  public TaskState getTaskState() {
+    TaskReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (!p.hasTaskState()) {
+      return null;
+    }
+    return convertFromProtoFormat(p.getTaskState());
+  }
+
+  @Override
+  public void setTaskState(TaskState taskState) {
+    maybeInitBuilder();
+    if (taskState == null) {
+      builder.clearTaskState();
+      return;
+    }
+    builder.setTaskState(convertToProtoFormat(taskState));
+  }
+  @Override
+  public List<TaskAttemptId> getRunningAttemptsList() {
+    initRunningAttempts();
+    return this.runningAttempts;
+  }
+  @Override
+  public TaskAttemptId getRunningAttempt(int index) {
+    initRunningAttempts();
+    return this.runningAttempts.get(index);
+  }
+  @Override
+  public int getRunningAttemptsCount() {
+    initRunningAttempts();
+    return this.runningAttempts.size();
+  }
+  
+  private void initRunningAttempts() {
+    if (this.runningAttempts != null) {
+      return;
+    }
+    TaskReportProtoOrBuilder p = viaProto ? proto : builder;
+    List<TaskAttemptIdProto> list = p.getRunningAttemptsList();
+    this.runningAttempts = new ArrayList<TaskAttemptId>();
+
+    for (TaskAttemptIdProto c : list) {
+      this.runningAttempts.add(convertFromProtoFormat(c));
+    }
+  }
+  
+  @Override
+  public void addAllRunningAttempts(final List<TaskAttemptId> runningAttempts) {
+    if (runningAttempts == null)
+      return;
+    initRunningAttempts();
+    this.runningAttempts.addAll(runningAttempts);
+  }
+  
+  private void addRunningAttemptsToProto() {
+    maybeInitBuilder();
+    builder.clearRunningAttempts();
+    if (runningAttempts == null)
+      return;
+    Iterable<TaskAttemptIdProto> iterable = new Iterable<TaskAttemptIdProto>() {
+      @Override
+      public Iterator<TaskAttemptIdProto> iterator() {
+        return new Iterator<TaskAttemptIdProto>() {
+
+          Iterator<TaskAttemptId> iter = runningAttempts.iterator();
+
+          @Override
+          public boolean hasNext() {
+            return iter.hasNext();
+          }
+
+          @Override
+          public TaskAttemptIdProto next() {
+            return convertToProtoFormat(iter.next());
+          }
+
+          @Override
+          public void remove() {
+            throw new UnsupportedOperationException();
+
+          }
+        };
+
+      }
+    };
+    builder.addAllRunningAttempts(iterable);
+  }
+  @Override
+  public void addRunningAttempt(TaskAttemptId runningAttempts) {
+    initRunningAttempts();
+    this.runningAttempts.add(runningAttempts);
+  }
+  @Override
+  public void removeRunningAttempt(int index) {
+    initRunningAttempts();
+    this.runningAttempts.remove(index);
+  }
+  @Override
+  public void clearRunningAttempts() {
+    initRunningAttempts();
+    this.runningAttempts.clear();
+  }
+  @Override
+  public TaskAttemptId getSuccessfulAttempt() {
+    TaskReportProtoOrBuilder p = viaProto ? proto : builder;
+    if (this.successfulAttemptId != null) {
+      return this.successfulAttemptId;
+    }
+    if (!p.hasSuccessfulAttempt()) {
+      return null;
+    }
+    this.successfulAttemptId = convertFromProtoFormat(p.getSuccessfulAttempt());
+    return this.successfulAttemptId;
+  }
+
+  @Override
+  public void setSuccessfulAttempt(TaskAttemptId successfulAttempt) {
+    maybeInitBuilder();
+    if (successfulAttempt == null) 
+      builder.clearSuccessfulAttempt();
+    this.successfulAttemptId = successfulAttempt;
+  }
+  @Override
+  public List<String> getDiagnosticsList() {
+    initDiagnostics();
+    return this.diagnostics;
+  }
+  @Override
+  public String getDiagnostics(int index) {
+    initDiagnostics();
+    return this.diagnostics.get(index);
+  }
+  @Override
+  public int getDiagnosticsCount() {
+    initDiagnostics();
+    return this.diagnostics.size();
+  }
+  
+  private void initDiagnostics() {
+    if (this.diagnostics != null) {
+      return;
+    }
+    TaskReportProtoOrBuilder p = viaProto ? proto : builder;
+    List<String> list = p.getDiagnosticsList();
+    this.diagnostics = new ArrayList<String>();
+
+    for (String c : list) {
+      this.diagnostics.add(c);
+    }
+  }
+  
+  @Override
+  public void addAllDiagnostics(final List<String> diagnostics) {
+    if (diagnostics == null)
+      return;
+    initDiagnostics();
+    this.diagnostics.addAll(diagnostics);
+  }
+  
+  private void addDiagnosticsToProto() {
+    maybeInitBuilder();
+    builder.clearDiagnostics();
+    if (diagnostics == null) 
+      return;
+    builder.addAllDiagnostics(diagnostics);
+  }
+  @Override
+  public void addDiagnostics(String diagnostics) {
+    initDiagnostics();
+    this.diagnostics.add(diagnostics);
+  }
+  @Override
+  public void removeDiagnostics(int index) {
+    initDiagnostics();
+    this.diagnostics.remove(index);
+  }
+  @Override
+  public void clearDiagnostics() {
+    initDiagnostics();
+    this.diagnostics.clear();
+  }
+
+  private CountersPBImpl convertFromProtoFormat(CountersProto p) {
+    return new CountersPBImpl(p);
+  }
+
+  private CountersProto convertToProtoFormat(Counters t) {
+    return ((CountersPBImpl)t).getProto();
+  }
+
+  private TaskIdPBImpl convertFromProtoFormat(TaskIdProto p) {
+    return new TaskIdPBImpl(p);
+  }
+
+  private TaskIdProto convertToProtoFormat(TaskId t) {
+    return ((TaskIdPBImpl)t).getProto();
+  }
+
+  private TaskStateProto convertToProtoFormat(TaskState e) {
+    return MRProtoUtils.convertToProtoFormat(e);
+  }
+
+  private TaskState convertFromProtoFormat(TaskStateProto e) {
+    return MRProtoUtils.convertFromProtoFormat(e);
+  }
+
+  private TaskAttemptIdPBImpl convertFromProtoFormat(TaskAttemptIdProto p) {
+    return new TaskAttemptIdPBImpl(p);
+  }
+
+  private TaskAttemptIdProto convertToProtoFormat(TaskAttemptId t) {
+    return ((TaskAttemptIdPBImpl)t).getProto();
+  }
+
+
+
+}  



Mime
View raw message