Project

General

Profile

1
package eu.dnetlib.data.hadoop.mapred;
2

    
3
import java.io.IOException;
4

    
5
import eu.dnetlib.data.hadoop.AbstractHadoopClient;
6
import eu.dnetlib.data.hadoop.config.ClusterName;
7
import eu.dnetlib.data.hadoop.rmi.HadoopServiceException;
8
import org.apache.hadoop.mapred.JobClient;
9

    
10
/**
11
 * Factory bean for jobClient instances
12
 *
13
 * @author claudio
14
 *
15
 */
16
public class JobClientFactory extends AbstractHadoopClient {
17

    
18
	public JobClient newInstance(final ClusterName clusterName, final String userName) throws IOException {
19
		setHadoopUser(userName);
20
		return new JobClient(configurationEnumerator.get(clusterName));
21
	}
22

    
23
	public JobClient newInstance(final ClusterName clusterName) throws IOException, HadoopServiceException {
24
		setHadoopUser();
25
		return new JobClient(configurationEnumerator.get(clusterName));
26
	}
27

    
28
}
(1-1/2)