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/21 15:03:01 UTC
[GitHub] [pulsar] JooHyukKim opened a new pull request, #20630: [improve][doc] Improve JavaDoc of TopicName methods isPartitioned() and getPartitionedTopicName()
JooHyukKim opened a new pull request, #20630:
URL: https://github.com/apache/pulsar/pull/20630
Main Issue: #20622
### Motivation
Provide consistent concept around partitioned topic and topic partition/internal topic
### Modifications
Improve JavaDoc to `TopicName` methods `isPartitioned()` and `getPartitionedTopicName()`
### Does this pull request potentially affect one of the following parts:
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
*If the box was checked, please highlight the changes*
- [ ] Dependencies (add or upgrade a dependency)
- [ ] The public API
- [ ] The schema
- [ ] The default values of configurations
- [ ] The threading model
- [ ] The binary protocol
- [ ] The REST endpoints
- [ ] The admin CLI options
- [ ] The metrics
- [ ] Anything that affects deployment
### Documentation
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `doc` <!-- Your PR contains doc changes. -->
- [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
- [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-complete` <!-- Docs have been already added -->
### Matching PR in forked repository
PR in forked repository: https://github.com/JooHyukKim/pulsar/pull/10
<!--
After opening this PR, the build in apache/pulsar will fail and instructions will
be provided for opening a PR in the PR author's forked repository.
apache/pulsar pull requests should be first tested in your own fork since the
apache/pulsar CI based on GitHub Actions has constrained resources and quota.
GitHub Actions provides separate quota for pull requests that are executed in
a forked repository.
The tests will be run in the forked repository until all PR review comments have
been handled, the tests pass and the PR is approved by a reviewer.
-->
--
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 closed pull request #20630: [improve][doc] Improve JavaDoc of TopicName methods isPartitioned() and getPartitionedTopicName()
Posted by "JooHyukKim (via GitHub)" <gi...@apache.org>.
JooHyukKim closed pull request #20630: [improve][doc] Improve JavaDoc of TopicName methods isPartitioned() and getPartitionedTopicName()
URL: https://github.com/apache/pulsar/pull/20630
--
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 pull request #20630: [improve][doc] Improve JavaDoc of TopicName methods isPartitioned() and getPartitionedTopicName()
Posted by "JooHyukKim (via GitHub)" <gi...@apache.org>.
JooHyukKim commented on PR #20630:
URL: https://github.com/apache/pulsar/pull/20630#issuecomment-1601018087
@lhotari May I ask for a review? 🙏🏼
--
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 a diff in pull request #20630: [improve][doc] Improve JavaDoc of TopicName methods isPartitioned() and getPartitionedTopicName()
Posted by "JooHyukKim (via GitHub)" <gi...@apache.org>.
JooHyukKim commented on code in PR #20630:
URL: https://github.com/apache/pulsar/pull/20630#discussion_r1237160051
##########
pulsar-common/src/main/java/org/apache/pulsar/common/naming/TopicName.java:
##########
@@ -246,18 +263,35 @@ public int getPartitionIndex() {
return partitionIndex;
}
+ /**
+ * Note: Pulsar uses a unique approach in the context of partitioned topics (or topic partitions)
+ * compared to other messaging systems. For better understanding of this concept in Pulsar,
+ * refer to the <a href="https://pulsar.apache.org/docs/concepts-messaging#partitioned-topics">
+ * documentation</a>.
+ * <p>
+ * @return whether the completeTopicName (topic) is
+ * <a href="https://pulsar.apache.org/docs/concepts-messaging#partitioned-topics">partitioned</a>.
+ */
public boolean isPartitioned() {
return partitionIndex != -1;
}
/**
- * For partitions in a topic, return the base partitioned topic name.
- * Eg:
- * <ul>
- * <li><code>persistent://prop/cluster/ns/my-topic-partition-1</code> -->
- * <code>persistent://prop/cluster/ns/my-topic</code>
- * <li><code>persistent://prop/cluster/ns/my-topic</code> --> <code>persistent://prop/cluster/ns/my-topic</code>
- * </ul>
+ * Note: Pulsar uses a unique approach in the context of partitioned topics (or topic partitions)
+ * compared to other messaging systems. For better understanding of this concept in Pulsar,
+ * refer to the <a href="https://pulsar.apache.org/docs/concepts-messaging#partitioned-topics">
+ * documentation</a>.
+ *
+ * <p><strong>Example:</strong>
+ * <pre>
+ * String result1 = getPartitionedTopicName("persistent://prop/cluster/ns/my-topic-partition-1");
+ * // result1 now holds "persistent://prop/cluster/ns/my-topic"
+ *
+ * String result2 = getPartitionedTopicName("persistent://prop/cluster/ns/my-topic");
+ * // result2 now holds "persistent://prop/cluster/ns/my-topic"
+ * </pre>
+ *
+ * @return The base topic name. For partitions in a topic, by parsing the current {@link #completeTopicName}.
Review Comment:
This one is same as one in line 88~104
--
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