Revision 49794
Added by Claudio Atzori over 6 years ago
modules/dnet-mapreduce-submitter/trunk/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/trunk/src/main/resources/eu/dnetlib/data/mapreduce/applicationContext-mapreduce-sumbitter.xml | ||
---|---|---|
5 | 5 |
|
6 | 6 |
<bean id="hadoopJobEnumerator" class="eu.dnetlib.data.mapreduce.HadoopJobEnumerator" /> |
7 | 7 |
|
8 |
<bean id="jobClientFactory" class="eu.dnetlib.data.mapreduce.JobClientFactory" /> |
|
9 |
|
|
10 | 8 |
</beans> |
Also available in: Unified diff
JobClientFactory moved in dnet-hadoop-service