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/15 10:38:48 UTC
[ambari] branch trunk updated: Revert "AMBARI-23817 : Visualizing
the Encrypted zones and Erasure coded zones in HDFS (nitirajrathore)
(#1243)"
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 4c90384 Revert "AMBARI-23817 : Visualizing the Encrypted zones and Erasure coded zones in HDFS (nitirajrathore) (#1243)"
4c90384 is described below
commit 4c903848e54134a9c011f1b13b248057864e0902
Author: Miklos Gergely <mg...@hortonworks.com>
AuthorDate: Tue May 15 12:37:31 2018 +0200
Revert "AMBARI-23817 : Visualizing the Encrypted zones and Erasure coded zones in HDFS (nitirajrathore) (#1243)"
---
contrib/views/ambari-views-package/pom.xml | 2 +-
contrib/views/commons/pom.xml | 6 --
contrib/views/files/pom.xml | 1 +
.../main/resources/ui/app/config/files-columns.js | 20 +-----
.../main/resources/ui/app/helpers/shorten-text.js | 4 --
.../files/src/main/resources/ui/app/models/file.js | 3 -
.../ui/app/templates/components/file-row.hbs | 10 ---
contrib/views/hueambarimigration/pom.xml | 4 +-
contrib/views/jobs/pom.xml | 1 +
contrib/views/pig/pom.xml | 21 ++----
.../org/apache/ambari/view/pig/test/JobTest.java | 26 ++++----
.../ambari/view/pig/test/ScriptTestUnmanaged.java | 3 +-
contrib/views/pom.xml | 66 +------------------
contrib/views/storm/pom.xml | 6 +-
contrib/views/utils/pom.xml | 11 +---
.../org/apache/ambari/view/utils/hdfs/HdfsApi.java | 14 +---
.../ambari/view/utils/hdfs/DummyFileStatus.java | 76 ----------------------
.../view/utils/hdfs/DummyNonHdfsFileStatus.java | 24 -------
.../apache/ambari/view/utils/hdfs/HdfsApiTest.java | 63 ------------------
19 files changed, 33 insertions(+), 328 deletions(-)
diff --git a/contrib/views/ambari-views-package/pom.xml b/contrib/views/ambari-views-package/pom.xml
index 1ed662e..16c9985 100644
--- a/contrib/views/ambari-views-package/pom.xml
+++ b/contrib/views/ambari-views-package/pom.xml
@@ -21,7 +21,7 @@
<groupId>org.apache.ambari.contrib.views</groupId>
<artifactId>ambari-views-package</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
+ <version>2.5.0.0.0</version>
<name>Ambari Views Package</name>
<parent>
<groupId>org.apache.ambari.contrib.views</groupId>
diff --git a/contrib/views/commons/pom.xml b/contrib/views/commons/pom.xml
index e380122..5018d46 100644
--- a/contrib/views/commons/pom.xml
+++ b/contrib/views/commons/pom.xml
@@ -58,12 +58,6 @@
<dependency>
<groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-hdfs-client</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${hadoop.version}</version>
<exclusions>
diff --git a/contrib/views/files/pom.xml b/contrib/views/files/pom.xml
index acd7632..f7adbb5 100644
--- a/contrib/views/files/pom.xml
+++ b/contrib/views/files/pom.xml
@@ -17,6 +17,7 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.ambari.contrib.views</groupId>
<artifactId>files</artifactId>
<version>1.0.0.0-SNAPSHOT</version>
<name>Files</name>
diff --git a/contrib/views/files/src/main/resources/ui/app/config/files-columns.js b/contrib/views/files/src/main/resources/ui/app/config/files-columns.js
index d1caff7..4dce394 100644
--- a/contrib/views/files/src/main/resources/ui/app/config/files-columns.js
+++ b/contrib/views/files/src/main/resources/ui/app/config/files-columns.js
@@ -26,7 +26,7 @@ var columnsConfig = [
isVisible: true,
sortable: true,
sortOrder: 0,
- columnClass: 'col-md-3 col-xs-3'
+ columnClass: 'col-md-4 col-xs-4'
},
{
title: 'Size',
@@ -50,7 +50,7 @@ var columnsConfig = [
isVisible: true,
sortable: true,
sortOrder: 0,
- columnClass: 'col-md-1 col-xs-1'
+ columnClass: 'col-md-2 col-xs-2'
},
{
title: 'Group',
@@ -66,23 +66,7 @@ var columnsConfig = [
isVisible: true,
sortable: false,
sortOrder: 0,
- columnClass: 'col-md-1 col-xs-1'
- },
- {
- title: 'Erasure Coding',
- key: 'erasureCodingPolicyName',
- isVisible: true,
- sortable: false,
- sortOrder: 0,
columnClass: 'col-md-2 col-xs-2'
- },
- {
- title: 'Encrypted',
- key: 'isEncrypted',
- isVisible: true,
- sortable: false,
- sortOrder: 0,
- columnClass: 'col-md-1 col-xs-1'
}
];
diff --git a/contrib/views/files/src/main/resources/ui/app/helpers/shorten-text.js b/contrib/views/files/src/main/resources/ui/app/helpers/shorten-text.js
index f95ae85..c50b5ca 100644
--- a/contrib/views/files/src/main/resources/ui/app/helpers/shorten-text.js
+++ b/contrib/views/files/src/main/resources/ui/app/helpers/shorten-text.js
@@ -20,10 +20,6 @@ import Ember from 'ember';
export function shortenText(params) {
let text = params[0];
- if(!text){
- return text;
- }
-
let length = params[1];
if (text.length < length) {
return text;
diff --git a/contrib/views/files/src/main/resources/ui/app/models/file.js b/contrib/views/files/src/main/resources/ui/app/models/file.js
index eb26c0f..a2ed1f3 100644
--- a/contrib/views/files/src/main/resources/ui/app/models/file.js
+++ b/contrib/views/files/src/main/resources/ui/app/models/file.js
@@ -33,9 +33,6 @@ export default DS.Model.extend({
modificationTime : DS.attr('iso-date'),
blockSize : DS.attr('number'),
replication : DS.attr('number'),
- isEncrypted : DS.attr('boolean'),
- isErasureCoded : DS.attr('boolean'),
- erasureCodingPolicyName : DS.attr('string'),
size : Ember.computed.alias('len'),
path: function() {
diff --git a/contrib/views/files/src/main/resources/ui/app/templates/components/file-row.hbs b/contrib/views/files/src/main/resources/ui/app/templates/components/file-row.hbs
index 9b0ba12..5198504 100644
--- a/contrib/views/files/src/main/resources/ui/app/templates/components/file-row.hbs
+++ b/contrib/views/files/src/main/resources/ui/app/templates/components/file-row.hbs
@@ -43,14 +43,4 @@
<div class={{get-value-from-columns columnHeaders 'permission' 'columnClass'}}>
{{show-permission-string file}}
</div>
- <div class={{get-value-from-columns columnHeaders 'erasureCodingPolicyName' 'columnClass'}}>
- {{file.erasureCodingPolicyName}}
- </div>
- <div class={{get-value-from-columns columnHeaders 'isEncrypted' 'columnClass'}}>
- {{#if file.isEncrypted}}
- Yes
- {{else}}
- No
- {{/if}}
- </div>
</div>
diff --git a/contrib/views/hueambarimigration/pom.xml b/contrib/views/hueambarimigration/pom.xml
index 72100e0..ec24679 100644
--- a/contrib/views/hueambarimigration/pom.xml
+++ b/contrib/views/hueambarimigration/pom.xml
@@ -19,7 +19,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.ambari.contrib.views</groupId>
<artifactId>hueambarimigration</artifactId>
-<version>2.0.0.0-SNAPSHOT</version>
+<version>1.0.0.0-SNAPSHOT</version>
<name>hueambarimigration</name>
<parent>
@@ -51,7 +51,7 @@
<dependency>
<groupId>org.apache.ambari</groupId>
<artifactId>ambari-views</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
+ <version>[1.7.0.0,)</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
diff --git a/contrib/views/jobs/pom.xml b/contrib/views/jobs/pom.xml
index 37f0cf7..ea8a527 100644
--- a/contrib/views/jobs/pom.xml
+++ b/contrib/views/jobs/pom.xml
@@ -199,6 +199,7 @@
<dependency>
<groupId>org.apache.ambari</groupId>
<artifactId>ambari-views</artifactId>
+ <version>${ambari.version}</version>
</dependency>
<dependency>
diff --git a/contrib/views/pig/pom.xml b/contrib/views/pig/pom.xml
index 1f5e2bf..1430f69 100644
--- a/contrib/views/pig/pom.xml
+++ b/contrib/views/pig/pom.xml
@@ -17,8 +17,9 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.ambari.contrib.views</groupId>
<artifactId>pig</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
+ <version>1.0.0.0-SNAPSHOT</version>
<name>Pig</name>
<parent>
@@ -60,12 +61,6 @@
<groupId>commons-configuration</groupId>
<artifactId>commons-configuration</artifactId>
<version>1.6</version>
- <exclusions>
- <exclusion>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils-core</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.apache.ambari</groupId>
@@ -80,6 +75,7 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
+ <version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
@@ -158,16 +154,7 @@
</properties>
<build>
<plugins>
- <plugin>
- <!--disabled parallel execution of tests for pig-->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <forkCount>0</forkCount>
- </configuration>
-
- </plugin>
- <plugin>
+ <plugin>
<!-- Cleanup ui files -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
diff --git a/contrib/views/pig/src/test/java/org/apache/ambari/view/pig/test/JobTest.java b/contrib/views/pig/src/test/java/org/apache/ambari/view/pig/test/JobTest.java
index dc1ae72..b46fc7e 100644
--- a/contrib/views/pig/src/test/java/org/apache/ambari/view/pig/test/JobTest.java
+++ b/contrib/views/pig/src/test/java/org/apache/ambari/view/pig/test/JobTest.java
@@ -108,7 +108,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream);
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
@@ -143,7 +143,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream).anyTimes();
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
@@ -184,7 +184,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream);
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
@@ -210,7 +210,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream);
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
@@ -245,7 +245,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream);
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
@@ -267,8 +267,8 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream baScriptStream = new ByteArrayOutputStream();
ByteArrayOutputStream baTempletonArgsStream = new ByteArrayOutputStream();
- FSDataOutputStream scriptStream = new FSDataOutputStream(baScriptStream, null);
- FSDataOutputStream templetonArgsStream = new FSDataOutputStream(baTempletonArgsStream, null);
+ FSDataOutputStream scriptStream = new FSDataOutputStream(baScriptStream);
+ FSDataOutputStream templetonArgsStream = new FSDataOutputStream(baTempletonArgsStream);
expect(hdfsApi.create(endsWith("script.pig"), eq(true))).andReturn(scriptStream);
expect(hdfsApi.create(endsWith("params"), eq(true))).andReturn(templetonArgsStream);
replay(hdfsApi);
@@ -294,7 +294,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream);
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
@@ -317,7 +317,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream);
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
@@ -339,7 +339,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream);
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
@@ -362,7 +362,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream);
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
@@ -397,7 +397,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream);
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
@@ -432,7 +432,7 @@ public class JobTest extends BasePigTest {
ByteArrayOutputStream do_stream = new ByteArrayOutputStream();
- FSDataOutputStream stream = new FSDataOutputStream(do_stream, null);
+ FSDataOutputStream stream = new FSDataOutputStream(do_stream);
expect(hdfsApi.create(anyString(), eq(true))).andReturn(stream);
replay(hdfsApi);
UserLocalObjects.setHdfsApi(hdfsApi, context);
diff --git a/contrib/views/pig/src/test/java/org/apache/ambari/view/pig/test/ScriptTestUnmanaged.java b/contrib/views/pig/src/test/java/org/apache/ambari/view/pig/test/ScriptTestUnmanaged.java
index 9cfd60c..23f9fba 100644
--- a/contrib/views/pig/src/test/java/org/apache/ambari/view/pig/test/ScriptTestUnmanaged.java
+++ b/contrib/views/pig/src/test/java/org/apache/ambari/view/pig/test/ScriptTestUnmanaged.java
@@ -22,7 +22,6 @@ import org.apache.ambari.view.ViewContext;
import org.apache.ambari.view.ViewResourceHandler;
import org.apache.ambari.view.pig.BasePigTest;
import org.apache.ambari.view.pig.resources.scripts.ScriptService;
-import org.apache.ambari.view.pig.utils.ServiceFormattedException;
import org.apache.ambari.view.utils.UserLocal;
import org.apache.ambari.view.utils.hdfs.HdfsApi;
import org.apache.ambari.view.utils.hdfs.HdfsApiException;
@@ -77,7 +76,7 @@ public class ScriptTestUnmanaged extends BasePigTest {
replay(handler, context);
scriptService = getService(ScriptService.class, handler, context);
- thrown.expect(ServiceFormattedException.class);
+ thrown.expect(HdfsApiException.class);
doCreateScript("Test", null);
}
}
diff --git a/contrib/views/pom.xml b/contrib/views/pom.xml
index 9e848d7..3c3f008 100644
--- a/contrib/views/pom.xml
+++ b/contrib/views/pom.xml
@@ -31,8 +31,7 @@
<properties>
<ambari.version>2.0.0.0-SNAPSHOT</ambari.version>
<ambari.dir>${project.parent.parent.basedir}</ambari.dir>
- <jetty.version>9.3.19.v20170502</jetty.version>
- <hadoop.version>3.0.0.3.0.0.0-1301</hadoop.version>
+ <hadoop.version>2.7.3</hadoop.version>
<views.jars.dir>views-jars</views.jars.dir>
<views.jars.dir.rel>../target/${views.jars.dir}</views.jars.dir.rel>
</properties>
@@ -163,69 +162,6 @@
</profiles>
<dependencyManagement>
<dependencies>
- <!--We had to include the jetty's and other's version specific to the one used in hadoop and override the ambari managed version because the tests were failing. -->
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-server</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-security</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlet</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-servlets</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-webapp</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-util-ajax</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-servlet</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- <optional>true</optional>
- </dependency>
- <dependency>
- <groupId>org.eclipse.jetty.websocket</groupId>
- <artifactId>websocket-server</artifactId>
- <version>${jetty.version}</version>
- <scope>test</scope>
- <optional>true</optional>
- </dependency>
-
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
diff --git a/contrib/views/storm/pom.xml b/contrib/views/storm/pom.xml
index 6f1ae10..4a1ff68 100644
--- a/contrib/views/storm/pom.xml
+++ b/contrib/views/storm/pom.xml
@@ -26,7 +26,8 @@
<ui.directory>${basedir}/src/main/resources/ui</ui.directory>
</properties>
<modelVersion>4.0.0</modelVersion>
- <artifactId>storm-view</artifactId>
+ <groupId>org.apache.ambari.contrib.views</groupId>
+ <artifactId>storm-view</artifactId>
<name>Storm_Monitoring</name>
<version>0.1.0.0</version>
<description>Storm Monitoring View</description>
@@ -179,12 +180,13 @@
<dependency>
<groupId>org.apache.ambari</groupId>
<artifactId>ambari-views</artifactId>
- <version>2.0.0.0-SNAPSHOT</version>
+ <version>${ambari.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
+ <version>3.0.1</version>
<scope>provided</scope>
</dependency>
diff --git a/contrib/views/utils/pom.xml b/contrib/views/utils/pom.xml
index 63eac8c..82b87c8 100644
--- a/contrib/views/utils/pom.xml
+++ b/contrib/views/utils/pom.xml
@@ -17,6 +17,7 @@
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.ambari.contrib.views</groupId>
<artifactId>ambari-views-utils</artifactId>
<version>2.0.0.0-SNAPSHOT</version>
<name>Ambari View Utils</name>
@@ -75,11 +76,6 @@
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
- <artifactId>hadoop-hdfs-client</artifactId>
- <version>${hadoop.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-yarn-common</artifactId>
<version>${hadoop.version}</version>
</dependency>
@@ -121,6 +117,7 @@
<version>${hadoop.version}</version>
<scope>test</scope>
</dependency>
+
<dependency>
<groupId>org.glassfish.jersey.test-framework</groupId>
<artifactId>jersey-test-framework-core</artifactId>
@@ -174,10 +171,6 @@
<artifactId>commons-validator</artifactId>
<version>1.4.0</version>
</dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- </dependency>
</dependencies>
<properties>
diff --git a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java
index 1f8b584..812cd54 100644
--- a/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java
+++ b/contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java
@@ -31,7 +31,6 @@ import org.apache.hadoop.fs.Trash;
import org.apache.hadoop.fs.TrashPolicy;
import org.apache.hadoop.fs.permission.FsAction;
import org.apache.hadoop.fs.permission.FsPermission;
-import org.apache.hadoop.hdfs.protocol.HdfsFileStatus;
import org.apache.hadoop.security.UserGroupInformation;
import org.json.simple.JSONArray;
import org.slf4j.Logger;
@@ -53,9 +52,6 @@ public class HdfsApi {
private final static Logger LOG =
LoggerFactory.getLogger(HdfsApi.class);
- public static String KeyIsErasureCoded = "isErasureCoded";
- public static String KeyIsEncrypted = "isEncrypted";
- public static String KeyErasureCodingPolicyName = "erasureCodingPolicyName";
private final Configuration conf;
private Map<String, String> authParams;
@@ -558,6 +554,7 @@ public class HdfsApi {
Map<String, Object> json = new LinkedHashMap<String, Object>();
json.put("path", Path.getPathWithoutSchemeAndAuthority(status.getPath())
.toString());
+ json.put("replication", status.getReplication());
json.put("isDirectory", status.isDirectory());
json.put("len", status.getLen());
json.put("owner", status.getOwner());
@@ -570,15 +567,6 @@ public class HdfsApi {
json.put("readAccess", checkAccessPermissions(status, FsAction.READ, ugi));
json.put("writeAccess", checkAccessPermissions(status, FsAction.WRITE, ugi));
json.put("executeAccess", checkAccessPermissions(status, FsAction.EXECUTE, ugi));
- json.put(KeyIsErasureCoded, status.isErasureCoded());
- json.put(KeyIsEncrypted, status.isEncrypted());
-
- if( status instanceof HdfsFileStatus){
- HdfsFileStatus hdfsFileStatus = (HdfsFileStatus) status;
- if(null != hdfsFileStatus.getErasureCodingPolicy()) {
- json.put(KeyErasureCodingPolicyName, hdfsFileStatus.getErasureCodingPolicy().getName());
- }
- }
return json;
}
diff --git a/contrib/views/utils/src/test/java/org/apache/ambari/view/utils/hdfs/DummyFileStatus.java b/contrib/views/utils/src/test/java/org/apache/ambari/view/utils/hdfs/DummyFileStatus.java
deleted file mode 100644
index eb419d6..0000000
--- a/contrib/views/utils/src/test/java/org/apache/ambari/view/utils/hdfs/DummyFileStatus.java
+++ /dev/null
@@ -1,76 +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.utils.hdfs;
-
-import org.apache.hadoop.fs.FileEncryptionInfo;
-import org.apache.hadoop.fs.FileStatus;
-import org.apache.hadoop.fs.permission.FsPermission;
-import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy;
-import org.apache.hadoop.hdfs.protocol.HdfsFileStatus;
-
-public abstract class DummyFileStatus extends FileStatus implements HdfsFileStatus {
- @Override
- public long getFileId() {
- return 0;
- }
-
- @Override
- public FileEncryptionInfo getFileEncryptionInfo() {
- return null;
- }
-
- @Override
- public byte[] getLocalNameInBytes() {
- return new byte[0];
- }
-
- @Override
- public byte[] getSymlinkInBytes() {
- return new byte[0];
- }
-
- @Override
- public int getChildrenNum() {
- return 0;
- }
-
- @Override
- public ErasureCodingPolicy getErasureCodingPolicy() {
- return null;
- }
-
- @Override
- public byte getStoragePolicy() {
- return 0;
- }
-
- @Override
- public void setPermission(FsPermission fsPermission) {
-
- }
-
- @Override
- public void setOwner(String s) {
-
- }
-
- @Override
- public void setGroup(String s) {
-
- }
-}
diff --git a/contrib/views/utils/src/test/java/org/apache/ambari/view/utils/hdfs/DummyNonHdfsFileStatus.java b/contrib/views/utils/src/test/java/org/apache/ambari/view/utils/hdfs/DummyNonHdfsFileStatus.java
deleted file mode 100644
index 1989c47..0000000
--- a/contrib/views/utils/src/test/java/org/apache/ambari/view/utils/hdfs/DummyNonHdfsFileStatus.java
+++ /dev/null
@@ -1,24 +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.utils.hdfs;
-
-import org.apache.hadoop.fs.FileStatus;
-
-public abstract class DummyNonHdfsFileStatus extends FileStatus {
-}
\ No newline at end of file
diff --git a/contrib/views/utils/src/test/java/org/apache/ambari/view/utils/hdfs/HdfsApiTest.java b/contrib/views/utils/src/test/java/org/apache/ambari/view/utils/hdfs/HdfsApiTest.java
index 928d596..e7a6752 100644
--- a/contrib/views/utils/src/test/java/org/apache/ambari/view/utils/hdfs/HdfsApiTest.java
+++ b/contrib/views/utils/src/test/java/org/apache/ambari/view/utils/hdfs/HdfsApiTest.java
@@ -23,10 +23,7 @@ import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FileUtil;
import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.hdfs.MiniDFSCluster;
-import org.apache.hadoop.hdfs.protocol.ErasureCodingPolicy;
-import org.apache.hadoop.io.erasurecode.ECSchema;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
@@ -35,11 +32,6 @@ import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
-import java.util.Map;
-
-import static org.apache.ambari.view.utils.hdfs.HdfsApi.*;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
public class HdfsApiTest {
private FileSystem fs;
@@ -70,61 +62,6 @@ public class HdfsApiTest {
}
@Test
- public void testWith_EC_And_Encryption(){
-// Have to mock DummyFileStatus, because we cannot rely on internal class of hdfs
- DummyFileStatus fileStatus = mock(DummyFileStatus.class);
- FsPermission fsPermission = new FsPermission((short)0777);
- String ecPolicyName = "Some-EC-Policy";
- ECSchema ecSchema = new ECSchema("someSchema", 1, 1);
- ErasureCodingPolicy erasureCodingPolicy = new ErasureCodingPolicy(ecPolicyName, ecSchema, 1024, (byte)0);
- when(fileStatus.getPermission()).thenReturn(fsPermission);
- when(fileStatus.getPath()).thenReturn(new Path("/test/path"));
- when(fileStatus.getErasureCodingPolicy()).thenReturn(erasureCodingPolicy);
- when(fileStatus.isErasureCoded()).thenReturn(true);
- when(fileStatus.isEncrypted()).thenReturn(true);
- Map<String, Object> json = hdfsApi.fileStatusToJSON(fileStatus);
-
- Assert.assertEquals(Boolean.TRUE, json.get(KeyIsErasureCoded));
- Assert.assertEquals(Boolean.TRUE, json.get(KeyIsEncrypted));
- Assert.assertEquals(json.get(KeyErasureCodingPolicyName), ecPolicyName);
- }
-
- @Test
- public void testWithout_EC_And_Encryption(){
-// Have to mock DummyFileStatus, because we cannot rely on internal class of hdfs
- FsPermission fsPermission = new FsPermission((short)0777);
-
- DummyFileStatus fileStatus = mock(DummyFileStatus.class);
- when(fileStatus.getPermission()).thenReturn(fsPermission);
-
- when(fileStatus.getPath()).thenReturn(new Path("/test/path"));
- when(fileStatus.getErasureCodingPolicy()).thenReturn(null);
- when(fileStatus.isErasureCoded()).thenReturn(false);
- when(fileStatus.isEncrypted()).thenReturn(false);
- Map<String, Object> json = hdfsApi.fileStatusToJSON(fileStatus);
-
- Assert.assertEquals(Boolean.FALSE, json.get(KeyIsErasureCoded));
- Assert.assertEquals(Boolean.FALSE, json.get(KeyIsEncrypted));
- Assert.assertNull(json.get(KeyErasureCodingPolicyName));
- }
-
- @Test
- public void testNonHdfsFileStatus(){
-// Have to mock DummyNonHdfsFileStatus, because we cannot rely on internal class of hdfs
- DummyNonHdfsFileStatus fileStatus = mock(DummyNonHdfsFileStatus.class);
- FsPermission fsPermission = new FsPermission((short)0777);
- when(fileStatus.getPermission()).thenReturn(fsPermission);
- when(fileStatus.getPath()).thenReturn(new Path("/test/path"));
-
- when(fileStatus.isErasureCoded()).thenReturn(false);
- when(fileStatus.isEncrypted()).thenReturn(false);
- Map<String, Object> json = hdfsApi.fileStatusToJSON(fileStatus);
-
- Assert.assertEquals(Boolean.FALSE, json.get(KeyIsErasureCoded));
- Assert.assertEquals( Boolean.FALSE,json.get(KeyIsEncrypted));
- Assert.assertNull(json.get(KeyErasureCodingPolicyName));
- }
- @Test
public void filterAndTruncateDirStatus() throws Exception {
{
// null fileStatuses
--
To stop receiving notification emails like this one, please contact
mgergely@apache.org.