Demogorgon314 commented on code in PR #18084: URL: https://github.com/apache/pulsar/pull/18084#discussion_r998890325
########## pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensible/ExtensibleLoadManager.java: ########## @@ -0,0 +1,73 @@ +/** + * 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.pulsar.broker.loadbalance.extensible; + +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import org.apache.pulsar.broker.PulsarServerException; +import org.apache.pulsar.broker.PulsarService; +import org.apache.pulsar.broker.lookup.LookupResult; +import org.apache.pulsar.common.naming.ServiceUnitId; + +/** + * Find the appropriate broker for bundle through different load balancer Implementation. + */ +public interface ExtensibleLoadManager { + + /** + * Start the extensible load manager. + * + * 1. Start the broker registry. + * 2. Register self to registry. + * 3. Start the load data store. + * 4. Init the load manager context. + * 5. Start load data reporter. + * 6. Start the namespace unload scheduler. + * 7. Start the namespace split scheduler. + * 8. Listen the broker up or down, so we can split immediately. + */ + void start() throws PulsarServerException; + + /** + * Initialize this load manager using the given pulsar service. + */ + void initialize(PulsarService pulsar); + + /** + * The incoming bundle selects the appropriate broker through strategies. + * + * @param serviceUnit Bundle. + * @return Simple resource. + */ + Optional<String> discover(ServiceUnitId serviceUnit); Review Comment: Updated. ########## pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensible/ExtensibleLoadManager.java: ########## @@ -0,0 +1,73 @@ +/** + * 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.pulsar.broker.loadbalance.extensible; + +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import org.apache.pulsar.broker.PulsarServerException; +import org.apache.pulsar.broker.PulsarService; +import org.apache.pulsar.broker.lookup.LookupResult; +import org.apache.pulsar.common.naming.ServiceUnitId; + +/** + * Find the appropriate broker for bundle through different load balancer Implementation. + */ +public interface ExtensibleLoadManager { + + /** + * Start the extensible load manager. + * + * 1. Start the broker registry. + * 2. Register self to registry. + * 3. Start the load data store. + * 4. Init the load manager context. + * 5. Start load data reporter. + * 6. Start the namespace unload scheduler. + * 7. Start the namespace split scheduler. + * 8. Listen the broker up or down, so we can split immediately. + */ + void start() throws PulsarServerException; + + /** + * Initialize this load manager using the given pulsar service. + */ + void initialize(PulsarService pulsar); + + /** + * The incoming bundle selects the appropriate broker through strategies. Review Comment: Updated. ########## pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/extensible/ExtensibleLoadManager.java: ########## @@ -0,0 +1,73 @@ +/** + * 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.pulsar.broker.loadbalance.extensible; + +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import org.apache.pulsar.broker.PulsarServerException; +import org.apache.pulsar.broker.PulsarService; +import org.apache.pulsar.broker.lookup.LookupResult; +import org.apache.pulsar.common.naming.ServiceUnitId; + +/** + * Find the appropriate broker for bundle through different load balancer Implementation. + */ +public interface ExtensibleLoadManager { + + /** + * Start the extensible load manager. + * + * 1. Start the broker registry. + * 2. Register self to registry. + * 3. Start the load data store. + * 4. Init the load manager context. + * 5. Start load data reporter. + * 6. Start the namespace unload scheduler. + * 7. Start the namespace split scheduler. + * 8. Listen the broker up or down, so we can split immediately. + */ + void start() throws PulsarServerException; + + /** + * Initialize this load manager using the given pulsar service. + */ + void initialize(PulsarService pulsar); + + /** + * The incoming bundle selects the appropriate broker through strategies. + * + * @param serviceUnit Bundle. + * @return Simple resource. + */ + Optional<String> discover(ServiceUnitId serviceUnit); + + + /** + * The incoming bundle selects the appropriate broker through strategies. + * + * @param serviceUnit Bundle. + * @return Simple resource. + */ + CompletableFuture<Optional<LookupResult>> assign(Optional<ServiceUnitId> topic, ServiceUnitId serviceUnit); Review Comment: Updated. -- 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]
