ajothomas commented on a change in pull request #14802:
URL: https://github.com/apache/beam/pull/14802#discussion_r633905281
##########
File path:
runners/samza/src/main/java/org/apache/beam/runners/samza/runtime/SamzaTimerInternalsFactory.java
##########
@@ -702,8 +673,14 @@ public void encode(TimerKey<K> value, OutputStream
outStream)
if (keyCoder != null) {
key = keyCoder.decode(inStream);
}
+
timerKeyBuilder.setTimerId(timerId).setStateNamespace(namespace).setKey(key);
+
+ // check if the stream has more available bytes. This is to ensure
backward compatibility with
+ // old rocksdb state which does not encode timer family data
+ final String timerFamilyId = inStream.available() > 0 ?
STRING_CODER.decode(inStream) : "";
+ timerKeyBuilder.setTimerFamilyId(timerFamilyId);
- return new TimerKey<>(key, namespace, timerId);
+ return timerKeyBuilder.build();
Review comment:
Changed 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.
For queries about this service, please contact Infrastructure at:
[email protected]