Lakshmi Manasa Gaduputi created SAMZA-2739:
----------------------------------------------
Summary: Improve SystemStreamPartition key deserializer to not be
rigid about ssp having only 3 parts
Key: SAMZA-2739
URL: https://issues.apache.org/jira/browse/SAMZA-2739
Project: Samza
Issue Type: Improvement
Reporter: Lakshmi Manasa Gaduputi
Assignee: Lakshmi Manasa Gaduputi
SystemStreamPartition key deserializer in SamzaObjectMapper currently is of the
form
{code:java}
int idx = sspString.indexOf('.');
int lastIdx = sspString.lastIndexOf('.');
if (idx < 0 || lastIdx < 0) {
throw new IllegalArgumentException("System stream partition expected in
format 'system.stream.partition");
}
return new SystemStreamPartition(
new SystemStream(sspString.substring(0, idx), sspString.substring(idx
+ 1, lastIdx)),
new Partition(Integer.parseInt(sspString.substring(lastIdx + 1))));
} {code}
this is rigid in the sense that it does not allow for addition of a 4th field
to the SSP serialization. With introduction of keyBucket to SSP, it will become
necessary to add a 4th field.
Make an initial improvement to refine this deser logic to use "String.split"
instead of "substring". After this is in, a later PR will add keyBucket
addition serde will be introduced. The addition of KeyBucket is thus into two
parts - (a) improve the deser of SSP key and (b) add KeyBucket to SSP key
serde. The reason for splitting is to ensure backwards compatibility for the
second PR aka (b) above.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)