TEZ-179. Update JobContextImpl to use the changed return type for
certain methods post MAPREDUCE-5300. (sseth)
diff --git a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/mapreduce/JobContextImpl.java b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/mapreduce/JobContextImpl.java
index 1f34fdb..4962260 100644
--- a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/mapreduce/JobContextImpl.java
+++ b/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/mapreduce/JobContextImpl.java
@@ -352,7 +352,25 @@
public Path[] getFileClassPaths() {
return DistributedCache.getFileClassPaths(conf);
}
-
+
+ /**
+ * Parse a list of longs into strings.
+ *
+ * @param timestamps
+ * the list of longs to parse
+ * @return a list of string that were parsed. same length as timestamps.
+ */
+ private static String[] toTimestampStrs(long[] timestamps) {
+ if (timestamps == null) {
+ return null;
+ }
+ String[] result = new String[timestamps.length];
+ for (int i = 0; i < timestamps.length; ++i) {
+ result[i] = Long.toString(timestamps[i]);
+ }
+ return result;
+ }
+
/**
* Get the timestamps of the archives. Used by internal
* DistributedCache and MapReduce code.
@@ -360,7 +378,7 @@
* @throws IOException
*/
public String[] getArchiveTimestamps() {
- return DistributedCache.getArchiveTimestamps(conf);
+ return toTimestampStrs(DistributedCache.getArchiveTimestamps(conf));
}
/**
@@ -370,7 +388,7 @@
* @throws IOException
*/
public String[] getFileTimestamps() {
- return DistributedCache.getFileTimestamps(conf);
+ return toTimestampStrs(DistributedCache.getFileTimestamps(conf));
}
/**