Last active
May 3, 2018 20:23
-
-
Save pdk/12e6d5f3b11db1a4d7f707ab46448547 to your computer and use it in GitHub Desktop.
exceptional failure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public boolean isJobReady(DataSource dataSource, DateTime batchDate, Map<String, String> params) | |
| throws BatchJobFailureException { | |
| String alphaBatchId = params.get("batchId"); | |
| checkNotNull(alphaBatchId, "batchId is required to check status of a Blorp batch"); | |
| boolean ready = false; | |
| BlorpAlphaClient client = lookupClient(dataSource); | |
| try { | |
| BatchResponse response = client.status(alphaBatchId); | |
| if (BATCH_FAILURE_STATUSES.contains(response.status)) { | |
| log.info("Batch job status from Blorp Core indicates job failure, status={}", | |
| response.status); | |
| throw new BatchJobFailureException( | |
| "Blorp failed to complete batch job. status from core was: " + response.status); | |
| } | |
| ready = response.status.equalsIgnoreCase("completed"); | |
| log.info("alpha batchId={}, status={}, ready={}", alphaBatchId, response.status, ready); | |
| } catch (Exception e) { | |
| log.exception("Unable to obtain batch status from alpha due to {}", e, e.getMessage()); | |
| } | |
| return ready; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment