Sanil15 commented on a change in pull request #1335: Optimizing startpoint
manager to not make successive bootstrapMessage calls to coordinator-store
URL: https://github.com/apache/samza/pull/1335#discussion_r401848987
##########
File path:
samza-core/src/main/java/org/apache/samza/startpoint/StartpointManager.java
##########
@@ -158,8 +158,25 @@ public void writeStartpoint(SystemStreamPartition ssp,
TaskName taskName, Startp
* @return {@link Optional} of {@link Startpoint} for the {@link
SystemStreamPartition}.
* It is empty if it does not exist or if it is too stale.
*/
+ @VisibleForTesting
public Optional<Startpoint> readStartpoint(SystemStreamPartition ssp) {
- return readStartpoint(ssp, null);
+ Map<String, byte[]> startpointBytes = readWriteStore.all();
+ // there is no task-name to use as key for the startpoint in this case
(only the ssp), so we use a null task-name
+ return readStartpoint(startpointBytes, ssp, null);
+ }
+
+ /**
+ * Returns the last {@link Startpoint} that defines the start position for a
{@link SystemStreamPartition} and {@link TaskName}.
+ * @param ssp The {@link SystemStreamPartition} to fetch the {@link
Startpoint} for.
+ * @param taskName the {@link TaskName} to fetch the {@link Startpoint} for.
+ * @return {@link Optional} of {@link Startpoint} for the {@link
SystemStreamPartition}.
+ * It is empty if it does not exist or if it is too stale.
+ */
+ @VisibleForTesting
+ public Optional<Startpoint> readStartpoint(SystemStreamPartition ssp,
TaskName taskName) {
+ Map<String, byte[]> startpointBytes = readWriteStore.all();
+ // there is no task-name to use as key for the startpoint in this case
(only the ssp), so we use a null task-name
Review comment:
Please correct the comment, task-name can non-null
----------------------------------------------------------------
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]
With regards,
Apache Git Services