@Override
	public void initialize(InputSplit arg0, TaskAttemptContext arg1)
			throws IOException, InterruptedException {
		try {
			reader = new PartitionReader(new OptimusConfiguration(((TRANSInputSplit)arg0).getConfDir()));
		} catch (WrongArgumentException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			System.exit(-1);
		} catch (JDOMException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		split = (TRANSInputSplit) arg0;
		TransHostList list = split.getHosts();
		Vector<Host> h = list.getHosts();
		String hostname = InetAddress.getLocalHost().getHostName();
		Host use = null;
		for( int i = 0 ; i < h.size(); i++)
		{
			if( hostname.equals(h.get(i).getHost()))
			{
				use = h.get(i);
				break;
			}
		}
		if(use == null)
		{
			Random rand = new Random();
			use = h.get(rand.nextInt()%h.size());
		}
		dp = use.getDataProtocol();
	}