ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [48/55] [abbrv] ambari git commit: AMBARI-20635. Implement XML processing best practices in Hive View. (dipayanb)
Date Fri, 31 Mar 2017 07:22:55 GMT
AMBARI-20635. Implement XML processing best practices in Hive View. (dipayanb)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/f6917a9b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f6917a9b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f6917a9b

Branch: refs/heads/branch-3.0-perf
Commit: f6917a9b8e4946b71b8d4964d56df640e1283bea
Parents: 192a30f
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Thu Mar 30 22:02:31 2017 +0530
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Mar 31 10:21:45 2017 +0300

----------------------------------------------------------------------
 .../ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java | 2 ++
 .../view/hive20/resources/uploads/parsers/xml/XMLParser.java       | 2 ++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f6917a9b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java
b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java
index 95e996c..e2be5db 100644
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/xml/XMLParser.java
@@ -63,6 +63,8 @@ public class XMLParser extends Parser {
     super(reader, parseOptions);
     XMLInputFactory factory = XMLInputFactory.newInstance();
     try {
+      factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
+      factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
       this.xmlReader = factory.createXMLEventReader(reader);
     } catch (XMLStreamException e) {
       LOG.error("error occurred while creating xml reader : ", e);

http://git-wip-us.apache.org/repos/asf/ambari/blob/f6917a9b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java
b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java
index abcf2c0..05ef34f 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/xml/XMLParser.java
@@ -63,6 +63,8 @@ public class XMLParser extends Parser {
     super(reader, parseOptions);
     XMLInputFactory factory = XMLInputFactory.newInstance();
     try {
+      factory.setProperty(XMLInputFactory.SUPPORT_DTD, false);
+      factory.setProperty(XMLInputFactory.IS_SUPPORTING_EXTERNAL_ENTITIES, false);
       this.xmlReader = factory.createXMLEventReader(reader);
     } catch (XMLStreamException e) {
       LOG.error("error occurred while creating xml reader : ", e);


Mime
View raw message