[rhq] Branch 'feature/hadoop-plugin' - 2 commits - modules/enterprise modules/plugins

lkrejci lkrejci at fedoraproject.org
Thu Aug 9 10:16:56 UTC 2012


 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryConfigurationStep.java |    6 
 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java      |    5 
 modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopOperationsDelegate.java                                                           |    7 
 modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServerComponent.java                                                              |    2 
 modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopSupportedOperations.java                                                          |   32 ++-
 modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobJarComponent.java                                                                    |   87 ++++++++++
 modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobJarDiscoveryComponent.java                                                           |   63 +++++++
 modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobTrackerServerComponent.java                                                          |   80 +++++++++
 modules/plugins/hadoop/src/main/resources/META-INF/rhq-plugin.xml                                                                                   |   27 ++-
 9 files changed, 285 insertions(+), 24 deletions(-)

New commits:
commit e77ecb554662b89a0710584c45765ca6c178a941
Author: Lukas Krejci <lkrejci at redhat.com>
Date:   Thu Aug 9 12:16:18 2012 +0200

    Fixing the child resource creation for resource types that do not have resource configuration.

diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryConfigurationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryConfigurationStep.java
index 538aa7f..bb48f39 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryConfigurationStep.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryConfigurationStep.java
@@ -127,13 +127,13 @@ public class ResourceFactoryConfigurationStep extends AbstractWizardStep impleme
 
     @Override
     public boolean isNextButtonEnabled() {
-        return (editor != null) && editor.isValid();
+        return (editor == null) || editor.isValid();
     }
 
     public boolean nextPage() {
         // Finish.
-        if ((editor != null) && editor.isValid()) {
-            wizard.setNewResourceConfiguration(editor.getConfiguration());
+        if ((editor == null) || editor.isValid()) {
+            wizard.setNewResourceConfiguration(editor == null ? new Configuration() : editor.getConfiguration());
             wizard.setNewResourceCreateTimeout(timeoutItem.getValueAsInteger());
             wizard.execute();
             return true;
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java
index 6477ad6..1482fd8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ResourceFactoryCreateWizard.java
@@ -62,7 +62,10 @@ public class ResourceFactoryCreateWizard extends AbstractResourceFactoryWizard {
 
             ConfigurationDefinition deployTimeConfigDef = packageType.getDeploymentConfigurationDefinition();
             this.setNewResourceConfigurationDefinition(deployTimeConfigDef);
-            Map<String, ConfigurationTemplate> templates = deployTimeConfigDef.getTemplates();
+            Map<String, ConfigurationTemplate> templates = Collections.emptyMap();
+            if (deployTimeConfigDef != null) {
+                templates = deployTimeConfigDef.getTemplates();
+            }
 
             steps.add(new ResourceFactoryInfoStep(ResourceFactoryCreateWizard.this, null, MSG
                 .widget_resourceFactoryWizard_versionPrompt(), archPrompt, MSG


commit c3805ce074f24693a61139bf310ac01555e6260a
Author: Lukas Krejci <lkrejci at redhat.com>
Date:   Thu Aug 9 12:15:09 2012 +0200

    Support for Job Jars as creatable resources. Job Jars can be submitted (using an operation) to the job tracker, providing a convenient way of running hadoop jobs.

diff --git a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopOperationsDelegate.java b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopOperationsDelegate.java
index 922f11a..1c26602 100644
--- a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopOperationsDelegate.java
+++ b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopOperationsDelegate.java
@@ -84,6 +84,9 @@ public class HadoopOperationsDelegate {
         case KILL:
             results = invokeGeneralOperation(operation, parameters, null);
             break;
+        case JAR:
+            results = invokeGeneralOperation(operation, parameters, null);
+            break;
         default:
             throw new UnsupportedOperationException(operation.toString());
         }
@@ -168,7 +171,7 @@ public class HadoopOperationsDelegate {
 
         ProcessExecution processExecution = new ProcessExecution(executable);
         if (args != null) {
-            processExecution.setArguments(args.split(" "));
+            processExecution.setArguments(args.split("[ \\t\\n]+"));
         }
         processExecution.setWaitForCompletion(wait);
         processExecution.setCaptureOutput(captureOutput);
@@ -209,7 +212,7 @@ public class HadoopOperationsDelegate {
         }
 
         ProcessExecutionResults results = executeExecutable(resourceContext.getSystemInformation(), executable, args,
-            MAX_WAIT, true, true);
+            MAX_WAIT, true, operation.isKillOnTimeout());
         return results;
     }
 }
diff --git a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServerComponent.java b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServerComponent.java
index 8b4a73b..c3a590c 100644
--- a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServerComponent.java
+++ b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopServerComponent.java
@@ -246,7 +246,7 @@ public class HadoopServerComponent extends JMXServerComponent<ResourceComponent<
         return className.toLowerCase();
     }
     
-    private File getHomeDir() {
+    protected File getHomeDir() {
         File homeDir =
             new File(getResourceContext().getPluginConfiguration().getSimpleValue(HadoopServerDiscovery.HOME_DIR_PROPERTY));
 
diff --git a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopSupportedOperations.java b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopSupportedOperations.java
index 12e6b5e..c088be3 100644
--- a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopSupportedOperations.java
+++ b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/HadoopSupportedOperations.java
@@ -24,24 +24,28 @@ package org.rhq.plugins.hadoop;
  * @author Jirka Kremser
  */
 public enum HadoopSupportedOperations {
-    FORMAT("/bin/hadoop", "namenode -format"),
-    FSCK("/bin/hadoop", "fsck /"),
-    LS("/bin/hadoop", "fs -ls"),
-    START("/bin/hadoop-daemon.sh", "start "),
-    STOP("/bin/hadoop-daemon.sh", "stop "),
-    QUEUE_LIST("/bin/hadoop", "queue -list"),
-    JOB_LIST_RUNNING("/bin/hadoop", "job -list"),
-    JOB_LIST_ALL("/bin/hadoop", "job -list all"),
-    REBALANCE_DFS("/bin/hadoop", "balancer"),
-    KILL("/bin/hadoop", "job -kill", "pid");
+    FORMAT(true, "/bin/hadoop", "namenode -format"),
+    FSCK(true, "/bin/hadoop", "fsck /"),
+    LS(true, "/bin/hadoop", "fs -ls"),
+    START(true, "/bin/hadoop-daemon.sh", "start "),
+    STOP(true, "/bin/hadoop-daemon.sh", "stop "),
+    QUEUE_LIST(true, "/bin/hadoop", "queue -list"),
+    JOB_LIST_RUNNING(true, "/bin/hadoop", "job -list"),
+    JOB_LIST_ALL(true, "/bin/hadoop", "job -list all"),
+    REBALANCE_DFS(true, "/bin/hadoop", "balancer"),
+    KILL(true, "/bin/hadoop", "job -kill", "pid"),
+    JAR(false, "/bin/hadoop", "jar",  "args");
 
     private final String relativePathToExecutable;
 
     private final String args;
     
     private final String[] paramNames;
-
-    private HadoopSupportedOperations(String relativePathToExecutable, String args, String... paramNames) {
+    
+    private final boolean killOnTimeout;
+    
+    private HadoopSupportedOperations(boolean killOnTimeout, String relativePathToExecutable, String args, String... paramNames) {
+        this.killOnTimeout = killOnTimeout;
         this.relativePathToExecutable = relativePathToExecutable;
         this.args = args;
         this.paramNames = paramNames;
@@ -58,4 +62,8 @@ public enum HadoopSupportedOperations {
     public String[] getParamsNames() {
         return paramNames;
     }
+    
+    public boolean isKillOnTimeout() {
+        return killOnTimeout;
+    }
 }
diff --git a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobJarComponent.java b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobJarComponent.java
new file mode 100644
index 0000000..82a6d76
--- /dev/null
+++ b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobJarComponent.java
@@ -0,0 +1,87 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2012 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.plugins.hadoop;
+
+import java.io.File;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+
+/**
+ * 
+ *
+ * @author Lukas Krejci
+ */
+public class JobJarComponent implements ResourceComponent<JobTrackerServerComponent>, OperationFacet, DeleteResourceFacet {
+
+    public static final String RESOURCE_TYPE_NAME = "Job Jar";
+    public static final String CONTENT_TYPE_NAME = "jobJar";
+    public static final String JOB_JAR_PROP_NAME = "jobJar";
+    
+    private static final String SUBMIT_OP = "submit";
+    
+    private File jobJar;
+    private ResourceContext<JobTrackerServerComponent> context;
+    private HadoopOperationsDelegate operationsDelegate;
+    
+    @Override
+    public AvailabilityType getAvailability() {
+        return jobJar.exists() ? AvailabilityType.UP : AvailabilityType.DOWN;
+    }
+
+    @Override
+    public void start(ResourceContext<JobTrackerServerComponent> context) throws InvalidPluginConfigurationException,
+        Exception {
+        
+        jobJar = new File(context.getResourceKey());
+        this.context = context;
+        operationsDelegate = new HadoopOperationsDelegate(context.getParentResourceComponent().getResourceContext());
+    }
+
+    @Override
+    public void stop() {
+    }
+
+    @Override
+    public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException,
+        Exception {
+
+        if (SUBMIT_OP.equals(name)) {
+            String args = parameters.getSimpleValue("args", "");
+            args = context.getResourceKey() + " " + args;
+            parameters.put(new PropertySimple("args", args));
+            return operationsDelegate.invoke(HadoopSupportedOperations.JAR, parameters, null);
+        }
+        
+        return null;
+    }
+
+    @Override
+    public void deleteResource() throws Exception {
+        jobJar.delete();
+    }
+}
diff --git a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobJarDiscoveryComponent.java b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobJarDiscoveryComponent.java
new file mode 100644
index 0000000..1ccac68
--- /dev/null
+++ b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobJarDiscoveryComponent.java
@@ -0,0 +1,63 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2012 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+package org.rhq.plugins.hadoop;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+/**
+ * 
+ *
+ * @author Lukas Krejci
+ */
+public class JobJarDiscoveryComponent implements ResourceDiscoveryComponent<JobTrackerServerComponent> {
+
+    @Override
+    public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<JobTrackerServerComponent> context)
+        throws InvalidPluginConfigurationException, Exception {
+        
+        File dataDir = context.getParentResourceComponent().getJobJarDataDir();
+        
+        File[] jars = dataDir.listFiles(new FilenameFilter() {
+            
+            @Override
+            public boolean accept(File dir, String name) {
+                return name.endsWith(".jar");
+            }
+        });
+        
+        Set<DiscoveredResourceDetails> ret = new HashSet<DiscoveredResourceDetails>();
+        
+        for(File jar : jars) {
+            DiscoveredResourceDetails details = new DiscoveredResourceDetails(context.getResourceType(), jar.getAbsolutePath(), jar.getName(), null, null, context.getDefaultPluginConfiguration(), null);
+            ret.add(details);
+        }
+        
+        return ret;
+    }
+
+}
diff --git a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobTrackerServerComponent.java b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobTrackerServerComponent.java
index 8368cbf..c171175 100644
--- a/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobTrackerServerComponent.java
+++ b/modules/plugins/hadoop/src/main/java/org/rhq/plugins/hadoop/JobTrackerServerComponent.java
@@ -20,20 +20,29 @@
 package org.rhq.plugins.hadoop;
 
 import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
+import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
 import org.rhq.core.domain.measurement.DataType;
 import org.rhq.core.domain.measurement.MeasurementDefinition;
 import org.rhq.core.domain.measurement.MeasurementReport;
 import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
 import org.rhq.core.domain.measurement.calltime.CallTimeData;
+import org.rhq.core.domain.resource.CreateResourceStatus;
+import org.rhq.core.pluginapi.content.ContentContext;
+import org.rhq.core.pluginapi.content.ContentServices;
 import org.rhq.core.pluginapi.event.EventContext;
 import org.rhq.core.pluginapi.event.EventPoller;
 import org.rhq.core.pluginapi.event.log.LogFileEventPoller;
+import org.rhq.core.pluginapi.inventory.CreateChildResourceFacet;
+import org.rhq.core.pluginapi.inventory.CreateResourceReport;
 import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
 import org.rhq.core.pluginapi.inventory.ResourceContext;
 import org.rhq.plugins.hadoop.calltime.HadoopEventAndCalltimeDelegate;
@@ -44,13 +53,16 @@ import org.rhq.plugins.hadoop.calltime.JobSummary;
  *
  * @author Lukas Krejci
  */
-public class JobTrackerServerComponent extends HadoopServerComponent {
+public class JobTrackerServerComponent extends HadoopServerComponent implements CreateChildResourceFacet {
 
     private static final String SYNTHETIC_METRICS_PREFIX = "_synthetic_";
     private static final String JOB_DURATION_METRIC_NAME = "_synthetic_jobDuration";
     private static final String JOB_PRE_START_DELAY_METRIC_NAME = "_synthetic_jobPreStartDelay";
     private static final String JOB_SUCCESS_RATE_METRIC_NAME = "_synthetic_jobSuccessRate";
 
+    private static final String DEFAULT_JOB_STORAGE_NAME = "__dataDir";    
+    private static final String JOB_STORAGE_PROP_NAME = "jobStorage";
+    
     private Map<String, Map<String, Set<JobSummary>>> unprocessedCalltimeMeasurements = new HashMap<String, Map<String,Set<JobSummary>>>();
 
     private HadoopEventAndCalltimeDelegate logProcessor;
@@ -76,6 +88,72 @@ public class JobTrackerServerComponent extends HadoopServerComponent {
         super.stop();
     }
 
+    public File getJobJarDataDir() {
+        String dataDirName = getResourceContext().getPluginConfiguration().getSimpleValue(JOB_STORAGE_PROP_NAME, DEFAULT_JOB_STORAGE_NAME);
+        
+        File dataDir = null;
+        
+        if (DEFAULT_JOB_STORAGE_NAME.equals(dataDirName)) {
+            dataDir = new File(getResourceContext().getDataDirectory(), "jobJars");
+            dataDir.mkdirs();
+        } else {            
+            dataDir = new File(dataDirName);
+            if (!dataDir.isAbsolute()) {
+                File hadoopHome = getHomeDir();
+                
+                dataDir = new File(hadoopHome, dataDirName);
+            }
+        }
+        
+        return dataDir;
+    }
+    
+    @Override
+    public CreateResourceReport createResource(CreateResourceReport report) {
+        if (!JobJarComponent.CONTENT_TYPE_NAME.equals(report.getPackageDetails().getKey().getPackageTypeName())) {
+            report.setStatus(CreateResourceStatus.FAILURE);
+            report.setErrorMessage("Unknown content type");
+            return report;
+        }
+        
+        File dataDir = getJobJarDataDir();
+        
+        ResourcePackageDetails packageDetails = report.getPackageDetails();
+        
+        File jobJar = new File(dataDir, packageDetails.getFileName());
+        
+        FileOutputStream jobJarStream = null;
+        try {
+            jobJarStream = new FileOutputStream(jobJar); 
+        } catch (FileNotFoundException e) {
+            report.setErrorMessage("Could not create the job jar file on the agent: " + e.getMessage());
+            return report;
+        }
+        
+        ContentContext contentContext = getResourceContext().getContentContext();
+        ContentServices contentServices = contentContext.getContentServices();
+        contentServices.downloadPackageBitsForChildResource(contentContext, JobJarComponent.RESOURCE_TYPE_NAME, packageDetails.getKey(), jobJarStream);
+        
+        try {
+            jobJarStream.close();
+        } catch (IOException e) {
+            //hmmm, do I care?
+        }
+        
+        report.setResourceKey(jobJar.getAbsolutePath());
+        report.setResourceName(jobJar.getName());
+        
+        report.setStatus(CreateResourceStatus.SUCCESS);
+        
+        return report;
+    }
+
+    @Override
+    public ResourceContext<?> getResourceContext() {
+        // TODO Auto-generated method stub
+        return super.getResourceContext();
+    }
+    
     @Override
     protected void handleMetric(MeasurementReport report, MeasurementScheduleRequest request) throws Exception {
         if (request.getName().startsWith(SYNTHETIC_METRICS_PREFIX)) {
diff --git a/modules/plugins/hadoop/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/hadoop/src/main/resources/META-INF/rhq-plugin.xml
index 4af9680..97e907c 100644
--- a/modules/plugins/hadoop/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/hadoop/src/main/resources/META-INF/rhq-plugin.xml
@@ -153,6 +153,12 @@
       <c:simple-property name="_mainClass" displayName="Main Class" readOnly="true"
         default="org.apache.hadoop.mapred.JobTracker"/>
       <c:simple-property name="logPollingInterval" default="60" description="The interval for log file polling in seconds."/>
+      <c:simple-property name="jobStorage" displayName="Job JAR File Storage Directory" default="__dataDir">
+        <c:description>Specifies where to look for and store the JAR files for Hadoop jobs. If the "RHQ Agent's Data Directory" is selected the JAR files are stored with the RHQ agent. If the provided path is relative, it is relative to the Hadoop's home directory. If the path is absolute, the JAR files are looked for at that exact location on the machine where the JobTracker runs.</c:description>
+        <c:property-options allowCustomValue="true">
+            <c:option value="__dataDir" name="RHQ Agent's Data Directory" />
+        </c:property-options>
+      </c:simple-property>
     </plugin-configuration>
 
     <process-scan name="JobTracker" query="process|basename|match=^java.*,arg|-Dproc_jobtracker|match=.*"/>
@@ -192,21 +198,21 @@
     </operation>
 
     <metric property="Hadoop:service=JobTracker,name=JobTrackerMetrics:jobs_completed" displayName="Jobs Completed"
-      displayType="summary"/>
+      displayType="summary" measurementType="trendsup"/>
     <metric property="Hadoop:service=JobTracker,name=JobTrackerMetrics:jobs_running" displayName="Jobs Running"
       displayType="summary"/>
     <metric property="Hadoop:service=JobTracker,name=JobTrackerMetrics:jobs_preparing" displayName="Jobs Preparing"
       displayType="summary"/>
     <metric property="Hadoop:service=JobTracker,name=JobTrackerMetrics:jobs_killed" displayName="Jobs Killed"
-      displayType="summary"/>
+      displayType="summary" measurementType="trendsup"/>
     <metric property="Hadoop:service=JobTracker,name=JobTrackerMetrics:jobs_failed" displayName="Jobs Failed"
-      displayType="summary"/>
+      displayType="summary" measurementType="trendsup"/>
     <metric property="Hadoop:service=JobTracker,name=JobTrackerMetrics:running_maps" displayName="Running Map Tasks"
       displayType="summary"/>
     <metric property="Hadoop:service=JobTracker,name=JobTrackerMetrics:running_reduces" displayName="Running Reduce Tasks"
       displayType="summary"/>
     <metric property="Hadoop:service=JobTracker,name=JobTrackerMetrics:jobs_submitted" displayName="Total Submissions"
-      displayType="summary"/>
+      displayType="summary" measurementType="trendsup"/>
     <metric property="Hadoop:service=JobTracker,name=JobTrackerMetrics:trackers" displayName="Nodes" displayType="summary"/>
     <metric property="Hadoop:service=JobTracker,name=JobTrackerMetrics:occupied_map_slots" displayName="Occupied Map Slots"
       displayType="summary"/>
@@ -238,6 +244,19 @@
         <c:simple-property name="conf/mapred-site.xml:mapred.tasktracker.reduce.tasks.maximum" displayName="Maximum Reduce Tasks" description="The maximum number of Reduce tasks, which are run simultaneously on a given TaskTracker, individually. Defaults to 2 (2 maps and 2 reduces), but vary it depending on your hardware." required="false"/>
         <c:simple-property name="conf/mapred-site.xml:mapred.queue.names" displayName="Job Queues" description="Comma separated list of queues to which jobs can be submitted. The MapReduce system always supports atleast one queue with the name as default. Hence, this parameter's value should always contain the string default. Some job schedulers supported in Hadoop, like the Capacity Scheduler, support multiple queues. If such a scheduler is being used, the list of configured queue names must be specified here. Once queues are defined, users can submit jobs to a queue using the property name mapred.job.queue.name in the job configuration. There could be a separate configuration file for configuring properties of these queues that is managed by the scheduler. Refer to the documentation of the scheduler for information on the same." required="false"/>
     </resource-configuration>
+    
+    <service name="Job Jar" discovery="JobJarDiscoveryComponent" class="JobJarComponent" createDeletePolicy="both" creationDataType="content">
+        <operation name="submit" timeout="3600" description="Submits a job defined in this jar to the JobTracker and waits for output. The default timeout is 1 hour but you can override that value when scheduling this operation. After the timeout, the job continues to run but no output is captured anymore.">
+            <parameters>
+                <c:simple-property name="args" required="false" description="The arguments given to the hadoop job"/>
+            </parameters>
+            <results>
+                <c:simple-property name="operationResult" />
+            </results>            
+        </operation>
+
+        <content name="jobJar" category="deployable" isCreationType="true" />
+    </service>
   </server>
 
   <!-- TaskTracker (http://wiki.apache.org/hadoop/TaskTracker) -->




More information about the rhq-commits mailing list