private int append(FileSystem fs,Configuration conf,Path src,PrintWriter writer,int currentRecordNumber) throws IOException {
  BufferedReader reader=new BufferedReader(new InputStreamReader(fs.open(src)));
  try {
    String line=reader.readLine();
    while (line != null) {
      if (line.startsWith("Recno:: ")) {
        line="Recno:: " + currentRecordNumber++;
      }
      writer.println(line);
      line=reader.readLine();
    }
    return currentRecordNumber;
  }
  finally {
    reader.close();
  }
}

private int append ( FileSystem fs , Configuration conf , Path src , PrintWriter writer , int currentRecordNumber ) throws IOException { BufferedReader reader = new BufferedReader ( new InputStreamReader ( fs . open ( src ) ) ) ; try { String line = reader . readLine ( ) ; while ( line != null ) { if ( line . startsWith ( "Recno:: " ) ) { line = "Recno:: " + currentRecordNumber ++ ; } writer . println ( line ) ; line = reader . readLine ( ) ; } return currentRecordNumber ; } finally { reader . close ( ) ; } }
appends two files and updates the recno counter
