You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by "Stuart Perks (Jira)" <ji...@apache.org> on 2020/12/17 12:19:00 UTC
[jira] [Updated] (SAMZA-2612) Kafka Topic naming convention is not
fully valid with Stream Descriptor StreamId
[ https://issues.apache.org/jira/browse/SAMZA-2612?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stuart Perks updated SAMZA-2612:
--------------------------------
Description:
The StreamDescriptor class cannot accept all acceptable formats for Kafka Topic names.
StreamDescriptor
{code:java}
private static final Pattern STREAM_ID_PATTERN = Pattern.compile("[\\d\\w-_]+");
{code}
Kafka Topic Validation
{code:java}
public static final String LEGAL_CHARS = "[a-zA-Z0-9._-]";
{code}
Taking the example this is valid
{code:java}
KafkaInputDescriptor<PageView> pageViewStreamDescriptor = kafkaSystemDescriptor.getInputDescriptor("page-view-topic", new JsonSerdeV2<>(PageView.class));
{code}
but this is not if we use the name page.view.topic
{code:java}
KafkaInputDescriptor<PageView> pageViewStreamDescriptor = kafkaSystemDescriptor.getInputDescriptor("page.view.topic", new JsonSerdeV2<>(PageView.class));
{code}
[Stream Descriptor Validation|https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/system/descriptors/StreamDescriptor.java#L48]
[Kafka Topic Validation|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/internals/Topic.java#L29]
was:
The StreamDescriptor class cannot accept all acceptable formats for Kafka Topic names.
StreamDescriptor
{code:java}
private static final Pattern STREAM_ID_PATTERN = Pattern.compile("[\\d\\w-_]+");
{code}
{code:java}
public static final String LEGAL_CHARS = "[a-zA-Z0-9._-]";
{code}
Taking the example this is valid
{code:java}
KafkaInputDescriptor<PageView> pageViewStreamDescriptor = kafkaSystemDescriptor.getInputDescriptor("page-view-topic", new JsonSerdeV2<>(PageView.class));
{code}
but this is not if we use the name page.view.topic
{code:java}
KafkaInputDescriptor<PageView> pageViewStreamDescriptor = kafkaSystemDescriptor.getInputDescriptor("page.view.topic", new JsonSerdeV2<>(PageView.class));
{code}
[Stream Descriptor Validation|https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/system/descriptors/StreamDescriptor.java#L48]
[Kafka Topic Validation|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/internals/Topic.java#L29]
> Kafka Topic naming convention is not fully valid with Stream Descriptor StreamId
> --------------------------------------------------------------------------------
>
> Key: SAMZA-2612
> URL: https://issues.apache.org/jira/browse/SAMZA-2612
> Project: Samza
> Issue Type: Bug
> Reporter: Stuart Perks
> Priority: Major
>
> The StreamDescriptor class cannot accept all acceptable formats for Kafka Topic names.
> StreamDescriptor
> {code:java}
> private static final Pattern STREAM_ID_PATTERN = Pattern.compile("[\\d\\w-_]+");
> {code}
> Kafka Topic Validation
> {code:java}
> public static final String LEGAL_CHARS = "[a-zA-Z0-9._-]";
> {code}
> Taking the example this is valid
> {code:java}
> KafkaInputDescriptor<PageView> pageViewStreamDescriptor = kafkaSystemDescriptor.getInputDescriptor("page-view-topic", new JsonSerdeV2<>(PageView.class));
> {code}
> but this is not if we use the name page.view.topic
> {code:java}
> KafkaInputDescriptor<PageView> pageViewStreamDescriptor = kafkaSystemDescriptor.getInputDescriptor("page.view.topic", new JsonSerdeV2<>(PageView.class));
> {code}
> [Stream Descriptor Validation|https://github.com/apache/samza/blob/master/samza-api/src/main/java/org/apache/samza/system/descriptors/StreamDescriptor.java#L48]
> [Kafka Topic Validation|https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/internals/Topic.java#L29]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)