Skip to content

Commit

Permalink
Fixed minor bugs NAS-2487 NAS-2488
Browse files Browse the repository at this point in the history
  • Loading branch information
svcarlsen committed Jan 22, 2016
1 parent 212efe2 commit 2bae394
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -156,11 +156,11 @@ public void requestCrawlStart() {
log.debug("Result of buildJobConfiguration() operation: " + new String(jobResult.response, "UTF-8"));
if (jobResult.status == ResultStatus.OK) {
if (jobResult.job.statusDescription.equalsIgnoreCase("Unbuilt")) {
throw new HeritrixLaunchException("The job '" + jobName + "' could not be built. Last loglines is " + StringUtils.join(jobResult.job.jobLogTail, "\n"));
throw new HeritrixLaunchException("The job '" + jobName + "' could not be built. Last loglines are " + StringUtils.join(jobResult.job.jobLogTail, "\n"));
} else if (jobResult.job.statusDescription.equalsIgnoreCase("Ready")) {
log.info("Job {} built successfully", jobName);
} else if (jobResult.job.statusDescription.startsWith("Finished")) { // Created but not launchable
log.warn("The job {} seems unlaunchable. Tearing down the job. Last loglines is ", jobName,
log.warn("The job {} seems unlaunchable. Tearing down the job. Last loglines are ", jobName,
StringUtils.join(jobResult.job.jobLogTail, "\n"));
jobResult = h3wrapper.teardownJob(jobName);
log.debug("Result of teardown() operation: " + new String(jobResult.response, "UTF-8"));
Expand All @@ -174,7 +174,7 @@ public void requestCrawlStart() {
}

jobResult = h3wrapper.waitForJobState(jobName, CrawlControllerState.NASCENT, 60, 1000);
if (jobResult.job.crawlControllerState.equals(CrawlControllerState.NASCENT)) {
if (jobResult.job.crawlControllerState.equalsIgnoreCase(CrawlControllerState.NASCENT.toString())) {
log.info("The H3 job {} in now in state CrawlControllerState.NASCENT", jobName);
} else {
log.warn("The job state is now {}. Should have been CrawlControllerState.NASCENT", jobResult.job.crawlControllerState);
Expand All @@ -183,7 +183,7 @@ public void requestCrawlStart() {

log.debug("Result of launchJob() operation: " + new String(jobResult.response, "UTF-8"));
jobResult = h3wrapper.waitForJobState(jobName, CrawlControllerState.PAUSED, 60, 1000);
if (jobResult.job.crawlControllerState.equals(CrawlControllerState.PAUSED)) {
if (jobResult.job.crawlControllerState.equalsIgnoreCase(CrawlControllerState.PAUSED.toString())) {
log.info("The H3 job {} in now in state CrawlControllerState.PAUSED", jobName);
} else {
log.warn("The job state is now {}. Should have been CrawlControllerState.PAUSED", jobResult.job.crawlControllerState);
Expand Down Expand Up @@ -283,7 +283,7 @@ public void cleanup(File crawlDir) {
log.warn("Should be one job but there is {} jobs: {}", knownJobs.size(), knownJobsToString(engineResult));
}
} else {
log.warn("Unresponsive Heritrix3 engine. Lets try continuing the cleanup anyway");
log.warn("Unresponsive Heritrix3 engine. Let's try continuing the cleanup anyway");
}

// Check that job jobName still exists in H3 engine
Expand Down Expand Up @@ -327,7 +327,7 @@ public void cleanup(File crawlDir) {


private String knownJobsToString(EngineResult engineResult) {
String result = null;
String result = "";
if (engineResult == null || engineResult.engine == null || engineResult.engine.jobs == null) {
result = null;
} else {
Expand Down

0 comments on commit 2bae394

Please sign in to comment.