jack-moseley commented on code in PR #3670:
URL: https://github.com/apache/gobblin/pull/3670#discussion_r1163382958
##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/version/finder/LookbackDateTimeDatasetVersionFinder.java:
##########
@@ -67,25 +66,20 @@ public LookbackDateTimeDatasetVersionFinder(FileSystem fs,
Config config, Instan
Preconditions.checkArgument(config.hasPath(VERSION_LOOKBACK_PERIOD) ,
"Missing required property " + VERSION_LOOKBACK_PERIOD);
PeriodFormatter periodFormatter =
new
PeriodFormatterBuilder().appendYears().appendSuffix("y").appendMonths().appendSuffix("M").appendDays()
-
.appendSuffix("d").appendHours().appendSuffix("h").appendMinutes().appendSuffix("m").toFormatter();
- this.stepDuration = Duration.standardMinutes(1);
+ .appendSuffix("d").appendHours().appendSuffix("h").toFormatter();
+ this.stepDuration = Duration.standardHours(1);
this.pathPrefix = ConfigUtils.getString(config, VERSION_PATH_PREFIX, "");
this.lookbackPeriod =
periodFormatter.parsePeriod(config.getString(VERSION_LOOKBACK_PERIOD));
this.endTime = endTime;
}
- @Override
- public Class<? extends FileSystemDatasetVersion> versionClass() {
- return TimestampedDatasetVersion.class;
- }
-
@Override
public Collection<TimestampedDatasetVersion> findDatasetVersions(Dataset
dataset) throws IOException {
FileSystemDataset fsDataset = (FileSystemDataset) dataset;
Set<TimestampedDatasetVersion> versions = new HashSet<>();
Instant startTime = endTime.minus(lookbackPeriod.toStandardDuration());
- while (startTime.isBefore(endTime)) {
+ while (!startTime.isAfter(endTime)) {
Review Comment:
Yeah I think it does look better, updated it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]