You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mg...@apache.org on 2018/05/14 11:29:44 UTC
[ambari] branch trunk updated: AMBARI-23821 ADDENDUM Remove hive
and tez views from hive and tez page (mgergely)
This is an automated email from the ASF dual-hosted git repository.
mgergely pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new ef86b0a AMBARI-23821 ADDENDUM Remove hive and tez views from hive and tez page (mgergely)
ef86b0a is described below
commit ef86b0a3a590950bcf5090499a34b911b8677852
Author: Miklos Gergely <mg...@hortonworks.com>
AuthorDate: Mon May 14 13:19:13 2018 +0200
AMBARI-23821 ADDENDUM Remove hive and tez views from hive and tez page (mgergely)
---
contrib/views/hive-next/pom.xml | 389 -------------------
.../resources/uploads/parsers/ParseUtils.java | 213 -----------
contrib/views/hive20/pom.xml | 426 ---------------------
.../resources/uploads/parsers/ParseUtils.java | 213 -----------
contrib/views/tez/pom.xml | 281 --------------
5 files changed, 1522 deletions(-)
diff --git a/contrib/views/hive-next/pom.xml b/contrib/views/hive-next/pom.xml
deleted file mode 100644
index 60ddce3..0000000
--- a/contrib/views/hive-next/pom.xml
+++ /dev/null
@@ -1,389 +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.
--->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>hive-jdbc</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- <name>Hive Jdbc</name>
-
- <parent>
- <groupId>org.apache.ambari.contrib.views</groupId>
- <artifactId>ambari-contrib-views</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>com.jayway.jsonpath</groupId>
- <artifactId>json-path</artifactId>
- <version>2.0.0</version>
- </dependency>
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-multipart</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-json</artifactId>
- </dependency>
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>commons-configuration</groupId>
- <artifactId>commons-configuration</artifactId>
- <version>1.6</version>
- </dependency>
- <dependency>
- <groupId>com.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- <version>3.8</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-collections4</artifactId>
- <version>4.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ambari</groupId>
- <artifactId>ambari-views</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.2.2</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.20</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.7.20</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-hdfs</artifactId>
- <version>${hadoop.version}</version>
- <exclusions>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-common</artifactId>
- <version>${hadoop.version}</version>
- <exclusions>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- </exclusion>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-mapreduce-client-common</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-mapreduce-client-core</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-yarn-client</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.hive</groupId>
- <artifactId>hive-jdbc</artifactId>
- <version>${hive-version}</version>
- <exclusions>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- </exclusion>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.thrift</groupId>
- <artifactId>libthrift</artifactId>
- <version>0.9.0</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.11</artifactId>
- <version>2.3.15</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-minicluster</artifactId>
- <version>${hadoop.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.ambari.contrib.views</groupId>
- <artifactId>ambari-views-utils</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>commons-validator</groupId>
- <artifactId>commons-validator</artifactId>
- <version>1.4.0</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-csv</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.11</artifactId>
- <version>2.3.15</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ambari.contrib.views</groupId>
- <artifactId>ambari-views-commons</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- </dependency>
- </dependencies>
-
- <properties>
- <ambari.dir>${project.parent.parent.parent.basedir}</ambari.dir>
- <hive-version>2.1.0</hive-version>
- <ambari.version>1.3.0.0-SNAPSHOT</ambari.version>
- </properties>
- <build>
- <plugins>
-
- <!-- Building frontend -->
- <plugin>
- <groupId>com.github.eirslett</groupId>
- <artifactId>frontend-maven-plugin</artifactId>
- <version>1.4</version>
- <configuration>
- <nodeVersion>v4.5.0</nodeVersion>
- <yarnVersion>v0.23.2</yarnVersion>
- <workingDirectory>src/main/resources/ui/hive-web/</workingDirectory>
- <npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
- <!-- setting npm_config_tmp environment variable is a workaround for
- https://github.com/Medium/phantomjs/issues/673 -->
- <environmentVariables>
- <npm_config_tmp>/tmp/npm_config_tmp</npm_config_tmp>
- </environmentVariables>
- </configuration>
- <executions>
- <execution>
- <id>install node and yarn</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>install-node-and-yarn</goal>
- </goals>
- </execution>
- <execution>
- <id>yarn install --pure-lockfile</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>yarn</goal>
- </goals>
- <configuration>
- <arguments>install --python="${project.basedir}/../src/main/unix/ambari-python-wrap" --unsafe-perm</arguments>
- <arguments>--ignore-engines</arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>exec-maven-plugin</artifactId>
- <groupId>org.codehaus.mojo</groupId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <id>Hive build</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- <configuration>
- <workingDirectory>${basedir}/src/main/resources/ui/hive-web</workingDirectory>
- <executable>node/node</executable>
- <arguments>
- <argument>node_modules/.bin/ember</argument>
- <argument>build</argument>
- </arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
- <includeScope>runtime</includeScope>
- </configuration>
- </execution>
- <execution>
- <id>copy-artifact</id>
- <phase>package</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>${project.artifactId}</artifactId>
- <version>${project.version}</version>
- <type>${project.packaging}</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${views.jars.dir.rel}</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.vafer</groupId>
- <artifactId>jdeb</artifactId>
- <version>1.0.1</version>
- <executions>
- <execution>
- <phase>none</phase>
- <goals>
- <goal>jdeb</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <submodules>false</submodules>
- </configuration>
- </plugin>
- </plugins>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <includes>
- <include>META-INF/**/*</include>
- <include>view.xml</include>
- <include>view.log4j.properties</include>
- <include>application.conf</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources/ui/hive-web/dist</directory>
- <filtering>false</filtering>
- </resource>
- <resource>
- <directory>src/main/resources/ui/hive-web/bower_components/polestar</directory>
- <filtering>false</filtering>
- <targetPath>polestar</targetPath>
- </resource>
- <resource>
- <directory>src/main/resources/ui/hive-web/bower_components/voyager</directory>
- <filtering>false</filtering>
- <targetPath>voyager</targetPath>
- </resource>
- <resource>
- <targetPath>WEB-INF/lib</targetPath>
- <filtering>false</filtering>
- <directory>target/lib</directory>
- </resource>
- </resources>
- </build>
-</project>
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/ParseUtils.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/ParseUtils.java
deleted file mode 100644
index 34a1b8b..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/uploads/parsers/ParseUtils.java
+++ /dev/null
@@ -1,213 +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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.hive2.resources.uploads.parsers;
-
-import com.google.common.base.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.Timestamp;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-import static org.apache.ambari.view.hive2.client.ColumnDescription.DataTypes;
-
-public class ParseUtils {
-
- protected final static Logger LOG =
- LoggerFactory.getLogger(ParseUtils.class);
-
- final public static DataTypes[] dataTypeList = {DataTypes.BOOLEAN, DataTypes.INT, DataTypes.BIGINT, DataTypes.DOUBLE, DataTypes.CHAR, DataTypes.TIMESTAMP, DataTypes.DATE, DataTypes.STRING};
- private static final String HIVE_DATE_FORMAT = "yyyy-MM-dd";
-
- // no strict checking required as it is done by Date parsing
- private static final String HIVE_DATE_FORMAT_REGEX = "^[0-9]{4}-[0-9]?[0-9]-[0-9]?[0-9]$";
-
-
- public static boolean isInteger(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Integer)
- return true;
-
- try {
- Integer i = Integer.parseInt(object.toString());
- return true;
- } catch (NumberFormatException nfe) {
- return false;
- }
- }
-
- public static boolean isBoolean(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Boolean)
- return true;
-
- String strValue = object.toString();
- return strValue.equalsIgnoreCase("true") || strValue.equalsIgnoreCase("false");
- }
-
- public static boolean isString(Object object) {
- return object != null;
- }
-
- public static boolean isLong(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Long)
- return true;
-
- try {
- Long i = Long.parseLong(object.toString());
- return true;
- } catch (Exception nfe) {
- return false;
- }
- }
-
- public static boolean isDouble(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Double)
- return true;
-
- try {
- Double i = Double.parseDouble(object.toString());
- return true;
- } catch (Exception nfe) {
- return false;
- }
- }
-
- public static boolean isChar(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Character)
- return true;
-
- String str = object.toString().trim();
- return str.length() == 1;
-
- }
-
- public static boolean isDate(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Date)
- return true;
-
- String str = object.toString();
- if (!Strings.isNullOrEmpty(str)) {
- str = str.trim();
- if (str.matches(HIVE_DATE_FORMAT_REGEX)) {
- try {
- SimpleDateFormat sdf = new SimpleDateFormat(HIVE_DATE_FORMAT);
- sdf.setLenient(false);
- Date date = sdf.parse(str);
- return true;
- } catch (Exception e) {
- LOG.debug("error while parsing as date string {}, format {}", str, HIVE_DATE_FORMAT, e);
- }
- }
- }
- return false;
- }
-
- public static boolean isTimeStamp(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Date)
- return true;
-
- String str = object.toString();
- try {
- Timestamp ts = Timestamp.valueOf(str);
- return true;
- } catch (Exception e) {
- LOG.debug("error while parsing as timestamp string {}", str, e);
- }
-
- return false;
- }
-
- public static DataTypes detectHiveDataType(Object object) {
- // detect Integer
- if (isBoolean(object)) return DataTypes.BOOLEAN;
- if (isInteger(object)) return DataTypes.INT;
- if (isLong(object)) return DataTypes.BIGINT;
- if (isDouble(object)) return DataTypes.DOUBLE;
- if (isChar(object)) return DataTypes.CHAR;
- if (isTimeStamp(object)) return DataTypes.TIMESTAMP;
- if (isDate(object)) return DataTypes.DATE;
-
- return DataTypes.STRING;
- }
-
- public static boolean checkDatatype( Object object, DataTypes datatype){
- switch(datatype){
-
- case BOOLEAN :
- return isBoolean(object);
- case INT :
- return isInteger(object);
- case BIGINT :
- return isLong(object);
- case DOUBLE:
- return isDouble(object);
- case CHAR:
- return isChar(object);
- case DATE:
- return isDate(object);
- case TIMESTAMP:
- return isTimeStamp(object);
- case STRING:
- return isString(object);
-
- default:
- LOG.error("this datatype detection is not supported : {}", datatype);
- return false;
- }
- }
-
- public static DataTypes detectHiveColumnDataType(List<Object> colValues) {
- boolean found;
- for(DataTypes datatype : dataTypeList){
- found = true;
- for(Object object : colValues){
- if(!checkDatatype(object,datatype)){
- found = false;
- break;
- }
- }
-
- if(found) return datatype;
- }
-
- return DataTypes.STRING; //default
- }
-}
diff --git a/contrib/views/hive20/pom.xml b/contrib/views/hive20/pom.xml
deleted file mode 100644
index c851a40..0000000
--- a/contrib/views/hive20/pom.xml
+++ /dev/null
@@ -1,426 +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.
--->
-<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <artifactId>hive20</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- <name>Hive 2.0</name>
-
- <parent>
- <groupId>org.apache.ambari.contrib.views</groupId>
- <artifactId>ambari-contrib-views</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>com.jayway.jsonpath</groupId>
- <artifactId>json-path</artifactId>
- <version>2.0.0</version>
- </dependency>
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- <version>4.1.0</version>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey.contribs</groupId>
- <artifactId>jersey-multipart</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-client</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-json</artifactId>
- </dependency>
- <dependency>
- <groupId>com.googlecode.json-simple</groupId>
- <artifactId>json-simple</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>commons-configuration</groupId>
- <artifactId>commons-configuration</artifactId>
- <version>1.6</version>
- </dependency>
- <dependency>
- <groupId>com.opencsv</groupId>
- <artifactId>opencsv</artifactId>
- <version>3.8</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-collections4</artifactId>
- <version>4.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ambari</groupId>
- <artifactId>ambari-views</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.2.2</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.20</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.7.20</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-hdfs</artifactId>
- <version>${hadoop.version}</version>
- <exclusions>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-common</artifactId>
- <version>${hadoop.version}</version>
- <exclusions>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- </exclusion>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-mapreduce-client-common</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-mapreduce-client-core</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-yarn-client</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>javax.ws.rs-api</artifactId>
- <version>2.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.hive</groupId>
- <artifactId>hive-jdbc</artifactId>
- <version>${hive-version}</version>
- <exclusions>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-runtime</artifactId>
- </exclusion>
- <exclusion>
- <groupId>tomcat</groupId>
- <artifactId>jasper-compiler</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.2</version>
- </dependency>
- <dependency>
- <groupId>org.apache.thrift</groupId>
- <artifactId>libthrift</artifactId>
- <version>0.9.0</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.11</artifactId>
- <version>2.3.15</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-minicluster</artifactId>
- <version>${hadoop.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.ambari.contrib.views</groupId>
- <artifactId>ambari-views-utils</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>commons-validator</groupId>
- <artifactId>commons-validator</artifactId>
- <version>1.4.0</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
- <dependency>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-csv</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.11</artifactId>
- <version>2.3.15</version>
- </dependency>
- <dependency>
- <groupId>org.apache.ambari.contrib.views</groupId>
- <artifactId>ambari-views-commons</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-all</artifactId>
- <version>2.4.4</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.spockframework</groupId>
- <artifactId>spock-core</artifactId>
- <version>1.0-groovy-2.4</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <properties>
- <ambari.dir>../../..</ambari.dir>
- <hive-version>2.1.0</hive-version>
- <ambari.version>1.3.0.0-SNAPSHOT</ambari.version>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.gmavenplus</groupId>
- <artifactId>gmavenplus-plugin</artifactId>
- <version>1.4</version>
- <executions>
- <execution>
- <goals>
- <goal>generateStubs</goal>
- <goal>compile</goal>
- <goal>testGenerateStubs</goal>
- <goal>testCompile</goal>
- </goals>
- </execution>
- </executions>
- <dependencies>
- <dependency>
- <groupId>org.codehaus.groovy</groupId>
- <artifactId>groovy-all</artifactId>
- <version>2.4.4</version>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
- </plugin>
- <!-- Building frontend -->
- <plugin>
- <groupId>com.github.eirslett</groupId>
- <artifactId>frontend-maven-plugin</artifactId>
- <version>1.4</version>
- <configuration>
- <nodeVersion>v4.5.0</nodeVersion>
- <yarnVersion>v0.23.2</yarnVersion>
- <workingDirectory>src/main/resources/ui/</workingDirectory>
- <npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
- <!-- setting npm_config_tmp environment variable is a workaround for
- https://github.com/Medium/phantomjs/issues/673 -->
- <environmentVariables>
- <npm_config_tmp>/tmp/npm_config_tmp</npm_config_tmp>
- </environmentVariables>
- </configuration>
- <executions>
- <execution>
- <id>install node and yarn</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>install-node-and-yarn</goal>
- </goals>
- </execution>
- <execution>
- <id>yarn install --pure-lockfile</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>yarn</goal>
- </goals>
- <configuration>
- <arguments>install --python="${project.basedir}/../src/main/unix/ambari-python-wrap" --unsafe-perm</arguments>
- <arguments>--ignore-engines</arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>exec-maven-plugin</artifactId>
- <groupId>org.codehaus.mojo</groupId>
- <version>1.3.2</version>
- <executions>
- <execution>
- <id>Hive build</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- <configuration>
- <workingDirectory>${basedir}/src/main/resources/ui</workingDirectory>
- <executable>node/node</executable>
- <arguments>
- <argument>node_modules/.bin/ember</argument>
- <argument>build</argument>
- <argument>--environment=production</argument>
- </arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.1</version>
- <configuration>
- <source>1.7</source>
- <target>1.7</target>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
- <includeScope>runtime</includeScope>
- </configuration>
- </execution>
- <execution>
- <id>copy-artifact</id>
- <phase>package</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>${project.artifactId}</artifactId>
- <version>${project.version}</version>
- <type>${project.packaging}</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${views.jars.dir.rel}</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.vafer</groupId>
- <artifactId>jdeb</artifactId>
- <version>1.0.1</version>
- <executions>
- <execution>
- <phase>none</phase>
- <goals>
- <goal>jdeb</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <submodules>false</submodules>
- </configuration>
- </plugin>
- </plugins>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>false</filtering>
- <includes>
- <include>META-INF/**/*</include>
- <include>view.xml</include>
- <include>view.log4j.properties</include>
- <include>application.conf</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources/ui/dist</directory>
- <filtering>false</filtering>
- </resource>
- <resource>
- <directory>src/main/resources/ui/bower_components/polestar</directory>
- <filtering>false</filtering>
- <targetPath>polestar</targetPath>
- </resource>
- <resource>
- <directory>src/main/resources/ui/bower_components/voyager</directory>
- <filtering>false</filtering>
- <targetPath>voyager</targetPath>
- </resource>
- <resource>
- <targetPath>WEB-INF/lib</targetPath>
- <filtering>false</filtering>
- <directory>target/lib</directory>
- </resource>
- </resources>
- </build>
-</project>
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/ParseUtils.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/ParseUtils.java
deleted file mode 100644
index 1a22b6b..0000000
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/ParseUtils.java
+++ /dev/null
@@ -1,213 +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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.hive20.resources.uploads.parsers;
-
-import com.google.common.base.Strings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.Timestamp;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-import static org.apache.ambari.view.hive20.client.ColumnDescription.DataTypes;
-
-public class ParseUtils {
-
- protected final static Logger LOG =
- LoggerFactory.getLogger(ParseUtils.class);
-
- final public static DataTypes[] dataTypeList = {DataTypes.BOOLEAN, DataTypes.INT, DataTypes.BIGINT, DataTypes.DOUBLE, DataTypes.CHAR, DataTypes.TIMESTAMP, DataTypes.DATE, DataTypes.STRING};
- private static final String HIVE_DATE_FORMAT = "yyyy-MM-dd";
-
- // no strict checking required as it is done by Date parsing
- private static final String HIVE_DATE_FORMAT_REGEX = "^[0-9]{4}-[0-9]?[0-9]-[0-9]?[0-9]$";
-
-
- public static boolean isInteger(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Integer)
- return true;
-
- try {
- Integer i = Integer.parseInt(object.toString());
- return true;
- } catch (NumberFormatException nfe) {
- return false;
- }
- }
-
- public static boolean isBoolean(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Boolean)
- return true;
-
- String strValue = object.toString();
- return strValue.equalsIgnoreCase("true") || strValue.equalsIgnoreCase("false");
- }
-
- public static boolean isString(Object object) {
- return object != null;
- }
-
- public static boolean isLong(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Long)
- return true;
-
- try {
- Long i = Long.parseLong(object.toString());
- return true;
- } catch (Exception nfe) {
- return false;
- }
- }
-
- public static boolean isDouble(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Double)
- return true;
-
- try {
- Double i = Double.parseDouble(object.toString());
- return true;
- } catch (Exception nfe) {
- return false;
- }
- }
-
- public static boolean isChar(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Character)
- return true;
-
- String str = object.toString().trim();
- return str.length() == 1;
-
- }
-
- public static boolean isDate(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Date)
- return true;
-
- String str = object.toString();
- if (!Strings.isNullOrEmpty(str)) {
- str = str.trim();
- if (str.matches(HIVE_DATE_FORMAT_REGEX)) {
- try {
- SimpleDateFormat sdf = new SimpleDateFormat(HIVE_DATE_FORMAT);
- sdf.setLenient(false);
- Date date = sdf.parse(str);
- return true;
- } catch (Exception e) {
- LOG.debug("error while parsing as date string {}, format {}", str, HIVE_DATE_FORMAT, e);
- }
- }
- }
- return false;
- }
-
- public static boolean isTimeStamp(Object object) {
- if (object == null)
- return false;
-
- if (object instanceof Date)
- return true;
-
- String str = object.toString();
- try {
- Timestamp ts = Timestamp.valueOf(str);
- return true;
- } catch (Exception e) {
- LOG.debug("error while parsing as timestamp string {}", str, e);
- }
-
- return false;
- }
-
- public static DataTypes detectHiveDataType(Object object) {
- // detect Integer
- if (isBoolean(object)) return DataTypes.BOOLEAN;
- if (isInteger(object)) return DataTypes.INT;
- if (isLong(object)) return DataTypes.BIGINT;
- if (isDouble(object)) return DataTypes.DOUBLE;
- if (isChar(object)) return DataTypes.CHAR;
- if (isTimeStamp(object)) return DataTypes.TIMESTAMP;
- if (isDate(object)) return DataTypes.DATE;
-
- return DataTypes.STRING;
- }
-
- public static boolean checkDatatype( Object object, DataTypes datatype){
- switch(datatype){
-
- case BOOLEAN :
- return isBoolean(object);
- case INT :
- return isInteger(object);
- case BIGINT :
- return isLong(object);
- case DOUBLE:
- return isDouble(object);
- case CHAR:
- return isChar(object);
- case DATE:
- return isDate(object);
- case TIMESTAMP:
- return isTimeStamp(object);
- case STRING:
- return isString(object);
-
- default:
- LOG.error("this datatype detection is not supported : {}", datatype);
- return false;
- }
- }
-
- public static DataTypes detectHiveColumnDataType(List<Object> colValues) {
- boolean found;
- for(DataTypes datatype : dataTypeList){
- found = true;
- for(Object object : colValues){
- if(!checkDatatype(object,datatype)){
- found = false;
- break;
- }
- }
-
- if(found) return datatype;
- }
-
- return DataTypes.STRING; //default
- }
-}
diff --git a/contrib/views/tez/pom.xml b/contrib/views/tez/pom.xml
deleted file mode 100644
index 0c058a0..0000000
--- a/contrib/views/tez/pom.xml
+++ /dev/null
@@ -1,281 +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.
- -->
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.apache.ambari.contrib.views</groupId>
- <artifactId>ambari-contrib-views</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- </parent>
- <properties>
- <ambari.dir>${project.parent.parent.parent.basedir}</ambari.dir>
- <tez.view.version>0.7.0.0-SNAPSHOT</tez.view.version>
- <tez.version>0.7.0</tez.version>
- </properties>
- <modelVersion>4.0.0</modelVersion>
- <artifactId>tez-view</artifactId>
- <name>Tez</name>
- <version>${tez.view.version}</version>
- <description>Tez View</description>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.8</version>
- <executions>
- <execution>
- <id>parse-version</id>
- <phase>validate</phase>
- <goals>
- <goal>parse-version</goal>
- </goals>
- </execution>
- <execution>
- <id>regex-property</id>
- <goals>
- <goal>regex-property</goal>
- </goals>
- <configuration>
- <name>ambariVersion</name>
- <value>${project.version}</value>
- <regex>^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)(\.|-).*</regex>
- <replacement>$1.$2.$3.$4</replacement>
- <failIfNoMatch>false</failIfNoMatch>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- Unpack the dependent war and add to classes directory -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <version>2.9</version>
- <executions>
- <execution>
- <phase>generate-resources</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
- <includeScope>runtime</includeScope>
- </configuration>
- </execution>
- <execution>
- <id>unpack</id>
- <phase>process-resources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.apache.tez</groupId>
- <artifactId>tez-ui</artifactId>
- <version>${tez.version}</version>
- <type>war</type>
- <overWrite>false</overWrite>
- <outputDirectory>target/classes</outputDirectory>
- </artifactItem>
- </artifactItems>
- <includes>fonts/**/*, img/**/*, scripts/**/*, assets/**/*, config/**/*, styles/**/*, index.html</includes>
- </configuration>
- </execution>
- <execution>
- <id>copy-artifact</id>
- <phase>package</phase>
- <goals>
- <goal>copy</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>${project.groupId}</groupId>
- <artifactId>${project.artifactId}</artifactId>
- <version>${project.version}</version>
- <type>${project.packaging}</type>
- </artifactItem>
- </artifactItems>
- <outputDirectory>${views.jars.dir.rel}</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <!-- Adds init view script to the UI -->
- <plugin>
- <groupId>com.google.code.maven-replacer-plugin</groupId>
- <artifactId>replacer</artifactId>
- <version>1.5.3</version>
- <executions>
- <execution>
- <phase>process-resources</phase>
- <goals>
- <goal>replace</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <file>${project.build.directory}/classes/index.html</file>
- <replacements>
- <replacement>
- <token></body></token>
- <value><script src="ambari-scripts/init-view.js"></script></body></value>
- </replacement>
- </replacements>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.vafer</groupId>
- <artifactId>jdeb</artifactId>
- <version>1.0.1</version>
- <executions>
- <execution>
- <phase>none</phase>
- <goals>
- <goal>jdeb</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <skip>true</skip>
- <submodules>false</submodules>
- </configuration>
- </plugin>
- </plugins>
-
- <resources>
- <resource>
- <directory>src/main/resources/ui</directory>
- <filtering>false</filtering>
- <includes>
- <include>ambari-scripts/*</include>
- </includes>
- </resource>
-
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- <includes>
- <include>WEB-INF/web.xml</include>
- <include>META-INF/**/*</include>
- <include>view.xml</include>
- <include>view.log4j.properties</include>
- </includes>
- </resource>
- <resource>
- <targetPath>WEB-INF/lib</targetPath>
- <filtering>false</filtering>
- <directory>target/lib</directory>
- </resource>
- </resources>
-
- </build>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.tez</groupId>
- <artifactId>tez-ui</artifactId>
- <version>${tez.version}</version>
- <type>war</type>
- </dependency>
-
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-server</artifactId>
- <version>1.8</version>
- </dependency>
-
- <dependency>
- <groupId>com.sun.jersey</groupId>
- <artifactId>jersey-core</artifactId>
- <version>1.8</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ambari</groupId>
- <artifactId>ambari-views</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>com.google.inject</groupId>
- <artifactId>guice</artifactId>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.7.20</version>
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- <version>4.5.2</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpcore</artifactId>
- <version>4.4.3</version>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymock</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.ambari.contrib.views</groupId>
- <artifactId>ambari-views-utils</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
- </dependency>
-
- </dependencies>
-</project>
--
To stop receiving notification emails like this one, please contact
mgergely@apache.org.