Skip to content

Commit

Permalink
Updated logs
Browse files Browse the repository at this point in the history
Signed-off-by: Asif Sohail Mohammed <[email protected]>
  • Loading branch information
asifsmohammed committed Aug 14, 2023
1 parent 52f9ea4 commit 9810cea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,14 @@ public ScanOptions build() {
} else if (originalBucketLevelNonNullCount == 2) {
setDateTimeToUse(bucketOption.getStartTime(), bucketOption.getEndTime(), bucketOption.getRange());
} else if (originalBucketLevelNonNullCount == 1) {
// Use start_time, end_time, range from global level options, because we are unable to build it from single option configured at bucket level
setDateTimeToUse(startDateTime, endDateTime, range);
if (Objects.nonNull(bucketOption.getStartTime()) || Objects.nonNull(bucketOption.getEndTime())) {
setDateTimeToUse(bucketOption.getStartTime(), bucketOption.getEndTime(), bucketOption.getRange());
} else {
LOG.warn("Scan is configured with start_time and end_time at global level and range at bucket level for the bucket with name {}. " +
"Unable to establish a time period with range alone at bucket level. " +
"Using start_time and end_time configured at global level and ignoring range.", bucketOption.getName());
setDateTimeToUse(startDateTime, endDateTime, range);
}
}
} else {
setDateTimeToUse(bucketStartDateTime, bucketEndDateTime, bucketRange);
Expand All @@ -140,7 +146,7 @@ private void setDateTimeToUse(LocalDateTime bucketStartDateTime, LocalDateTime b
} else if (Objects.nonNull(bucketEndDateTime)) {
this.useEndDateTime = bucketEndDateTime;
} else if (Objects.nonNull(bucketRange)) {
LOG.info("Scan is configured with just range for the bucket with name {}, unable to establish a time period with range alone. " +
LOG.warn("Scan is configured with just range for the bucket with name {}. Unable to establish a time period with range alone. " +
"Configure start_time or end_time, else all the objects in the bucket will be included", bucketOption.getName());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,15 @@ private static Stream<Arguments> validCombinedTimeRangeOptions() {
Arguments.of(
LocalDateTime.parse("2023-01-21T18:00:00"), LocalDateTime.parse("2023-12-24T18:00:00"), null,
LocalDateTime.parse("2023-05-21T18:00:00"), null, null,
LocalDateTime.parse("2023-05-21T18:00:00"), LocalDateTime.parse("2023-12-24T18:00:00"))
LocalDateTime.parse("2023-05-21T18:00:00"), LocalDateTime.parse("2023-12-24T18:00:00")),
Arguments.of(
LocalDateTime.parse("2023-01-21T18:00:00"), null, Duration.ofDays(3L),
null, LocalDateTime.parse("2023-05-21T18:00:00"), null,
null, LocalDateTime.parse("2023-05-21T18:00:00")),
Arguments.of(
null, LocalDateTime.parse("2023-01-21T18:00:00"), Duration.ofDays(3L),
LocalDateTime.parse("2023-05-21T18:00:00"), null, null,
LocalDateTime.parse("2023-05-21T18:00:00"), null)
);
}

Expand Down

0 comments on commit 9810cea

Please sign in to comment.