imay commented on a change in pull request #671: Implement the routine load 
process of Kafka on Backend
URL: https://github.com/apache/incubator-doris/pull/671#discussion_r260686643
 
 

 ##########
 File path: be/src/runtime/routine_load/data_consumer.cpp
 ##########
 @@ -0,0 +1,195 @@
+// 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.
+
+#include "runtime/routine_load/data_consumer.h"
+
+#include <algorithm>
+#include <functional>
+#include <string>
+#include <vector>
+
+#include "common/status.h"
+#include "runtime/routine_load/kafka_consumer_pipe.h"
+#include "util/defer_op.h"
+#include "util/stopwatch.hpp"
+
+namespace doris {
+
+Status KafkaDataConsumer::init() {
+    std::unique_lock<std::mutex> l(_lock); 
+    if (_init) {
+        // this consumer has already been initialized.
+        return Status::OK;
+    }
+
+    RdKafka::Conf *conf = RdKafka::Conf::create(RdKafka::Conf::CONF_GLOBAL);
+    
+    // conf has to be deleted finally
+    auto conf_deleter = [] (RdKafka::Conf *conf) { delete conf; };
+    DeferOp delete_conf(std::bind<void>(conf_deleter, conf));
+
+    std::string errstr;
+#define SET_KAFKA_CONF(conf_key, conf_val) \
 
 Review comment:
   use lambda instead

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to