TEZ-179. Update JobContextImpl to use the changed return type for certain methods post MAPREDUCE-5300. (sseth)
Project: http://git-wip-us.apache.org/repos/asf/incubator-tez/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tez/commit/a10e607a Tree: http://git-wip-us.apache.org/repos/asf/incubator-tez/tree/a10e607a Diff: http://git-wip-us.apache.org/repos/asf/incubator-tez/diff/a10e607a Branch: refs/heads/master Commit: a10e607ac5f3eeae71df8dc32c08b95c3a2ebd82 Parents: 114b12a Author: Siddharth Seth <[email protected]> Authored: Mon Jun 3 22:06:03 2013 -0700 Committer: Siddharth Seth <[email protected]> Committed: Mon Jun 3 22:06:03 2013 -0700 ---------------------------------------------------------------------- .../mapreduce/hadoop/mapreduce/JobContextImpl.java | 24 +++++++++++++-- 1 files changed, 21 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/a10e607a/tez-mapreduce/src/main/java/org/apache/tez/mapreduce/hadoop/mapreduce/JobContextImpl.java ---------------------------------------------------------------------- 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 class JobContextImpl implements JobContext { 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 @@ public class JobContextImpl implements JobContext { * @throws IOException */ public String[] getArchiveTimestamps() { - return DistributedCache.getArchiveTimestamps(conf); + return toTimestampStrs(DistributedCache.getArchiveTimestamps(conf)); } /** @@ -370,7 +388,7 @@ public class JobContextImpl implements JobContext { * @throws IOException */ public String[] getFileTimestamps() { - return DistributedCache.getFileTimestamps(conf); + return toTimestampStrs(DistributedCache.getFileTimestamps(conf)); } /**
