imay commented on a change in pull request #1798: Optimize the load performance for large file URL: https://github.com/apache/incubator-doris/pull/1798#discussion_r326090612
########## File path: be/src/runtime/tablets_channel.h ########## @@ -0,0 +1,122 @@ +// 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 <cstdint> +#include <vector> +#include <unordered_map> +#include <utility> + +#include "runtime/descriptors.h" +#include "runtime/mem_tracker.h" +#include "util/bitmap.h" +#include "util/thread_pool.hpp" + +#include "gen_cpp/Types_types.h" +#include "gen_cpp/PaloInternalService_types.h" +#include "gen_cpp/internal_service.pb.h" + +namespace doris { + +struct TabletsChannelKey { + UniqueId id; + int64_t index_id; + + TabletsChannelKey(const PUniqueId& pid, int64_t index_id_) + : id(pid), index_id(index_id_) { } + + ~TabletsChannelKey() noexcept { } + + bool operator==(const TabletsChannelKey& rhs) const noexcept { + return index_id == rhs.index_id && id == rhs.id; + } + + std::string to_string() const; +}; + +struct TabletsChannelKeyHasher { + std::size_t operator()(const TabletsChannelKey& key) const { + size_t seed = key.id.hash(); + return doris::HashUtil::hash(&key.index_id, sizeof(key.index_id), seed); + } +}; + +class DeltaWriter; +class MemTable; +class MemTableFlushExecutor; +class OlapTableSchemaParam; + +// channel that process all data for this load +class TabletsChannel { +public: + TabletsChannel(const TabletsChannelKey& key, MemTableFlushExecutor* flush_executor); + + ~TabletsChannel(); + + Status open(const PTabletWriterOpenRequest& params); + + Status add_batch(const PTabletWriterAddBatchRequest& batch); + + Status close(int sender_id, bool* finished, + const google::protobuf::RepeatedField<int64_t>& partition_ids, + google::protobuf::RepeatedPtrField<PTabletInfo>* tablet_vec); + + time_t last_updated_time() { + return _last_updated_time; + } + +private: + // open all writer + Status _open_all_writers(const PTabletWriterOpenRequest& params); + +private: + // id of this load channel + TabletsChannelKey _key; + MemTableFlushExecutor* _flush_executor; Review comment: Better not to store this in TabletChannel, this is storage engine internal. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org