You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "xuzifu666 (via GitHub)" <gi...@apache.org> on 2026/03/04 06:52:45 UTC
[PR] [rest] Introduce consumers api definition in rest [paimon]
xuzifu666 opened a new pull request, #7339:
URL: https://github.com/apache/paimon/pull/7339
<!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
### Purpose
<!-- Linking this pull request to the issue -->
Linked issue: close #xxx
Currently there is no Consumers API in RestCatalog, this pr introduce it.
<!-- What is the purpose of the change -->
### Tests
<!-- List UT and IT cases to verify this change -->
### API and Format
<!-- Does this change affect API or storage format -->
### Documentation
<!-- Does this change introduce a new feature -->
### Generative AI tooling
<!--
If generative AI tooling has been used in the process of authoring this patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [rest] Introduce consumers api definition in rest [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #7339:
URL: https://github.com/apache/paimon/pull/7339#discussion_r2884231526
##########
paimon-api/src/main/java/org/apache/paimon/rest/responses/ListConsumersResponse.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.rest.responses;
+
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonGetter;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.List;
+
+/** Response for list consumers. */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ListConsumersResponse implements PagedResponse<ListConsumersResponse.ConsumerInfo> {
+
+ private static final String FIELD_CONSUMERS = "consumers";
+ private static final String FIELD_NEXT_PAGE_TOKEN = "nextPageToken";
+
+ @JsonProperty(FIELD_CONSUMERS)
+ private final List<ConsumerInfo> consumers;
+
+ @JsonProperty(FIELD_NEXT_PAGE_TOKEN)
+ private final String nextPageToken;
+
+ public ListConsumersResponse(@JsonProperty(FIELD_CONSUMERS) List<ConsumerInfo> consumers) {
+ this(consumers, null);
+ }
+
+ @JsonCreator
+ public ListConsumersResponse(
+ @JsonProperty(FIELD_CONSUMERS) List<ConsumerInfo> consumers,
+ @JsonProperty(FIELD_NEXT_PAGE_TOKEN) String nextPageToken) {
+ this.consumers = consumers;
+ this.nextPageToken = nextPageToken;
+ }
+
+ @JsonGetter(FIELD_CONSUMERS)
+ public List<ConsumerInfo> getConsumers() {
+ return this.consumers;
+ }
+
+ @Override
+ public List<ConsumerInfo> data() {
+ return this.consumers;
+ }
+
+ @JsonGetter(FIELD_NEXT_PAGE_TOKEN)
+ public String getNextPageToken() {
+ return this.nextPageToken;
+ }
+
+ /** Entry representing a consumer with id and nextSnapshot. */
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static class ConsumerInfo {
Review Comment:
Put this class into `org.apache.paimon.consumer` package.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [rest] Introduce consumers api definition in rest [paimon]
Posted by "xuzifu666 (via GitHub)" <gi...@apache.org>.
xuzifu666 commented on code in PR #7339:
URL: https://github.com/apache/paimon/pull/7339#discussion_r2888048389
##########
paimon-api/src/main/java/org/apache/paimon/rest/responses/ListConsumersResponse.java:
##########
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.rest.responses;
+
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonCreator;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonGetter;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.List;
+
+/** Response for list consumers. */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ListConsumersResponse implements PagedResponse<ListConsumersResponse.ConsumerInfo> {
+
+ private static final String FIELD_CONSUMERS = "consumers";
+ private static final String FIELD_NEXT_PAGE_TOKEN = "nextPageToken";
+
+ @JsonProperty(FIELD_CONSUMERS)
+ private final List<ConsumerInfo> consumers;
+
+ @JsonProperty(FIELD_NEXT_PAGE_TOKEN)
+ private final String nextPageToken;
+
+ public ListConsumersResponse(@JsonProperty(FIELD_CONSUMERS) List<ConsumerInfo> consumers) {
+ this(consumers, null);
+ }
+
+ @JsonCreator
+ public ListConsumersResponse(
+ @JsonProperty(FIELD_CONSUMERS) List<ConsumerInfo> consumers,
+ @JsonProperty(FIELD_NEXT_PAGE_TOKEN) String nextPageToken) {
+ this.consumers = consumers;
+ this.nextPageToken = nextPageToken;
+ }
+
+ @JsonGetter(FIELD_CONSUMERS)
+ public List<ConsumerInfo> getConsumers() {
+ return this.consumers;
+ }
+
+ @Override
+ public List<ConsumerInfo> data() {
+ return this.consumers;
+ }
+
+ @JsonGetter(FIELD_NEXT_PAGE_TOKEN)
+ public String getNextPageToken() {
+ return this.nextPageToken;
+ }
+
+ /** Entry representing a consumer with id and nextSnapshot. */
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static class ConsumerInfo {
Review Comment:
Done.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [rest] Introduce consumers api definition in rest [paimon]
Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #7339:
URL: https://github.com/apache/paimon/pull/7339
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org