You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/05/05 18:37:28 UTC
[incubator-doris] branch master updated: remove file result writer from result sink (#9378)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new e3b90de2d5 remove file result writer from result sink (#9378)
e3b90de2d5 is described below
commit e3b90de2d5170f31bbc5f9b15c2d6ab3a9ac597f
Author: yiguolei <67...@qq.com>
AuthorDate: Fri May 6 02:37:20 2022 +0800
remove file result writer from result sink (#9378)
---
be/src/runtime/file_result_writer.cpp | 22 ----------------------
be/src/runtime/file_result_writer.h | 5 -----
be/src/runtime/result_sink.cpp | 12 ------------
be/src/runtime/result_sink.h | 2 --
be/src/vec/sink/result_sink.cpp | 12 ------------
gensrc/thrift/DataSinks.thrift | 4 ++--
6 files changed, 2 insertions(+), 55 deletions(-)
diff --git a/be/src/runtime/file_result_writer.cpp b/be/src/runtime/file_result_writer.cpp
index 52153290d4..2997a269e6 100644
--- a/be/src/runtime/file_result_writer.cpp
+++ b/be/src/runtime/file_result_writer.cpp
@@ -44,28 +44,6 @@ namespace doris {
const size_t FileResultWriter::OUTSTREAM_BUFFER_SIZE_BYTES = 1024 * 1024;
-// deprecated
-FileResultWriter::FileResultWriter(const ResultFileOptions* file_opts,
- const std::vector<ExprContext*>& output_expr_ctxs,
- RuntimeProfile* parent_profile, BufferControlBlock* sinker,
- bool output_object_data)
- : _file_opts(file_opts),
- _output_expr_ctxs(output_expr_ctxs),
- _parent_profile(parent_profile),
- _sinker(sinker) {
- if (_file_opts->is_local_file) {
- _storage_type = TStorageBackendType::LOCAL;
- } else {
- _storage_type = TStorageBackendType::BROKER;
- }
- // The new file writer needs to use fragment instance id as part of the file prefix.
- // But during the upgrade process, the old version of fe will be called to the new version of be,
- // resulting in no such attribute. So we need a mock here.
- _fragment_instance_id.hi = 12345678987654321;
- _fragment_instance_id.lo = 98765432123456789;
- _output_object_data = output_object_data;
-}
-
FileResultWriter::FileResultWriter(const ResultFileOptions* file_opts,
const TStorageBackendType::type storage_type,
const TUniqueId fragment_instance_id,
diff --git a/be/src/runtime/file_result_writer.h b/be/src/runtime/file_result_writer.h
index a91c8c4b54..b8d9f71d77 100644
--- a/be/src/runtime/file_result_writer.h
+++ b/be/src/runtime/file_result_writer.h
@@ -77,11 +77,6 @@ class BufferControlBlock;
// write result to file
class FileResultWriter final : public ResultWriter {
public:
- // [[deprecated]]
- FileResultWriter(const ResultFileOptions* file_option,
- const std::vector<ExprContext*>& output_expr_ctxs,
- RuntimeProfile* parent_profile, BufferControlBlock* sinker,
- bool output_object_data);
FileResultWriter(const ResultFileOptions* file_option,
const TStorageBackendType::type storage_type,
const TUniqueId fragment_instance_id,
diff --git a/be/src/runtime/result_sink.cpp b/be/src/runtime/result_sink.cpp
index b079037e24..b0d9c5f85a 100644
--- a/be/src/runtime/result_sink.cpp
+++ b/be/src/runtime/result_sink.cpp
@@ -43,11 +43,6 @@ ResultSink::ResultSink(const RowDescriptor& row_desc, const std::vector<TExpr>&
_sink_type = sink.type;
}
- if (_sink_type == TResultSinkType::FILE) {
- CHECK(sink.__isset.file_options);
- _file_opts.reset(new ResultFileOptions(sink.file_options));
- }
-
_name = "ResultSink";
}
@@ -81,13 +76,6 @@ Status ResultSink::prepare(RuntimeState* state) {
_writer.reset(new (std::nothrow) MysqlResultWriter(
_sender.get(), _output_expr_ctxs, _profile, state->return_object_data_as_binary()));
break;
- // deprecated
- case TResultSinkType::FILE:
- CHECK(_file_opts.get() != nullptr);
- _writer.reset(new (std::nothrow) FileResultWriter(_file_opts.get(), _output_expr_ctxs,
- _profile, _sender.get(),
- state->return_object_data_as_binary()));
- break;
default:
return Status::InternalError("Unknown result sink type");
}
diff --git a/be/src/runtime/result_sink.h b/be/src/runtime/result_sink.h
index 1150d8295e..a39ceb4643 100644
--- a/be/src/runtime/result_sink.h
+++ b/be/src/runtime/result_sink.h
@@ -59,8 +59,6 @@ public:
private:
Status prepare_exprs(RuntimeState* state);
TResultSinkType::type _sink_type;
- // set file options when sink type is FILE
- std::unique_ptr<ResultFileOptions> _file_opts;
// Owned by the RuntimeState.
const RowDescriptor& _row_desc;
diff --git a/be/src/vec/sink/result_sink.cpp b/be/src/vec/sink/result_sink.cpp
index ea226ef0fc..9441fec8b9 100644
--- a/be/src/vec/sink/result_sink.cpp
+++ b/be/src/vec/sink/result_sink.cpp
@@ -37,11 +37,6 @@ VResultSink::VResultSink(const RowDescriptor& row_desc, const std::vector<TExpr>
_sink_type = sink.type;
}
- if (_sink_type == TResultSinkType::FILE) {
- CHECK(sink.__isset.file_options);
- _file_opts.reset(new ResultFileOptions(sink.file_options));
- }
-
_name = "ResultSink";
}
@@ -75,13 +70,6 @@ Status VResultSink::prepare(RuntimeState* state) {
_writer.reset(new (std::nothrow)
VMysqlResultWriter(_sender.get(), _output_vexpr_ctxs, _profile));
break;
- case TResultSinkType::FILE:
- CHECK(_file_opts.get() != nullptr);
- return Status::InternalError("Unsupport vfile result sink type");
- // TODO:
- /* _writer.reset(new (std::nothrow) FileResultWriter(_file_opts.get(), _output_expr_ctxs,*/
- /*_profile, _sender.get()));*/
- // break;
default:
return Status::InternalError("Unknown result sink type");
}
diff --git a/gensrc/thrift/DataSinks.thrift b/gensrc/thrift/DataSinks.thrift
index 450464b236..1eaede3f9b 100644
--- a/gensrc/thrift/DataSinks.thrift
+++ b/gensrc/thrift/DataSinks.thrift
@@ -38,7 +38,7 @@ enum TDataSinkType {
enum TResultSinkType {
MYSQL_PROTOCAL,
- FILE
+ FILE, // deprecated, should not be used any more. FileResultSink is covered by TRESULT_FILE_SINK for concurrent purpose.
}
struct TResultFileSinkOptions {
@@ -75,7 +75,7 @@ struct TDataStreamSink {
struct TResultSink {
1: optional TResultSinkType type;
- 2: optional TResultFileSinkOptions file_options
+ 2: optional TResultFileSinkOptions file_options // deprecated
}
struct TResultFileSink {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org