// look at the last/most recent record (either in file or in datastore/cloud sql)
// if file1 already started and not finished, resume file 1
// get last marker processed from file or db? what is the key?
// continue, writing out each time
HUDXML3BlobService hxbs = new HUDXML3BlobService();
log.info("trying to get HUDXML3Blob object from Key String: " + hudXMLURL.getKeyString());
HUDXML3Blob blob = hxbs.getHUDXML3BlobFromXMLKey(hudXMLURL.getKeyString());
if (blob != null) {
String id = blob.getId().toString();
if (!recordExists(id)) {
log.info("for HUD XML blob record: " + id + " nothing has been done, not even file 1 indexing, so start up first time.");
startUpFirstTime(id);
}
else {
log.info("HUD XML blob record: " + id + " already exists, so continuing from past session.");
//everything keys of the household index
if (!finishedConverting(id)) {
convertHUDXMLToRosieCSV2(id);
// set as finished in database
blob = hxbs.getHUDXML3BlobFromXMLKey(hudXMLURL.getKeyString());
blob.setCsvUrl2Completed(1);
hxbs.updateHUDXML3Blob(blob);
}
}
log.info("finished storing in db, now writing to a GCS file");
writeToGoogleCloudStorage();
}