bkonold commented on a change in pull request #1353:
URL: https://github.com/apache/samza/pull/1353#discussion_r417619658
##########
File path:
samza-core/src/test/java/org/apache/samza/storage/TestTaskSideInputStorageManager.java
##########
@@ -182,6 +186,36 @@ public void testGetFileOffsets() {
});
}
+ /**
+ * This test is for cases, when calls to systemAdmin (e.g.,
KafkaSystemAdmin's) get-stream-metadata method return null.
+ */
+ @Test
+ public void testGetStartingOffsetsWhenStreamMetadataIsNull() {
+ final String storeName = "test-get-starting-offset-store";
+ final String taskName = "test-get-starting-offset-task";
+
+ Set<SystemStreamPartition> ssps = IntStream.range(1, 6)
+ .mapToObj(idx -> new SystemStreamPartition("test-system",
"test-stream", new Partition(idx)))
+ .collect(Collectors.toSet());
+ Map<Partition, SystemStreamMetadata.SystemStreamPartitionMetadata>
partitionMetadata = ssps.stream()
+ .collect(Collectors.toMap(SystemStreamPartition::getPartition,
+ x -> new SystemStreamMetadata.SystemStreamPartitionMetadata(null,
"1", "2")));
Review comment:
What's the purpose for multiple ssps if they are each testing the same
condition?
##########
File path:
samza-core/src/main/java/org/apache/samza/storage/TaskSideInputStorageManager.java
##########
@@ -346,7 +346,8 @@ File getStoreLocation(String storeName) {
* 3. Fetches the partition metadata for each system stream and fetch the
corresponding partition metadata
* and populates the oldest offset for SSPs belonging to the system
stream.
*
- * @return a {@link Map} of {@link SystemStreamPartition} to their oldest
offset.
+ * @return a {@link Map} of {@link SystemStreamPartition} to their oldest
offset. If partitionMetadata could not be
+ * obtained for any {@link SystemStreamPartition} the offset for it is
populated as null.
Review comment:
thanks for adding docs
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]