davidradl commented on code in PR #27716: URL: https://github.com/apache/flink/pull/27716#discussion_r2873300120
########## flink-runtime/src/main/java/org/apache/flink/runtime/management/blocklist/ManagementBlocklistHandler.java: ########## @@ -0,0 +1,77 @@ +/* + * 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.flink.runtime.management.blocklist; + +import org.apache.flink.runtime.blocklist.BlockedNode; + +import java.time.Duration; +import java.util.Collection; +import java.util.Set; + +/** + * Interface for managing cluster-level node blocklist. This is independent of batch execution + * blocklist and speculative execution. + */ +public interface ManagementBlocklistHandler { + + /** + * Add a node to the management blocklist. + * + * @param nodeId the ID of the node to block + * @param reason the reason for blocking the node + * @param duration the duration for which the node should be blocked + */ + void addBlockedNode(String nodeId, String reason, Duration duration); + + /** + * Remove a node from the management blocklist. + * + * @param nodeId the ID of the node to unblock + * @return true if the node was removed, false if it wasn't in the blocklist + */ + boolean removeBlockedNode(String nodeId); + + /** + * Get all currently blocked nodes in the management blocklist. + * + * @return a set of all blocked nodes + */ + Set<BlockedNode> getAllBlockedNodes(); + + /** + * Check if a specific node is blocked in the management blocklist. + * + * @param nodeId the ID of the node to check + * @return true if the node is blocked, false otherwise + */ + boolean isNodeBlocked(String nodeId); + + /** + * Remove all expired nodes from the management blocklist. This method is called periodically to Review Comment: The flip says : "endTimestamp: The end time of the blocking (at which time the node will become available again)." I am curious , is the node available when it expires or when the expired node is removed from the blocked list. If it is the latter - maybe change the name of this method to makeNodesAvailable(). -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
