Repository: ambari
Updated Branches:
  refs/heads/trunk fd75adfad -> 0c7dd9383


BUG-74324 rebalance hdfs custom command supports individual timeout - draft


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

Branch: refs/heads/trunk
Commit: 0c7dd9383038b53cfe65c21b885fd6e901834821
Parents: fd75adf
Author: lpuskas <laszlo.pus...@sequenceiq.com>
Authored: Wed Feb 22 15:36:08 2017 +0100
Committer: lpuskas <lpus...@apache.org>
Committed: Mon Mar 20 17:15:59 2017 +0100

----------------------------------------------------------------------
 ambari-server/pom.xml                           | 22 ++++++++++++++++++++
 .../AmbariCustomCommandExecutionHelper.java     | 11 +++++++++-
 .../common-services/HDFS/2.1.0.2.0/metainfo.xml |  1 +
 3 files changed, 33 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0c7dd938/ambari-server/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 8b4c8d6..cb687e0 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -50,9 +50,31 @@
     <el.log>ALL</el.log> <!-- log level for EclipseLink 
eclipselink-staticweave-maven-plugin -->
     <xlint>none</xlint> <!-- passed to Java compiler -Xlint: flag -->
   </properties>
+  <reporting>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jxr-plugin</artifactId>
+        <version>2.5</version>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <version>3.7</version>
+        <configuration>
+        <linkXref>true</linkXref>
+        </configuration>
+      </plugin>
+    </plugins>
+  </reporting>
   <build>
     <plugins>
       <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-pmd-plugin</artifactId>
+        <version>3.7</version>
+      </plugin>
+      <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>
         <version>1.8</version>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c7dd938/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
index 77d5bf8..db18394 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java
@@ -448,7 +448,16 @@ public class AmbariCustomCommandExecutionHelper {
 
       if 
(serviceInfo.getSchemaVersion().equals(AmbariMetaInfo.SCHEMA_VERSION_2)) {
         // Service check command is not custom command
-        CommandScriptDefinition script = componentInfo.getCommandScript();
+        CommandScriptDefinition script = null;
+
+        if (customCommandDefinition != null) {
+          LOG.debug("Getting command script for custom command {}", 
customCommandDefinition.getName());
+          script = customCommandDefinition.getCommandScript();
+        } else {
+          LOG.debug("Getting command script for component {}", 
componentInfo.getDisplayName());
+          // Service check command is not custom command
+          script = componentInfo.getCommandScript();
+        }
 
         if (script != null) {
           commandParams.put(SCRIPT, script.getScript());

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c7dd938/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
index 3026938..d9b542f 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
+++ 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/metainfo.xml
@@ -102,6 +102,7 @@
               <commandScript>
                 <script>scripts/namenode.py</script>
                 <scriptType>PYTHON</scriptType>
+                <timeout>1</timeout>
               </commandScript>
             </customCommand>
           </customCommands>

Reply via email to