sodonnel commented on code in PR #3743: URL: https://github.com/apache/ozone/pull/3743#discussion_r968290745
########## hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/replication/health/HealthCheck.java: ########## @@ -0,0 +1,49 @@ +/* + * 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.hadoop.hdds.scm.container.replication.health; + +import org.apache.hadoop.hdds.scm.container.replication.ContainerCheckRequest; + +/** + * Interface used by Container Health Check Handlers. + */ +public interface HealthCheck { + + /** + * Handle the container and apply the given check to it. This may result in + * commands getting generated to correct container states, or nothing + * happening if the container is healthy. + * @param request ContainerCheckRequest object representing the container + * @return True if the request was handled or false if it was not and should + * be handled by the next handler in the chain. + */ + boolean handle(ContainerCheckRequest request); + + /** + * Starting from this HealthCheck, call the handle method. If it returns + * false, indicating the request was not handled, then forward the request to + * the next handler in the chain via its handleChain method. Repeating until + * the request is handled, or there are no further handlers to try. + * @param request + * @return True if the request was handled or false if not handler handled it. + */ + boolean handleChain(ContainerCheckRequest request); + Review Comment: Sure - I have added it. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
