You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "JooHyukKim (via GitHub)" <gi...@apache.org> on 2023/06/20 16:46:16 UTC

[GitHub] [pulsar] JooHyukKim opened a new issue, #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`

JooHyukKim opened a new issue, #20622:
URL: https://github.com/apache/pulsar/issues/20622

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Motivation
   
   (follow up of question raised from [slack community](https://apache-pulsar.slack.com/archives/C5Z4T36F7/p1686636952934049) and discussion with @lhotari)
   
   # Motivation
   
   Concepts should include whatever is commonly used. But currently, there is no good definition of what "partitioned topic" and "non-partitioned topic" mean and some places `topic partition` and `internal topic` interchangeably. And there are currently two locations where we can improve on
   
   ### 1# **Topic Name API**
   
   Let’s take look at [one of questions raised in slack community](https://apache-pulsar.slack.com/archives/C5Z4T36F7/p1686636952934049)
   
   ```java
   TopicName topicName = TopicName.get("persistent://public/default/example-partition-0");
   System.out.println(topicName.isPartitioned()); // true
   
   String partitionedTopicName = topicName.getPartitionedTopicName();
   TopicName.get(partitionedTopicName).isPartitioned()); // false, so it's a `PartitionedTopicName` but isn't partitioned, why? I can't understand.
   ```
   
   Even though we know those who are used to Pulsar can distinguish the difference, not those without Pulsar concept. The term `partition` is somewhat overloaded with concepts. 
   
   Just to be clear,
   
   - "**partitioned topic**" is `persistent://public/default/example` and the
   - "**topic partition**" is `persistent://public/default/example-partition-0`
   
   ### **2# Documentation & Glossary**
   
   At [terminology page of Pulsar-site](https://pulsar.apache.org/docs/3.0.x/reference-terminology/#partitioned-topic) says..
   
   
   > **Partitioned Topic**
   > A topic that is served by multiple brokers, which enables higher throughput.
   
   …. which isn't consistent with the other parts of the docs and the explanations aren't sufficient. And the “other parts” refer to docs about ["topics"](https://pulsar.apache.org/docs/3.0.x/concepts-messaging/#topics) and ["partitioned topics"](https://pulsar.apache.org/docs/3.0.x/concepts-messaging/#partitioned-topics)
   
   ### Solution
   
   ### 1# Improve naming for **TopicName API**
   
   - Deprecate `ToicName.isPartitioned()` and add new
       - `TopicName.isInternallyPartitioned()` or
       - `TopicName.hasInternalPartitions()` or
       - `TopicName.isPartitionedType()`
   - Deprecate `TopicName.getPartitionedTopicName()`  and add new
       - `TopicName.getBaseTopicNameOrSelf()`
   
   ### 2# Improve JavaDoc of **TopicName API**
   
   Before there was no JavaDoc, but we can add like....
   ```java
   /**
    * @return whether the topic with (completeTopicName) has internal partitions
    */
   public boolean isPartitioned() {
       return partitionIndex != -1;
   }
   ```
   
   
   ```java
   // Before
   /**
    * For partitions in a topic, return the base partitioned topic name.
    * Eg:
    *  <example omitted>
    */
   
   // After
   /**
    * @return The base partitioned topic name if current topic is an internal partition,
    * otherwise {@link #completeTopicName} as is.
    *
    * Eg:
    *  <example omitted>
    */
   public String getPartitionedTopicName() {
       if (isPartitioned()) {
           return completeTopicName.substring(0, completeTopicName.lastIndexOf("-partition-"));
       } else {
           return completeTopicName;
       }
   }
   ```
   
   ### 3# Create a consistent glossary about concepts
   
   Since descriptions in [Pulsar-site terminology page](https://pulsar.apache.org/docs/3.0.x/reference-terminology/) seem to keep consistency with other parts of the site, turn it into Appendix and just link to wherever sufficient description exists
   
   ### Alternatives
   
   ### Case of only improving documentation
   
   Will still keep create confusion
   
   ### Anything else?
   
   # References
   
   - Motivation > 2# Documentation & Glossary
       - https://pulsar.apache.org/docs/3.0.x/concepts-messaging/#topics
       - https://pulsar.apache.org/docs/3.0.x/concepts-messaging/#partitioned-topics
       - https://pulsar.apache.org/docs/3.0.x/reference-terminology/
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] github-actions[bot] commented on issue #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #20622:
URL: https://github.com/apache/pulsar/issues/20622#issuecomment-1659448723

   The issue had no activity for 30 days, mark with Stale label.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] lhotari commented on issue #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #20622:
URL: https://github.com/apache/pulsar/issues/20622#issuecomment-1599235828

   Thanks for putting this proposal together @JooHyukKim. I think it's better to first abandon the idea of modifying the method names and the API. It's better to first focus on improving the documentation of the concepts and have that available in docs on website and in javadocs.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] github-actions[bot] commented on issue #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #20622:
URL: https://github.com/apache/pulsar/issues/20622#issuecomment-1712682951

   The issue had no activity for 30 days, mark with Stale label.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] michaeljmarshall commented on issue #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`

Posted by "michaeljmarshall (via GitHub)" <gi...@apache.org>.
michaeljmarshall commented on issue #20622:
URL: https://github.com/apache/pulsar/issues/20622#issuecomment-1671850053

   I missed that reference, thanks for pointing that out @JooHyukKim!


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] asafm commented on issue #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`

Posted by "asafm (via GitHub)" <gi...@apache.org>.
asafm commented on issue #20622:
URL: https://github.com/apache/pulsar/issues/20622#issuecomment-1671406690

   I added my view above @michaeljmarshall 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic` [pulsar]

Posted by "poorbarcode (via GitHub)" <gi...@apache.org>.
poorbarcode closed issue #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`
URL: https://github.com/apache/pulsar/issues/20622


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] JooHyukKim commented on issue #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`

