You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/14 14:41:24 UTC

[GitHub] [pulsar] BewareMyPower commented on a diff in pull request #17410: [fix][cpp] Support retry and apply operation timeout for lookup requests

BewareMyPower commented on code in PR #17410:
URL: https://github.com/apache/pulsar/pull/17410#discussion_r970906640


##########
pulsar-client-cpp/lib/RetryableLookupService.h:
##########
@@ -0,0 +1,151 @@
+/**
+ * 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.
+ */
+#pragma once
+
+#include <algorithm>
+#include <memory>
+#include "lib/Backoff.h"
+#include "lib/ExecutorService.h"
+#include "lib/LookupService.h"
+#include "lib/SynchronizedHashMap.h"
+#include "lib/LogUtils.h"
+
+namespace pulsar {
+
+class RetryableLookupService : public LookupService,

Review Comment:
   We usually create a source file (*.cc) to reduce compilation time. For example, if
   - a.cc includes common.h and a.h
   - b.cc includes common.h and b.h
   
   If common.h changed, a.cc and b.cc would be compiled again. If common.h changed only because some method implementations changed, we can use another common.cc for them. Then only common.cc needs to be compiled because common.h, which only includes the API signatures that don't change, doesn't change.
   
   This `RetryableLookupService.h` is only used in `ClientImpl.cc` so separating the declarations and definitions is not necessary. And methods defined in the header are inline by default so they are faster. 



-- 
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-unsubscribe@pulsar.apache.org

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