MRFramework/src/main/java/com/mr/net/Node.java
/**
	 * Writes data object  to file in corresponding folder 
	 * 
	 * @param folderS : folder to write files to 
	 * @param fileS : file name to write 
	 * @param data : data to be written
	 * @throws IOException
	 */
Writes data object  to file in corresponding folder

@param folderS : folder to write files to
@param fileS : file name to write
@param data : data to be written
@throws IOException
Writes data object to file in corresponding folder @param folderS : folder to write files to @param fileS : file name to write @param data : data to be written @throws IOException
private void createFolderAndWriteFileS3(String folderS, String fileS, Collector<KEY, VALUE> data) throws IOException{
		String folder = folderS+"/";
		String fileName=folder+fileS;
		File file=File.createTempFile(fileName,"");
		ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(file));
		while (data.hasNext()) {
			Tuple<KEY,VALUE> t = data.next();
			oos.writeObject(t);
		}
		oos.close();
		App.s3.putObject(new PutObjectRequest(App.bucket, fileName, file));
	}
private void createFolderAndWriteFileS3 ( String folderS , String fileS , Collector < KEY , VALUE > data ) throws IOException { String folder = folderS + "/" ; String fileName = folder + fileS ; File file = File . createTempFile ( fileName , "" ) ; ObjectOutputStream oos = new ObjectOutputStream ( new FileOutputStream ( file ) ) ; while ( data . hasNext ( ) ) { Tuple < KEY , VALUE > t = data . next ( ) ; oos . writeObject ( t ) ; } oos . close ( ) ; App . s3 . putObject ( new PutObjectRequest ( App . bucket , fileName , file ) ) ; }
Writes data object  to file in corresponding folder
Writes data object to file in corresponding folder