Posted by "JooHyukKim (via GitHub)" <gi...@apache.org>.
JooHyukKim commented on issue #20622:
URL: https://github.com/apache/pulsar/issues/20622#issuecomment-1600620592

   @lhotari no problem 👍🏻 And yes, I agree improving concepts and docs would be more reasonable starting point. I will start working on the solution 2# and 3#


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] asafm commented on issue #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`

Posted by "asafm (via GitHub)" <gi...@apache.org>.
asafm commented on issue #20622:
URL: https://github.com/apache/pulsar/issues/20622#issuecomment-1607680983

   As @BewareMyPower mentioned, I think the word internal and partitions are a bit conflicting with each other.
   
   Internal means it is not exposed to the user, but let's face it - users are aware of those partitions, no?
   
   I don't have any meaningful feedback to give for now, so it's just a remark.
   
   I do think, future wise, I would have wanted to move into a very big change where we have:
   Topic ("incoming-logs") which can be 1 or more Topic Partition ("incoming-logs-0"). No more: internal topics, topic vs partitioned topics, and just topics.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] michaeljmarshall commented on issue #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`

Posted by "michaeljmarshall (via GitHub)" <gi...@apache.org>.
michaeljmarshall commented on issue #20622:
URL: https://github.com/apache/pulsar/issues/20622#issuecomment-1670590061

   I am not sure there was consensus, but for reference, here is a link to the mailing list discussion: https://lists.apache.org/thread/36mmvbjbm4g0b8khwmom7pjv5hr6ytxg


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] JooHyukKim commented on issue #20622: Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic`

Posted by "JooHyukKim (via GitHub)" <gi...@apache.org>.
JooHyukKim commented on issue #20622:
URL: https://github.com/apache/pulsar/issues/20622#issuecomment-1671606038

   >  I am not sure there was consensus, but for reference, here is a link to the mailing list discussion: https://lists.apache.org/thread/36mmvbjbm4g0b8khwmom7pjv5hr6ytxg
   
   I added mailing list at the bottom of the issue description. Thank you @michaeljmarshall 👍🏻 


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Provide consistent concept around `partitioned topic` and `topic partition`/`internal topic` [pulsar]

Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on issue #20622:
URL: https://github.com/apache/pulsar/issues/20622#issuecomment-6388799793

   Following @lhotari's suggestion, the part that fits this repository is javadoc. `TopicName#isPartitioned()` (pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java) still has none, and `getPartitionedTopicName()` could say plainly that it returns the base topic name for a partition and the name unchanged otherwise. The glossary and concepts changes belong in https://github.com/apache/pulsar-site. Also worth noting: Pulsar 5.0 scalable topics (PIP-460) introduce `topic://` names with segments in place of `-partition-N` topics.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org