merlimat commented on a change in pull request #13316: URL: https://github.com/apache/pulsar/pull/13316#discussion_r790152592
########## File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/AutoClusterFailoverBuilder.java ########## @@ -0,0 +1,160 @@ +/** + * 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.client.api; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.apache.pulsar.common.classification.InterfaceAudience; +import org.apache.pulsar.common.classification.InterfaceStability; + +/** + * {@link AutoClusterFailoverBuilder} is used to configure and create instance of {@link ServiceUrlProvider} + * + * @since 2.10.0 + */ +@InterfaceAudience.Public +@InterfaceStability.Evolving +public interface AutoClusterFailoverBuilder { + + @SuppressWarnings("checkstyle:javadoctype") + enum SecondaryChoosePolicy { + ORDER + } + /** + * Set the primary service url. + * + * @param primary + * @return + */ + AutoClusterFailoverBuilder primary(String primary); + + /** + * Set the secondary service url. + * + * @param secondary + * @return + */ + AutoClusterFailoverBuilder secondary(List<String> secondary); + + /** + * Set secondary choose policy. The default secondary choose policy is `ORDER`. + * @param policy + * @return + */ + AutoClusterFailoverBuilder secondaryChoosePolicy(SecondaryChoosePolicy policy); + + /** + * Set primary authentication. + * + * @param authentication + * @return + */ + AutoClusterFailoverBuilder primaryAuthentication(Authentication authentication); Review comment: Shouldn't this be the authentication scheme already set in the client? ########## File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/AutoClusterFailoverBuilder.java ########## @@ -0,0 +1,160 @@ +/** + * 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.client.api; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.apache.pulsar.common.classification.InterfaceAudience; +import org.apache.pulsar.common.classification.InterfaceStability; + +/** + * {@link AutoClusterFailoverBuilder} is used to configure and create instance of {@link ServiceUrlProvider} + * + * @since 2.10.0 + */ +@InterfaceAudience.Public +@InterfaceStability.Evolving +public interface AutoClusterFailoverBuilder { + + @SuppressWarnings("checkstyle:javadoctype") + enum SecondaryChoosePolicy { + ORDER + } + /** + * Set the primary service url. + * + * @param primary + * @return + */ + AutoClusterFailoverBuilder primary(String primary); + + /** + * Set the secondary service url. + * + * @param secondary + * @return + */ + AutoClusterFailoverBuilder secondary(List<String> secondary); + + /** + * Set secondary choose policy. The default secondary choose policy is `ORDER`. + * @param policy + * @return + */ + AutoClusterFailoverBuilder secondaryChoosePolicy(SecondaryChoosePolicy policy); + + /** + * Set primary authentication. + * + * @param authentication + * @return + */ + AutoClusterFailoverBuilder primaryAuthentication(Authentication authentication); + + /** + * Set secondary authentication. + * + * @param authentication + * @return + */ + AutoClusterFailoverBuilder secondaryAuthentication(Map<String, Authentication> authentication); + + /** + * Set primary tlsTrustCertsFilePath. + * + * @param tlsTrustCertsFilePath + * @return + */ + AutoClusterFailoverBuilder primaryTlsTrustCertsFilePath(String tlsTrustCertsFilePath); Review comment: Same as above, this is already set in the client instance. ########## File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/AutoClusterFailoverBuilder.java ########## @@ -0,0 +1,160 @@ +/** + * 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.client.api; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.apache.pulsar.common.classification.InterfaceAudience; +import org.apache.pulsar.common.classification.InterfaceStability; + +/** + * {@link AutoClusterFailoverBuilder} is used to configure and create instance of {@link ServiceUrlProvider} + * + * @since 2.10.0 + */ +@InterfaceAudience.Public +@InterfaceStability.Evolving +public interface AutoClusterFailoverBuilder { + + @SuppressWarnings("checkstyle:javadoctype") + enum SecondaryChoosePolicy { + ORDER Review comment: What does `ORDER` mean? ########## File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/PulsarClient.java ########## @@ -256,6 +257,31 @@ static ClientBuilder builder() { */ void updateServiceUrl(String serviceUrl) throws PulsarClientException; + /** + * Update the authentication this client is using. + * + * @param authentication + * + * @throws IOException + */ + void updateAuthentication(Authentication authentication) Review comment: Maybe we can keep these new methods as part of `PulsarClientImpl` for now ########## File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/AutoClusterFailoverBuilder.java ########## @@ -0,0 +1,160 @@ +/** + * 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.client.api; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.apache.pulsar.common.classification.InterfaceAudience; +import org.apache.pulsar.common.classification.InterfaceStability; + +/** + * {@link AutoClusterFailoverBuilder} is used to configure and create instance of {@link ServiceUrlProvider} + * + * @since 2.10.0 + */ +@InterfaceAudience.Public +@InterfaceStability.Evolving +public interface AutoClusterFailoverBuilder { + + @SuppressWarnings("checkstyle:javadoctype") + enum SecondaryChoosePolicy { Review comment: ```suggestion enum ClusterFailoverPolicy { ``` ########## File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/AutoClusterFailoverBuilder.java ########## @@ -0,0 +1,160 @@ +/** + * 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.client.api; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.apache.pulsar.common.classification.InterfaceAudience; +import org.apache.pulsar.common.classification.InterfaceStability; + +/** + * {@link AutoClusterFailoverBuilder} is used to configure and create instance of {@link ServiceUrlProvider} + * + * @since 2.10.0 + */ +@InterfaceAudience.Public +@InterfaceStability.Evolving +public interface AutoClusterFailoverBuilder { + + @SuppressWarnings("checkstyle:javadoctype") + enum SecondaryChoosePolicy { + ORDER + } + /** + * Set the primary service url. + * + * @param primary + * @return + */ + AutoClusterFailoverBuilder primary(String primary); + + /** + * Set the secondary service url. + * + * @param secondary + * @return + */ + AutoClusterFailoverBuilder secondary(List<String> secondary); + + /** + * Set secondary choose policy. The default secondary choose policy is `ORDER`. + * @param policy + * @return + */ + AutoClusterFailoverBuilder secondaryChoosePolicy(SecondaryChoosePolicy policy); + + /** + * Set primary authentication. + * + * @param authentication + * @return + */ + AutoClusterFailoverBuilder primaryAuthentication(Authentication authentication); + + /** + * Set secondary authentication. + * + * @param authentication + * @return + */ + AutoClusterFailoverBuilder secondaryAuthentication(Map<String, Authentication> authentication); + + /** + * Set primary tlsTrustCertsFilePath. + * + * @param tlsTrustCertsFilePath + * @return + */ + AutoClusterFailoverBuilder primaryTlsTrustCertsFilePath(String tlsTrustCertsFilePath); + + /** + * Set secondary tlsTrustCertsFilePath. + * + * @param tlsTrustCertsFilePath + * @return + */ + AutoClusterFailoverBuilder secondaryTlsTrustCertsFilePath(Map<String, String> tlsTrustCertsFilePath); + + /** + * Set primary tlsTrustStorePath. + * + * @param tlsTrustStorePath + * @return + */ + AutoClusterFailoverBuilder primaryTlsTrustStorePath(String tlsTrustStorePath); Review comment: Same as above, this is already set in the client instance. ########## File path: pulsar-client-api/src/main/java/org/apache/pulsar/client/api/AutoClusterFailoverBuilder.java ########## @@ -0,0 +1,160 @@ +/** + * 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.client.api; + +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.apache.pulsar.common.classification.InterfaceAudience; +import org.apache.pulsar.common.classification.InterfaceStability; + +/** + * {@link AutoClusterFailoverBuilder} is used to configure and create instance of {@link ServiceUrlProvider} + * + * @since 2.10.0 + */ +@InterfaceAudience.Public +@InterfaceStability.Evolving +public interface AutoClusterFailoverBuilder { + + @SuppressWarnings("checkstyle:javadoctype") + enum SecondaryChoosePolicy { + ORDER + } + /** + * Set the primary service url. + * + * @param primary + * @return + */ + AutoClusterFailoverBuilder primary(String primary); + + /** + * Set the secondary service url. + * + * @param secondary + * @return + */ + AutoClusterFailoverBuilder secondary(List<String> secondary); + + /** + * Set secondary choose policy. The default secondary choose policy is `ORDER`. + * @param policy + * @return + */ + AutoClusterFailoverBuilder secondaryChoosePolicy(SecondaryChoosePolicy policy); Review comment: "choosePolicy" doesn't sound good :) ```suggestion AutoClusterFailoverBuilder failoverPolicy(SecondaryChoosePolicy policy); ``` -- 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-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org