Skip to content

Commit

Permalink
fix useExplicitVersion (apache#3559)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjain1 authored and himanshug committed Oct 10, 2016
1 parent 3a83e05 commit 1e79a1b
Showing 1 changed file with 12 additions and 10 deletions.
Expand Up @@ -73,7 +73,7 @@ private static String getTheDataSource(HadoopIngestionSpec spec)
/**
* @param spec is used by the HadoopDruidIndexerJob to set up the appropriate parameters
* for creating Druid index segments. It may be modified.
* <p>
* <p/>
* Here, we will ensure that the DbConnectorConfig field of the spec is set to null, such that the
* job does not push a list of published segments the database. Instead, we will use the method
* IndexGeneratorJob.getPublishedSegments() to simply return a list of the published
Expand Down Expand Up @@ -204,15 +204,17 @@ public TaskStatus run(TaskToolbox toolbox) throws Exception
}

final String specVersion = indexerSchema.getTuningConfig().getVersion();
if (indexerSchema.getTuningConfig().isUseExplicitVersion() && version.compareTo(specVersion) > 0) {
version = specVersion;
} else {
log.error(
"Spec version can not be greater than lock version, Spec version: [%s] Lock version: [%s].",
specVersion,
version
);
return TaskStatus.failure(getId());
if (indexerSchema.getTuningConfig().isUseExplicitVersion()) {
if (specVersion.compareTo(version) < 0) {
version = specVersion;
} else {
log.error(
"Spec version can not be greater than or equal to the lock version, Spec version: [%s] Lock version: [%s].",
specVersion,
version
);
return TaskStatus.failure(getId());
}
}

log.info("Setting version to: %s", version);
Expand Down

0 comments on commit 1e79a1b

Please sign in to comment.