[16/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java -- diff --git a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java deleted file mode 100644 index 4edc82c..000 --- a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ambari.view.hive.resources.uploads.parsers.xml; - -import org.apache.ambari.view.hive.client.Row; -import org.apache.ambari.view.hive.resources.uploads.parsers.ParseOptions; -import org.apache.ambari.view.hive.resources.uploads.parsers.Parser; -import org.apache.ambari.view.hive.resources.uploads.parsers.RowIterator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.xml.stream.XMLEventReader; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import java.io.IOException; -import java.io.Reader; -import java.util.Collection; -import java.util.Iterator; - -/** - * assumes XML of following format - * - * - * row1-col1-Data - * row1-col2-Data - * row1-col3-Data - * row1-col4-Data - * - * - * row2-col1-Data - * row2-col2-Data - * row2-col3-Data - * row2-col4-Data - * - * - */ -public class XMLParser extends Parser { - - protected final static Logger LOG = - LoggerFactory.getLogger(XMLParser.class); - - private RowIterator iterator; - private XMLEventReader xmlReader; - private XMLIterator xmlIterator; - - public XMLParser(Reader reader, ParseOptions parseOptions) throws IOException { -super(reader, parseOptions); -XMLInputFactory factory = XMLInputFactory.newInstance(); -try { - this.xmlReader = factory.createXMLEventReader(reader); -} catch (XMLStreamException e) { - LOG.error("error occurred while creating xml reader : ", e); - throw new IOException("error occurred while creating xml reader : ", e); -} -xmlIterator = new XMLIterator(this.xmlReader); -iterator = new RowIterator(xmlIterator); - } - - @Override - public Row extractHeader() { -Collection headers = this.iterator.extractHeaders(); -Object[] objs = new Object[headers.size()]; -Iterator iterator = headers.iterator(); -for (int i = 0; i < headers.size(); i++) { - objs[i] = iterator.next(); -} - -return new Row(objs); - } - - @Override - public void close() throws Exception { -try { - this.xmlReader.close(); -} catch (XMLStreamException e) { - throw new IOException(e); -} - } - - @Override - public Iterator iterator() { -return iterator; - } -} http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java -- diff --git a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java deleted file mode 100644 index 1fe30fd..000 --- a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is
[16/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java -- diff --git a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java deleted file mode 100644 index 4edc82c..000 --- a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ambari.view.hive.resources.uploads.parsers.xml; - -import org.apache.ambari.view.hive.client.Row; -import org.apache.ambari.view.hive.resources.uploads.parsers.ParseOptions; -import org.apache.ambari.view.hive.resources.uploads.parsers.Parser; -import org.apache.ambari.view.hive.resources.uploads.parsers.RowIterator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.xml.stream.XMLEventReader; -import javax.xml.stream.XMLInputFactory; -import javax.xml.stream.XMLStreamException; -import java.io.IOException; -import java.io.Reader; -import java.util.Collection; -import java.util.Iterator; - -/** - * assumes XML of following format - * - * - * row1-col1-Data - * row1-col2-Data - * row1-col3-Data - * row1-col4-Data - * - * - * row2-col1-Data - * row2-col2-Data - * row2-col3-Data - * row2-col4-Data - * - * - */ -public class XMLParser extends Parser { - - protected final static Logger LOG = - LoggerFactory.getLogger(XMLParser.class); - - private RowIterator iterator; - private XMLEventReader xmlReader; - private XMLIterator xmlIterator; - - public XMLParser(Reader reader, ParseOptions parseOptions) throws IOException { -super(reader, parseOptions); -XMLInputFactory factory = XMLInputFactory.newInstance(); -try { - this.xmlReader = factory.createXMLEventReader(reader); -} catch (XMLStreamException e) { - LOG.error("error occurred while creating xml reader : ", e); - throw new IOException("error occurred while creating xml reader : ", e); -} -xmlIterator = new XMLIterator(this.xmlReader); -iterator = new RowIterator(xmlIterator); - } - - @Override - public Row extractHeader() { -Collection headers = this.iterator.extractHeaders(); -Object[] objs = new Object[headers.size()]; -Iterator iterator = headers.iterator(); -for (int i = 0; i < headers.size(); i++) { - objs[i] = iterator.next(); -} - -return new Row(objs); - } - - @Override - public void close() throws Exception { -try { - this.xmlReader.close(); -} catch (XMLStreamException e) { - throw new IOException(e); -} - } - - @Override - public Iterator iterator() { -return iterator; - } -} http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java -- diff --git a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java deleted file mode 100644 index 1fe30fd..000 --- a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is