You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Lakshmi Manasa Gaduputi (Jira)" <ji...@apache.org> on 2022/05/02 17:42:00 UTC

[jira] [Updated] (SAMZA-2739) Improve SystemStreamPartition key deserializer to not be rigid about ssp having only 3 fields

     [ https://issues.apache.org/jira/browse/SAMZA-2739?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lakshmi Manasa Gaduputi updated SAMZA-2739:
-------------------------------------------
    Summary: Improve SystemStreamPartition key deserializer to not be rigid about ssp having only 3 fields  (was: Improve SystemStreamPartition key deserializer to not be rigid about ssp having only 3 parts)

> Improve SystemStreamPartition key deserializer to not be rigid about ssp having only 3 fields
> ---------------------------------------------------------------------------------------------
>
>                 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
>            Priority: Major
>
> 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)