diff --git a/hadoop-project/pom.xml b/hadoop-project/pom.xml index dcbc484d43..c09392793a 100644 --- a/hadoop-project/pom.xml +++ b/hadoop-project/pom.xml @@ -69,7 +69,7 @@ 1.9.13 - 2.7.8 + 2.9.4 1.7.25 diff --git a/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/state/StatePool.java b/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/state/StatePool.java index 41eb90d3d4..ab6f8942e7 100644 --- a/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/state/StatePool.java +++ b/hadoop-tools/hadoop-rumen/src/main/java/org/apache/hadoop/tools/rumen/state/StatePool.java @@ -18,11 +18,11 @@ package org.apache.hadoop.tools.rumen.state; import java.io.DataInput; -import java.io.DataInputStream; import java.io.DataOutput; -import java.io.DataOutputStream; import java.io.FileNotFoundException; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; @@ -216,7 +216,7 @@ private void read(DataInput in) throws IOException { // register the module with the object-mapper mapper.registerModule(module); - JsonParser parser = mapper.getFactory().createParser((DataInputStream)in); + JsonParser parser = mapper.getFactory().createParser((InputStream)in); StatePool statePool = mapper.readValue(parser, StatePool.class); this.setStates(statePool.getStates()); parser.close(); @@ -285,7 +285,7 @@ private void write(DataOutput out) throws IOException { JsonFactory outFactory = outMapper.getFactory(); JsonGenerator jGen = - outFactory.createGenerator((DataOutputStream)out, JsonEncoding.UTF8); + outFactory.createGenerator((OutputStream)out, JsonEncoding.UTF8); jGen.useDefaultPrettyPrinter(); jGen.writeObject(this); diff --git a/hadoop-tools/hadoop-rumen/src/test/java/org/apache/hadoop/tools/rumen/TestHistograms.java b/hadoop-tools/hadoop-rumen/src/test/java/org/apache/hadoop/tools/rumen/TestHistograms.java index 52caaf5575..187251900b 100644 --- a/hadoop-tools/hadoop-rumen/src/test/java/org/apache/hadoop/tools/rumen/TestHistograms.java +++ b/hadoop-tools/hadoop-rumen/src/test/java/org/apache/hadoop/tools/rumen/TestHistograms.java @@ -19,6 +19,7 @@ package org.apache.hadoop.tools.rumen; import java.io.IOException; +import java.io.OutputStream; import java.util.List; import com.fasterxml.jackson.core.JsonEncoding; @@ -142,7 +143,7 @@ public static void main(String[] args) throws IOException { ObjectMapper mapper = new ObjectMapper(); JsonFactory factory = mapper.getFactory(); FSDataOutputStream ostream = lfs.create(goldFilePath, true); - JsonGenerator gen = factory.createGenerator(ostream, + JsonGenerator gen = factory.createGenerator((OutputStream)ostream, JsonEncoding.UTF8); gen.useDefaultPrettyPrinter(); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/FileSystemTimelineWriter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/FileSystemTimelineWriter.java index b7bb48ebda..c00a0b8bd1 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/FileSystemTimelineWriter.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/client/api/impl/FileSystemTimelineWriter.java @@ -21,6 +21,7 @@ import java.io.Closeable; import java.io.Flushable; import java.io.IOException; +import java.io.OutputStream; import java.net.URI; import java.util.ArrayList; import java.util.HashMap; @@ -374,7 +375,8 @@ public long getLastModifiedTime() { protected void prepareForWrite() throws IOException{ this.stream = createLogFileStream(fs, logPath); - this.jsonGenerator = new JsonFactory().createGenerator(stream); + this.jsonGenerator = new JsonFactory().createGenerator( + (OutputStream)stream); this.jsonGenerator.setPrettyPrinter(new MinimalPrettyPrinter("\n")); this.lastModifiedTime = Time.monotonicNow(); } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/LogInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/LogInfo.java index 57dbdcbe69..fa3c85338e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/LogInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/main/java/org/apache/hadoop/yarn/server/timeline/LogInfo.java @@ -40,6 +40,7 @@ import org.slf4j.LoggerFactory; import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; abstract class LogInfo { @@ -140,7 +141,7 @@ private long parsePath(TimelineDataManager tdm, Path logPath, try { in.seek(offset); try { - parser = jsonFactory.createParser(in); + parser = jsonFactory.createParser((InputStream)in); parser.configure(JsonParser.Feature.AUTO_CLOSE_SOURCE, false); } catch (IOException e) { // if app hasn't completed then there may be errors due to the diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/PluginStoreTestUtils.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/PluginStoreTestUtils.java index 72f5a277f5..4609cb0b91 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/PluginStoreTestUtils.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/PluginStoreTestUtils.java @@ -39,6 +39,7 @@ import org.apache.hadoop.yarn.server.timeline.security.TimelineACLsManager; import java.io.IOException; +import java.io.OutputStream; import java.util.ArrayList; import java.util.Collections; import java.util.EnumSet; @@ -232,7 +233,7 @@ static void writeEntities(TimelineEntities entities, Path logPath, FileSystem fs) throws IOException { FSDataOutputStream outStream = createLogFile(logPath, fs); JsonGenerator jsonGenerator - = new JsonFactory().createGenerator(outStream); + = new JsonFactory().createGenerator((OutputStream)outStream); jsonGenerator.setPrettyPrinter(new MinimalPrettyPrinter("\n")); ObjectMapper objMapper = createObjectMapper(); for (TimelineEntity entity : entities.getEntities()) { diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestLogInfo.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestLogInfo.java index f880faf776..bccf4b8440 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestLogInfo.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-timeline-pluginstorage/src/test/java/org/apache/hadoop/yarn/server/timeline/TestLogInfo.java @@ -39,6 +39,7 @@ import org.junit.Test; import java.io.IOException; +import java.io.OutputStream; import java.nio.charset.Charset; import java.util.EnumSet; @@ -232,7 +233,8 @@ private void writeEntitiesLeaveOpen(TimelineEntities entities, Path logPath) throws IOException { if (outStream == null) { outStream = PluginStoreTestUtils.createLogFile(logPath, fs); - jsonGenerator = new JsonFactory().createGenerator(outStream); + jsonGenerator = new JsonFactory().createGenerator( + (OutputStream)outStream); jsonGenerator.setPrettyPrinter(new MinimalPrettyPrinter("\n")); } for (TimelineEntity entity : entities.getEntities()) { @@ -248,7 +250,7 @@ private void writeDomainLeaveOpen(TimelineDomain domain, Path logPath) } // Write domain uses its own json generator to isolate from entity writers JsonGenerator jsonGeneratorLocal - = new JsonFactory().createGenerator(outStreamDomain); + = new JsonFactory().createGenerator((OutputStream)outStreamDomain); jsonGeneratorLocal.setPrettyPrinter(new MinimalPrettyPrinter("\n")); objMapper.writeValue(jsonGeneratorLocal, domain); outStreamDomain.hflush();