You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by db...@apache.org on 2016/06/16 11:19:55 UTC
ambari git commit: AMBARI-17113. Add user home directory verification
as part of Service Check. (dipayanb)
Repository: ambari
Updated Branches:
refs/heads/branch-2.4 0942cc0bb -> de5fd97f3
AMBARI-17113. Add user home directory verification as part of Service Check. (dipayanb)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/de5fd97f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/de5fd97f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/de5fd97f
Branch: refs/heads/branch-2.4
Commit: de5fd97f35e28b9193ff8a3c507ac1dffb5844ae
Parents: 0942cc0
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Thu Jun 16 16:49:25 2016 +0530
Committer: Dipayan Bhowmick <di...@gmail.com>
Committed: Thu Jun 16 16:49:25 2016 +0530
----------------------------------------------------------------------
.../main/resources/ui/app/templates/splash.hbs | 3 +--
contrib/views/hive-next/pom.xml | 5 +++++
.../apache/ambari/view/hive2/HelpService.java | 13 +++++++++++
.../view/hive2/resources/files/FileService.java | 16 ++++++++++++++
.../ui/hive-web/app/controllers/splash.js | 19 ++++++++++------
.../resources/ui/hive-web/app/routes/splash.js | 12 +++++-----
.../ui/hive-web/app/templates/splash.hbs | 23 ++++++++++++++++----
contrib/views/hive/pom.xml | 5 +++++
.../apache/ambari/view/hive/HelpService.java | 12 ++++++++++
.../view/hive/resources/files/FileService.java | 16 ++++++++++++++
.../ui/hive-web/app/controllers/splash.js | 19 ++++++++++------
.../resources/ui/hive-web/app/routes/splash.js | 4 +++-
.../ui/hive-web/app/templates/splash.hbs | 23 ++++++++++++++++----
contrib/views/pig/pom.xml | 5 +++++
.../view/pig/resources/files/FileService.java | 18 +++++++++++++++
.../ambari/view/pig/services/HelpService.java | 14 ++++++++++++
.../ui/pig-web/app/controllers/splash.js | 8 +++----
.../resources/ui/pig-web/app/routes/splash.js | 4 +++-
.../ui/pig-web/app/templates/splash.hbs | 17 +++++++++++++--
.../resources/ui/pig-web/app/translations.js | 3 ++-
20 files changed, 201 insertions(+), 38 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/files/src/main/resources/ui/app/templates/splash.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/files/src/main/resources/ui/app/templates/splash.hbs b/contrib/views/files/src/main/resources/ui/app/templates/splash.hbs
index 4a45366..26dbff0 100644
--- a/contrib/views/files/src/main/resources/ui/app/templates/splash.hbs
+++ b/contrib/views/files/src/main/resources/ui/app/templates/splash.hbs
@@ -18,7 +18,6 @@
<div class="spinner"></div>
<div class="container-fluid">
- <h1>Welcome to the File Browser View</h1>
{{#if allTestsCompleted }}
<h3>Service checks completed.</h3>
{{else}}
@@ -49,7 +48,7 @@
<i class="fa fa-arrow-right"></i>
{{/if}}
</td>
- <td>hdfs service test</td>
+ <td>HDFS test</td>
</tr>
</tbody>
</table>
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive-next/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/pom.xml b/contrib/views/hive-next/pom.xml
index c571352..befcd57 100644
--- a/contrib/views/hive-next/pom.xml
+++ b/contrib/views/hive-next/pom.xml
@@ -231,6 +231,11 @@
<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.4.0.0.0</version>
+ </dependency>
</dependencies>
<properties>
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HelpService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HelpService.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HelpService.java
index b0316ab..95aa3f5 100644
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HelpService.java
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HelpService.java
@@ -78,6 +78,19 @@ public class HelpService extends BaseService {
}
/**
+ * HomeDirectory Status
+ * @return status
+ */
+ @GET
+ @Path("/userhomeStatus")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response userhomeStatus (){
+ FileService.userhomeSmokeTest(context);
+ return getOKResponse();
+ }
+
+
+ /**
* ATS Status
* @return status
*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/files/FileService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/files/FileService.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/files/FileService.java
index db63364..654bfcc 100644
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/files/FileService.java
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/resources/files/FileService.java
@@ -21,6 +21,7 @@ package org.apache.ambari.view.hive2.resources.files;
import com.jayway.jsonpath.JsonPath;
import org.apache.ambari.view.ViewContext;
import org.apache.ambari.view.ViewResourceHandler;
+import org.apache.ambari.view.commons.hdfs.UserService;
import org.apache.ambari.view.hive2.BaseService;
import org.apache.ambari.view.hive2.utils.*;
import org.apache.ambari.view.utils.hdfs.HdfsApi;
@@ -235,6 +236,21 @@ public class FileService extends BaseService {
}
/**
+ * Checks connection to User HomeDirectory
+ * @param context View Context
+ */
+ public static void userhomeSmokeTest(ViewContext context) {
+ try {
+ UserService userservice = new UserService(context);
+ userservice.homeDir();
+ } catch (WebApplicationException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new ServiceFormattedException(ex.getMessage(), ex);
+ }
+ }
+
+ /**
* Wrapper object for json mapping
*/
public static class FileResourceRequest {
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/splash.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/splash.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/splash.js
index 5db93f7..6f495ed 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/splash.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/splash.js
@@ -60,12 +60,11 @@ export default Ember.Controller.extend({
}
model.set(name + 'TestDone', true);
-
var percent = model.get('percent');
- model.set('percent', percent + 33.33);
+ model.set('percent', percent + 25);
};
- var promises = ['hdfs', 'hiveserver', 'ats'].map(function(name) {
+ var promises = ['hdfs', 'hiveserver', 'ats', 'userhome'].map(function(name) {
var finalurl = ((name == 'hiveserver') ? self.get('databaseService.baseUrl') : (url + name + 'Status')) || '' ;
@@ -88,13 +87,17 @@ export default Ember.Controller.extend({
}.property("model.percent"),
allTestsCompleted: function(){
- return this.get('modelhdfsTestDone') && this.get('modelhiveserverTestDone') && this.get('modelatsTestDone');
- }.property('modelhdfsTestDone', 'modelhiveserverTestDone', 'modelatsTestDone'),
+ return this.get('modelhdfsTestDone') && this.get('modelhiveserverTestDone') && this.get('modelatsTestDone') && this.get('modeluserhomeTestDone');
+ }.property('modelhdfsTestDone', 'modelhiveserverTestDone', 'modelatsTestDone', 'modeluserhomeTestDone'),
modelhdfsTestDone: function() {
return this.get('model.hdfsTestDone');
}.property('model.hdfsTestDone' ),
+ modeluserhomeTestDone: function() {
+ return this.get('model.userhomeTestDone');
+ }.property('model.userhomeTestDone' ),
+
modelhiveserverTestDone: function() {
return this.get('model.hiveserverTestDone');
}.property('model.hiveserverTestDone' ),
@@ -107,6 +110,10 @@ export default Ember.Controller.extend({
return this.get('model.hdfsTest');
}.property('model.hdfsTest' ),
+ modeluserhomeTest: function() {
+ return this.get('model.userhomeTest');
+ }.property('model.userhomeTest' ),
+
modelhiveserverTest: function() {
return this.get('model.hiveserverTest');
}.property('model.hiveserverTest' ),
@@ -122,5 +129,3 @@ export default Ember.Controller.extend({
}
}
});
-
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js
index 05bcbcf..b851bf1 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/routes/splash.js
@@ -28,6 +28,8 @@ export default Ember.Route.extend({
hiveserverTestDone: null,
atsTest: null,
atsTestDone: null,
+ userhomeTest: null,
+ userhomeTestDone: null,
percent: 0
});
},
@@ -42,11 +44,11 @@ export default Ember.Route.extend({
var self = this;
controller.startTests().then(function() {
- if (model.get("hiveserverTest") && model.get("hdfsTest") && model.get("atsTest")) {
- Ember.run.later(this, function() {
- self.send('transition');
- }, 2000);
- }
+ if (model.get("hiveserverTest") && model.get("hdfsTest") && model.get("atsTest") && model.get("userhomeTest")) {
+ Ember.run.later(this, function() {
+ self.send('transition');
+ }, 2000);
+ }
});
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/splash.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/splash.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/splash.hbs
index 84c7a71..5612542 100644
--- a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/splash.hbs
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/splash.hbs
@@ -18,7 +18,6 @@
<div class="spinner"></div>
<div class="container-fluid">
- <h1>Welcome to the Hive View</h1>
{{#if allTestsCompleted }}
<h3>Service checks completed.</h3>
{{else}}
@@ -49,7 +48,7 @@
<i class="fa fa-arrow-right"></i>
{{/if}}
</td>
- <td>hdfs service test</td>
+ <td>HDFS test</td>
</tr>
<tr>
<td>
@@ -63,7 +62,7 @@
<i class="fa fa-arrow-right"></i>
{{/if}}
</td>
- <td>hiveserver service test</td>
+ <td>HiveServer test</td>
</tr>
<tr>
<td>
@@ -77,8 +76,24 @@
<i class="fa fa-arrow-right"></i>
{{/if}}
</td>
- <td>ats service test</td>
+ <td>ATS test</td>
</tr>
+
+ <tr>
+ <td>
+ {{#if modeluserhomeTestDone}}
+ {{#if modeluserhomeTest}}
+ <i class="fa fa-check"></i>
+ {{else}}
+ <i class="fa fa-remove"></i>
+ {{/if}}
+ {{else}}
+ <i class="fa fa-arrow-right"></i>
+ {{/if}}
+ </td>
+ <td>User Home Directory test</td>
+ </tr>
+
</tbody>
</table>
{{#if errors}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/views/hive/pom.xml b/contrib/views/hive/pom.xml
index 6c931ae..3a453bc 100644
--- a/contrib/views/hive/pom.xml
+++ b/contrib/views/hive/pom.xml
@@ -226,6 +226,11 @@
<artifactId>commons-csv</artifactId>
<version>1.1</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.ambari.contrib.views</groupId>
+ <artifactId>ambari-views-commons</artifactId>
+ <version>2.4.0.0.0</version>
+ </dependency>
</dependencies>
<properties>
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/HelpService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/HelpService.java b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/HelpService.java
index 3a7f823..f18a422 100644
--- a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/HelpService.java
+++ b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/HelpService.java
@@ -79,6 +79,18 @@ public class HelpService extends BaseService {
}
/**
+ * HomeDirectory Status
+ * @return status
+ */
+ @GET
+ @Path("/userhomeStatus")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response userhomeStatus (){
+ FileService.userhomeSmokeTest(context);
+ return getOKResponse();
+ }
+
+ /**
* ATS Status
* @return status
*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
index ab2b933..4e1d24f 100644
--- a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
+++ b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
@@ -45,6 +45,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
+import org.apache.ambari.view.commons.hdfs.UserService;
/**
* File access resource
@@ -235,6 +236,21 @@ public class FileService extends BaseService {
}
/**
+ * Checks connection to User HomeDirectory
+ * @param context View Context
+ */
+ public static void userhomeSmokeTest(ViewContext context) {
+ try {
+ UserService userservice = new UserService(context);
+ userservice.homeDir();
+ } catch (WebApplicationException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new ServiceFormattedException(ex.getMessage(), ex);
+ }
+ }
+
+ /**
* Wrapper object for json mapping
*/
public static class FileResourceRequest {
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/splash.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/splash.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/splash.js
index 5db93f7..6f495ed 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/splash.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/splash.js
@@ -60,12 +60,11 @@ export default Ember.Controller.extend({
}
model.set(name + 'TestDone', true);
-
var percent = model.get('percent');
- model.set('percent', percent + 33.33);
+ model.set('percent', percent + 25);
};
- var promises = ['hdfs', 'hiveserver', 'ats'].map(function(name) {
+ var promises = ['hdfs', 'hiveserver', 'ats', 'userhome'].map(function(name) {
var finalurl = ((name == 'hiveserver') ? self.get('databaseService.baseUrl') : (url + name + 'Status')) || '' ;
@@ -88,13 +87,17 @@ export default Ember.Controller.extend({
}.property("model.percent"),
allTestsCompleted: function(){
- return this.get('modelhdfsTestDone') && this.get('modelhiveserverTestDone') && this.get('modelatsTestDone');
- }.property('modelhdfsTestDone', 'modelhiveserverTestDone', 'modelatsTestDone'),
+ return this.get('modelhdfsTestDone') && this.get('modelhiveserverTestDone') && this.get('modelatsTestDone') && this.get('modeluserhomeTestDone');
+ }.property('modelhdfsTestDone', 'modelhiveserverTestDone', 'modelatsTestDone', 'modeluserhomeTestDone'),
modelhdfsTestDone: function() {
return this.get('model.hdfsTestDone');
}.property('model.hdfsTestDone' ),
+ modeluserhomeTestDone: function() {
+ return this.get('model.userhomeTestDone');
+ }.property('model.userhomeTestDone' ),
+
modelhiveserverTestDone: function() {
return this.get('model.hiveserverTestDone');
}.property('model.hiveserverTestDone' ),
@@ -107,6 +110,10 @@ export default Ember.Controller.extend({
return this.get('model.hdfsTest');
}.property('model.hdfsTest' ),
+ modeluserhomeTest: function() {
+ return this.get('model.userhomeTest');
+ }.property('model.userhomeTest' ),
+
modelhiveserverTest: function() {
return this.get('model.hiveserverTest');
}.property('model.hiveserverTest' ),
@@ -122,5 +129,3 @@ export default Ember.Controller.extend({
}
}
});
-
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/splash.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/splash.js b/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/splash.js
index 05bcbcf..463a1c6 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/splash.js
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/routes/splash.js
@@ -28,6 +28,8 @@ export default Ember.Route.extend({
hiveserverTestDone: null,
atsTest: null,
atsTestDone: null,
+ userhomeTest: null,
+ userhomeTestDone: null,
percent: 0
});
},
@@ -42,7 +44,7 @@ export default Ember.Route.extend({
var self = this;
controller.startTests().then(function() {
- if (model.get("hiveserverTest") && model.get("hdfsTest") && model.get("atsTest")) {
+ if (model.get("hiveserverTest") && model.get("hdfsTest") && model.get("atsTest") && model.get("userhomeTest")) {
Ember.run.later(this, function() {
self.send('transition');
}, 2000);
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/splash.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/splash.hbs b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/splash.hbs
index 84c7a71..5612542 100644
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/splash.hbs
+++ b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/splash.hbs
@@ -18,7 +18,6 @@
<div class="spinner"></div>
<div class="container-fluid">
- <h1>Welcome to the Hive View</h1>
{{#if allTestsCompleted }}
<h3>Service checks completed.</h3>
{{else}}
@@ -49,7 +48,7 @@
<i class="fa fa-arrow-right"></i>
{{/if}}
</td>
- <td>hdfs service test</td>
+ <td>HDFS test</td>
</tr>
<tr>
<td>
@@ -63,7 +62,7 @@
<i class="fa fa-arrow-right"></i>
{{/if}}
</td>
- <td>hiveserver service test</td>
+ <td>HiveServer test</td>
</tr>
<tr>
<td>
@@ -77,8 +76,24 @@
<i class="fa fa-arrow-right"></i>
{{/if}}
</td>
- <td>ats service test</td>
+ <td>ATS test</td>
</tr>
+
+ <tr>
+ <td>
+ {{#if modeluserhomeTestDone}}
+ {{#if modeluserhomeTest}}
+ <i class="fa fa-check"></i>
+ {{else}}
+ <i class="fa fa-remove"></i>
+ {{/if}}
+ {{else}}
+ <i class="fa fa-arrow-right"></i>
+ {{/if}}
+ </td>
+ <td>User Home Directory test</td>
+ </tr>
+
</tbody>
</table>
{{#if errors}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/pig/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/views/pig/pom.xml b/contrib/views/pig/pom.xml
index ae87f84..4082cc0 100644
--- a/contrib/views/pig/pom.xml
+++ b/contrib/views/pig/pom.xml
@@ -140,6 +140,11 @@
<artifactId>ambari-views-utils</artifactId>
<version>2.4.0.0.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.ambari.contrib.views</groupId>
+ <artifactId>ambari-views-commons</artifactId>
+ <version>2.4.0.0.0</version>
+ </dependency>
</dependencies>
<properties>
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
index 40bc9a7..4791103 100644
--- a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
+++ b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/resources/files/FileService.java
@@ -25,6 +25,7 @@ import org.apache.ambari.view.pig.services.BaseService;
import org.apache.ambari.view.pig.utils.*;
import org.apache.ambari.view.utils.hdfs.HdfsApi;
import org.apache.ambari.view.utils.hdfs.HdfsUtil;
+import org.apache.ambari.view.commons.hdfs.UserService;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileAlreadyExistsException;
import org.apache.hadoop.fs.FileStatus;
@@ -40,6 +41,7 @@ import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
+
/**
* File access resource
* API:
@@ -196,6 +198,22 @@ public class FileService extends BaseService {
}
}
+
+ /**
+ * Checks connection to User HomeDirectory
+ * @param context View Context
+ */
+ public static void userhomeSmokeTest(ViewContext context) {
+ try {
+ UserService userservice = new UserService(context);
+ userservice.homeDir();
+ } catch (WebApplicationException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new ServiceFormattedException(ex.getMessage(), ex);
+ }
+ }
+
/**
* Wrapper object for json mapping
*/
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/services/HelpService.java
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/services/HelpService.java b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/services/HelpService.java
index eb363a0..a67bfc5 100644
--- a/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/services/HelpService.java
+++ b/contrib/views/pig/src/main/java/org/apache/ambari/view/pig/services/HelpService.java
@@ -92,6 +92,20 @@ public class HelpService extends BaseService {
return getOKResponse();
}
+
+ /**
+ * HomeDirectory Status
+ * @return status
+ */
+ @GET
+ @Path("/userhomeStatus")
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response userhomeStatus (){
+ FileService.userhomeSmokeTest(context);
+ return getOKResponse();
+ }
+
+
/**
* WebHCat Status
* @return status
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/splash.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/splash.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/splash.js
index f58d437..d1b571d 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/splash.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/controllers/splash.js
@@ -57,9 +57,9 @@ App.SplashController = Ember.ObjectController.extend({
}
model.set(name + 'TestDone', true);
var percent = model.get('percent');
- model.set('percent', percent + 33.33);
+ model.set('percent', percent + 25);
};
- var promises = ['storage', 'webhcat', 'hdfs'].map(function(name) {
+ var promises = ['storage', 'webhcat', 'hdfs', 'userhome'].map(function(name) {
return Ember.$.getJSON('/' + url + name + 'Status')
.then(
function(data) {
@@ -78,7 +78,7 @@ App.SplashController = Ember.ObjectController.extend({
}.property("model.percent"),
allTestsCompleted: function(){
- return this.get("model").get("hdfsTestDone") && this.get("model").get("webhcatTestDone") && this.get("model").get("storageTestDone");
- }.property('model.hdfsTestDone', 'model.webhcatTestDone', 'model.storageTestDone')
+ return this.get("model").get("hdfsTestDone") && this.get("model").get("webhcatTestDone") && this.get("model").get("storageTestDone") && this.get("model").get("userhomeTestDone");
+ }.property('model.hdfsTestDone', 'model.webhcatTestDone', 'model.storageTestDone', 'model.userhomeTestDone')
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/splash.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/splash.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/splash.js
index 1d848e3..b30552d 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/splash.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/routes/splash.js
@@ -27,6 +27,8 @@ App.SplashRoute = Em.Route.extend({
webhcatTestDone: null,
hdfsTest: null,
hdfsTestDone: null,
+ userhomeTest: null,
+ userhomeTestDone: null,
percent: 0
});
},
@@ -37,7 +39,7 @@ App.SplashRoute = Em.Route.extend({
controller.set('model', model);
var self = this;
controller.startTests(model).then(function() {
- if (model.get("storageTest") && model.get("webhcatTest") && model.get("hdfsTest")) {
+ if (model.get("storageTest") && model.get("webhcatTest") && model.get("hdfsTest") && model.get("userhomeTest")) {
Ember.run.later(this, function() {
previousTransition = App.get('previousTransition');
if (previousTransition) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/splash.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/splash.hbs b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/splash.hbs
index d635a91..c97d724 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/splash.hbs
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/templates/splash.hbs
@@ -17,8 +17,6 @@
}}
<div class="container-fluid">
- <h1>{{t 'splash.welcome'}}</h1>
-
{{#if allTestsCompleted }}
<h3>Service checks completed.</h3>
{{else}}
@@ -82,6 +80,21 @@
<td>{{t 'splash.webhcat_test'}}</td>
</tr>
+ <tr>
+ <td>
+ {{#if userhomeTestDone}}
+ {{#if userhomeTest}}
+ <span class="glyphicon glyphicon-ok green"></span>
+ {{else}}
+ <span class="glyphicon glyphicon-remove red"></span>
+ {{/if}}
+ {{else}}
+ <span class="glyphicon glyphicon-arrow-right"></span>
+ {{/if}}
+ </td>
+ <td>{{t 'splash.userhome_test'}}</td>
+ </tr>
+
</tbody>
</table>
http://git-wip-us.apache.org/repos/asf/ambari/blob/de5fd97f/contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js
----------------------------------------------------------------------
diff --git a/contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js b/contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js
index 072b5c7..151c88c 100644
--- a/contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js
+++ b/contrib/views/pig/src/main/resources/ui/pig-web/app/translations.js
@@ -173,6 +173,7 @@ Ember.I18n.translations = {
'please_wait':'Testing connection to services...please wait.',
'storage_test':'Storage test',
'hdfs_test':'HDFS test',
- 'webhcat_test':'WebHCat test'
+ 'webhcat_test':'WebHCat test',
+ 'userhome_test':'User Home Directory test'
}
};