Project

General

Profile

« Previous | Next » 

Revision 47960

[maven-release-plugin] copy for tag dnet-mapreduce-submitter-3.0.1

View differences:

modules/dnet-mapreduce-submitter/tags/dnet-mapreduce-submitter-3.0.1/deploy.info
1
{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-mapreduce-submitter/trunk/", "deploy_repository": "dnet45-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet45-snapshots", "name": "dnet-mapreduce-submitter"}
modules/dnet-mapreduce-submitter/tags/dnet-mapreduce-submitter-3.0.1/src/main/java/eu/dnetlib/data/mapreduce/JobClientFactory.java
1
package eu.dnetlib.data.mapreduce;
2

  
3
import java.io.IOException;
4

  
5
import org.apache.hadoop.mapred.JobClient;
6
import org.springframework.beans.factory.annotation.Autowired;
7
import org.springframework.context.annotation.Lazy;
8

  
9
import eu.dnetlib.data.hadoop.config.ClusterName;
10
import eu.dnetlib.data.hadoop.config.ConfigurationEnumerator;
11

  
12
/**
13
 * Factory bean for jobClient instances
14
 *
15
 * @author claudio
16
 *
17
 */
18
public class JobClientFactory {
19

  
20
	@Lazy
21
	@Autowired
22
	private ConfigurationEnumerator configurationEnumerator;
23

  
24
	public JobClient newInstance(final String name) throws IOException {
25
		return new JobClient(configurationEnumerator.get(ClusterName.valueOf(name)));
26
	}
27

  
28
}
modules/dnet-mapreduce-submitter/tags/dnet-mapreduce-submitter-3.0.1/src/main/java/eu/dnetlib/data/mapreduce/HadoopJob.java
1
package eu.dnetlib.data.mapreduce;
2

  
3
import java.util.Properties;
4

  
5
import org.apache.hadoop.mapreduce.Job;
6

  
7
import eu.dnetlib.data.hadoop.config.ClusterName;
8

  
9
/**
10
 * Interface for DNet mapreduce jobs
11
 * 
12
 * @author claudio
13
 * 
14
 */
15
public interface HadoopJob {
16

  
17
	/**
18
	 * @return job name
19
	 */
20
	public String getName();
21

  
22
	/**
23
	 * Sets the job params
24
	 * 
25
	 * @param p
26
	 *            job properties
27
	 * @return the job instance
28
	 */
29
	public Job setJobDetails(ClusterName clusterName, Properties p);
30

  
31
}
modules/dnet-mapreduce-submitter/tags/dnet-mapreduce-submitter-3.0.1/src/main/java/eu/dnetlib/data/mapreduce/HadoopJobEnumerator.java
1
package eu.dnetlib.data.mapreduce;
2

  
3
import java.util.Map;
4

  
5
import org.apache.commons.logging.Log;
6
import org.apache.commons.logging.LogFactory;
7
import org.springframework.beans.BeansException;
8
import org.springframework.beans.factory.BeanFactory;
9
import org.springframework.beans.factory.BeanFactoryAware;
10
import org.springframework.beans.factory.ListableBeanFactory;
11
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
12

  
13
public class HadoopJobEnumerator implements BeanFactoryAware {
14

  
15
	private static final Log log = LogFactory.getLog(HadoopJobEnumerator.class); // NOPMD by marko on 11/24/08 5:02 PM
16

  
17
	/**
18
	 * bean factory.
19
	 */
20
	private ListableBeanFactory beanFactory;
21

  
22
	/**
23
	 * Get all beans implementing the ConfiguredJob interface.
24
	 * 
25
	 * @return
26
	 */
27
	@SuppressWarnings("unchecked")
28
	public Map<String, HadoopJob> getAll() {
29
		return beanFactory.getBeansOfType(HadoopJob.class);
30
	}
31

  
32
	@Override
33
	public void setBeanFactory(final BeanFactory beanFactory) throws BeansException {
34
		this.beanFactory = (ListableBeanFactory) beanFactory;
35
	}
36

  
37
	public ListableBeanFactory getBeanFactory() {
38
		return beanFactory;
39
	}
40

  
41
	/**
42
	 * Get given enableable or null.
43
	 * 
44
	 * @param name
45
	 * @return
46
	 */
47
	public HadoopJob get(final String name) {
48
		try {
49
			return (HadoopJob) beanFactory.getBean(name, HadoopJob.class);
50
		} catch (final NoSuchBeanDefinitionException e) {
51
			log.error("undefined bean: " + name, e);
52
			return null;
53
		}
54
	}
55
}
modules/dnet-mapreduce-submitter/tags/dnet-mapreduce-submitter-3.0.1/src/main/resources/eu/dnetlib/data/mapreduce/applicationContext-mapreduce-sumbitter.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<beans xmlns="http://www.springframework.org/schema/beans"
3
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
4
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
5

  
6
	<bean id="hadoopJobEnumerator" class="eu.dnetlib.data.mapreduce.HadoopJobEnumerator" />
7

  
8
	<bean id="jobClientFactory" class="eu.dnetlib.data.mapreduce.JobClientFactory" />
9

  
10
</beans>
modules/dnet-mapreduce-submitter/tags/dnet-mapreduce-submitter-3.0.1/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<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">
3
	<parent>
4
		<groupId>eu.dnetlib</groupId>
5
		<artifactId>dnet45-parent</artifactId>
6
		<version>1.0.0</version>
7
		<relativePath />
8
	</parent>
9
	<modelVersion>4.0.0</modelVersion>
10
	<groupId>eu.dnetlib</groupId>
11
	<artifactId>dnet-mapreduce-submitter</artifactId>
12
	<packaging>jar</packaging>
13
	<version>3.0.1</version>
14
	<scm>
15
	    <developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-mapreduce-submitter/tags/dnet-mapreduce-submitter-3.0.1</developerConnection>
16
    </scm>
17
	<dependencies>
18
		<dependency>
19
			<groupId>eu.dnetlib</groupId>
20
			<artifactId>dnet-hadoop-commons</artifactId>
21
			<version>[2.0.0,3.0.0)</version>
22
		</dependency>
23
		<dependency>
24
			<groupId>org.springframework</groupId>
25
			<artifactId>spring-context-support</artifactId>
26
			<version>${spring.version}</version>
27
		</dependency>
28
	</dependencies>
29
</project>

Also available in: Unified diff