You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/07/28 21:11:48 UTC

[GitHub] [kafka] hachikuji commented on a change in pull request #10909: KAFKA-12158: Better return type of RaftClient.scheduleAppend

hachikuji commented on a change in pull request #10909:
URL: https://github.com/apache/kafka/pull/10909#discussion_r678655283



##########
File path: raft/src/main/java/org/apache/kafka/raft/RaftAppendResult.java
##########
@@ -0,0 +1,83 @@
+/*
+ * 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.kafka.raft;
+
+import java.util.Optional;
+
+/**
+ * Result of append operation to raft log
+ */
+public class RaftAppendResult {

Review comment:
       @dengziming Thanks for the patch. When I first wrote the JIRA, I wasn't really sure how the controller would end up handling the different errors that were possible from `scheduleAppend`, so I thought we might need to distinguish them. Now that we have a more complete implementation, it seems fairly clear that the controller will just resign leadership and reset its state no matter what the error type is. In light of that, we can probably simplify this. Semantically, we just want the ability to return either the last offset of the append or an error. Perhaps using a separate return type is overkill in this case and we can throw an exception? 




-- 
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: jira-unsubscribe@kafka.apache.org

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