imay commented on a change in pull request #450: Add EsScanNode
URL: https://github.com/apache/incubator-doris/pull/450#discussion_r243200786
 
 

 ##########
 File path: be/src/exec/es_scan_node.h
 ##########
 @@ -0,0 +1,78 @@
+// 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.
+
+#ifndef  BDG_PALO_BE_SRC_QUERY_EXEC_ES_SCAN_NODE_H
+#define  BDG_PALO_BE_SRC_QUERY_EXEC_ES_SCAN_NODE_H
+
+#include <memory>
+#include <vector>
+
+#include "runtime/descriptors.h"
+#include "runtime/tuple.h"
+#include "exec/scan_node.h"
+#include "runtime/exec_env.h"
+#include "gen_cpp/TExtDataSourceService.h"
+#include "gen_cpp/PaloExternalDataSourceService_types.h"
+
+namespace doris {
+
+class TupleDescriptor;
+class RuntimeState;
+class Status;
+
+class EsScanNode : public ScanNode {
+public:
+    EsScanNode(ObjectPool* pool, const TPlanNode& tnode, const DescriptorTbl& 
descs);
+    ~EsScanNode();
+
+    virtual Status prepare(RuntimeState* state) override;
+    virtual Status open(RuntimeState* state) override;
+    virtual Status get_next(RuntimeState* state, RowBatch* row_batch, bool* 
eos) override;
+    virtual Status close(RuntimeState* state) override;
+    virtual Status set_scan_ranges(const std::vector<TScanRangeParams>& 
scan_ranges) override;
+
+protected:
+    // Write debug string of this into out.
+    virtual void debug_string(int indentation_level, std::stringstream* out) 
const;
+
+private:
+    TupleId _tuple_id;
+    std::map<std::string, std::string> _properties;
+    const TupleDescriptor* _tuple_desc;
+    ExecEnv* _env;
+    std::vector<TEsScanRange> _scan_ranges;
+
+    // scan range's iterator, used in get_next()
+    int _scan_range_idx;
+
+    // store every scan range's netaddress/handle/offset
+    std::vector<TNetworkAddress> _addresses;
+    std::vector<std::string> _scan_handles;
+    std::vector<int> _offsets;
+
+    Status open_es(TNetworkAddress& address, TExtOpenResult& result, 
TExtOpenParams& params);
 
 Review comment:
   put these functions before member variables

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@doris.apache.org
For additional commands, e-mail: dev-h...@doris.apache.org

Reply via email to