MRFramework/src/main/java/com/mr/util/CreateInstances.java
/**
	 * Read IP addressess file from s3 bucket and their instance ID
	 * 
	 * @throws IOException
	 */
Read IP addressess file from s3 bucket and their instance ID


Read IP addressess file from s3 bucket and their instance ID
private static void readIPsFromS3Bucket() throws IOException {
		log.info("Reading  instances data from S3 bucket " + bucketName);
		S3Object s3o = s3.getObject(new GetObjectRequest(bucketName, "ipaddress.txt"));
		BufferedReader reader = new BufferedReader(new InputStreamReader(s3o.getObjectContent()));
		String line = null;
		while ((line = reader.readLine()) != null) {
			log.info(line);
			String[] instanceIDs = csv_parser.parseLine(line);
			activeInstances.add(instanceIDs[1]);
		}
	}
private static void readIPsFromS3Bucket ( ) throws IOException { log . info ( "Reading  instances data from S3 bucket " + bucketName ) ; S3Object s3o = s3 . getObject ( new GetObjectRequest ( bucketName , "ipaddress.txt" ) ) ; BufferedReader reader = new BufferedReader ( new InputStreamReader ( s3o . getObjectContent ( ) ) ) ; String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { log . info ( line ) ; String [ ] instanceIDs = csv_parser . parseLine ( line ) ; activeInstances . add ( instanceIDs [ 1 ] ) ; } }
Read IP addressess file from s3 bucket and their instance ID
Read IP addressess file from s3 bucket and their instance ID