Running interrelated methods continously using java
- by snehalata
I have written application which downloads data from a website every 10 mins and writes to a file.Then these files are merged into one file and then R program is run on this merged file to perform sentiment analysis and result is stored in hbase.
I want the process of merging files,running R and then storing to HBase to run continuosly on the downloaded data.
For running R,we are running R script from java program.We have used Runtime.getRuntime().exec() method to run R program but it doesn't wait for R program to complete and method in the next line starts executing.Using p.waitFor() did not help .
What approach should I use to do merge then run R and finally store results in Hbase?Should I use timer class??