dnishimura commented on a change in pull request #1027: SAMZA-2046: Startpoint
fan out implementation
URL: https://github.com/apache/samza/pull/1027#discussion_r284074102
##########
File path:
samza-core/src/main/java/org/apache/samza/startpoint/StartpointManager.java
##########
@@ -143,14 +171,18 @@ public Startpoint readStartpoint(SystemStreamPartition
ssp, TaskName taskName) {
Preconditions.checkState(!stopped, "Underlying metadata store not
available");
Preconditions.checkNotNull(ssp, "SystemStreamPartition cannot be null");
- byte[] startpointBytes = metadataStore.get(toStoreKey(ssp, taskName));
+ byte[] startpointBytes = readWriteStore.get(toReadWriteStoreKey(ssp,
taskName));
- if (Objects.nonNull(startpointBytes)) {
- Startpoint startpoint = startpointSerde.fromBytes(startpointBytes);
- if
(Instant.now().minus(DEFAULT_EXPIRATION_DURATION).isBefore(Instant.ofEpochMilli(startpoint.getCreationTimestamp())))
{
- return startpoint; // return if deserializable and if not stale
+ if (ArrayUtils.isNotEmpty(startpointBytes)) {
+ try {
+ Startpoint startpoint = objectMapper.readValue(startpointBytes,
Startpoint.class);
+ if
(Instant.now().minus(DEFAULT_EXPIRATION_DURATION).isBefore(Instant.ofEpochMilli(startpoint.getCreationTimestamp())))
{
+ return startpoint; // return if deserializable and if not stale
+ }
+ LOG.warn("Stale Startpoint: {} was read. Ignoring.", startpoint);
Review comment:
Will do
----------------------------------------------------------------
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