You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/08/19 06:57:53 UTC

[GitHub] [inlong] vernedeng commented on a diff in pull request #5594: [INLONG-5510][SDK] Refactor single topic fetcher in Sort Sdk

vernedeng commented on code in PR #5594:
URL: https://github.com/apache/inlong/pull/5594#discussion_r949860824


##########
inlong-sdk/sort-sdk/src/main/java/org/apache/inlong/sdk/sort/api/TopicFetcher.java:
##########
@@ -0,0 +1,89 @@
+/*
+ * 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.inlong.sdk.sort.api;
+
+import org.apache.inlong.sdk.sort.entity.InLongTopic;
+
+import java.util.List;
+
+/**
+ * Interface of all type of topic fetchers.
+ */
+public interface TopicFetcher {
+
+    /**
+     * Init topic fetcher.
+     * @return The result of init.
+     */
+    boolean init();
+
+    /**
+     * Ack message by the given msgOffset.
+     * @param msgOffset Offset of message.
+     * @throws Exception
+     */
+    void ack(String msgOffset) throws Exception;
+
+    /**
+     * Pause the consuming
+     */
+    void pause();
+
+    /**
+     * Resume the consuming
+     */
+    void resume();
+
+    /**
+     * Close the consuming
+     * @return Result of close
+     */
+    boolean close();
+
+    /**
+     * Get if the fetcher is closed or not.
+     * @return Closed or not.
+     */
+    boolean isClosed();
+
+    /**
+     * Set stop consume flag.
+     * @param stopConsume Stop consume flag.
+     */
+    void stopConsume(boolean stopConsume);
+
+    /**
+     * Get stop consume flag.
+     * @return stop consume flag.
+     */
+    boolean isConsumeStop();

Review Comment:
   fixed, thx



-- 
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@inlong.apache.org

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