In hadoop - Map-Reduce error with filesplit -
When I use the bottom row in the map class:
string filename = ( (FileScript) Context.getInputSplit ()). GetPath () GetName (); Println (file name);
I got an empty output file. In addition, the console has the last two lines:
14/05/06 12:52:53 INFO mapred .JobClient: map output record = 0 14/05/06 12:52:53 information mapred.JobClient: SPLIT_RAW_BYTES = 2127
The problem is with the system .out.println ()
, you will not get the result in the console. You must check your logs
or very simple: use a logger!
-
Required import class for logging
import org.apache.commons logging.Log; Import org.apache.commons.logging.LogFactory;
-
Define logger
Private Static Last Log LOG = LogFactory.getLog (MyClass.class);
-
Log in to whatever you need
LOG.info (fileName);
You will get results during the job execution in the console.
Comments
Post a Comment