MRFramework/src/main/java/com/mr/util/AWSUtility.java
/**
	 * Writes final output to s3 in the output folder specified
	 * We have used tab as separator between key and value
	 * 
	 * @param folderS
	 * @param fileS
	 * @param data
	 * @throws IOException
	 */
Writes final output to s3 in the output folder specified
We have used tab as separator between key and value


Writes final output to s3 in the output folder specified We have used tab as separator between key and value
public static void finalWriteToS3(String folderS, String fileS, Collector<?,?> data) throws IOException{
		String folder = folderS+"/";
		String fileName=folder+fileS;
		File file=File.createTempFile(fileName,"");
		Writer writer = new OutputStreamWriter(new FileOutputStream(file));
		while (data.hasNext())
		{
			Tuple<?,?> t = data.next();
			writer.write(t.getKey() + "\t"+  t.getValue()+"\n");
		}
		writer.close();
		App.s3.putObject(new PutObjectRequest(App.bucket, fileName, file));
	}
public static void finalWriteToS3 ( String folderS , String fileS , Collector < ? , ? > data ) throws IOException { String folder = folderS + "/" ; String fileName = folder + fileS ; File file = File . createTempFile ( fileName , "" ) ; Writer writer = new OutputStreamWriter ( new FileOutputStream ( file ) ) ; while ( data . hasNext ( ) ) { Tuple < ? , ? > t = data . next ( ) ; writer . write ( t . getKey ( ) + "\t" + t . getValue ( ) + "\n" ) ; } writer . close ( ) ; App . s3 . putObject ( new PutObjectRequest ( App . bucket , fileName , file ) ) ; }
Writes final output to s3 in the output folder specified
 We have used tab as separator between key and value
Writes final output to s3 in the output folder specified We have used tab as separator between key and value