public class XMLReader extends RecordReader<Text, Text> {
public static final String ELEMENT_NAME = "elementName";
private InputStream _fileIn;
private long _start;
private long _end;
private long _current;
private boolean _eof = false;
private boolean _firstOnly = false;
private KeyString[] _keyString;
private Text _key;
private StringBuilder _value;
private byte[][] _startTag;
private byte[][] _endTag;
private int [] _matchingStartTag;
private int [] _matchingEndTag;
private byte[] _buffer;
private int _bufferPos;
private int _bufferRead;
@Override
public void initialize(InputSplit inputSplit, TaskAttemptContext context) throws IOException, InterruptedException {
FileSplit split = (FileSplit) inputSplit;
Configuration configuration = context.getConfiguration();
String key = configuration.get(ELEMENT_NAME);
通过写文件打印输出发现,configuration.get 返回值为NULL configuration.get(ELEMENT_NAME) 这句代码是什么含义?ELEMENT_NAME = "elementName"; 这个字符串的具体含义是什么?在配置里需要配置吗? |