@Override public void readFields(DataInput dataInput) throws IOException { boolean notNull = dataInput.readBoolean(); if (notNull) { partVal = new Text(); partVal.readFields(dataInput); } notNull = dataInput.readBoolean(); if (notNull) { recId = new RecordIdentifier(); recId.readFields(dataInput); } } @Override
@Override public void readFields(DataInput dataInput) throws IOException { data = new Text(); data.readFields(dataInput); boolean notNull = dataInput.readBoolean(); if (notNull) { partVal = new Text(); partVal.readFields(dataInput); } notNull = dataInput.readBoolean(); if (notNull) { recId = new RecordIdentifier(); recId.readFields(dataInput); } }
@Override public boolean next(RecordIdentifier identifier, Text text) throws IOException { if (is == null) { // Open the next file if (filesToRead.empty()) return false; Path p = filesToRead.pop(); LOG.debug("Reading records from " + p.toString()); is = fs.open(p); } String line = null; try { identifier.readFields(is); line = is.readLine(); } catch (EOFException e) { } if (line == null) { // Set our current entry to null (since it's done) and try again. is = null; return next(identifier, text); } text.set(line); return true; }
@Override public void readFields(DataInput dataInput) throws IOException { super.readFields(dataInput); try { rowKeyMap = PrimaryKeyData.deserialize((InputStream) dataInput); } catch (ClassNotFoundException e) { throw new RuntimeException(e); } } }