Skip to content

Commit 940d4db

Browse files
committed
Update and refine code framework.
1 parent c123e3d commit 940d4db

File tree

14 files changed

+78
-43
lines changed

14 files changed

+78
-43
lines changed

be/src/exec/rowid_fetcher.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ Status RowIdStorageReader::read_by_rowids(const PMultiGetRequest& request,
422422
<< ", row_size:" << row_size;
423423
*response->add_row_locs() = row_loc;
424424
});
425-
// TODO: supoort session variable enable_page_cache and enable_file_cache_olap_tables if necessary.
425+
// TODO: supoort session variable enable_page_cache and disable_file_cache if necessary.
426426
SegmentCacheHandle segment_cache;
427427
RETURN_IF_ERROR(scope_timer_run(
428428
[&]() {

be/src/io/file_factory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ io::FileReaderOptions FileFactory::get_reader_options(RuntimeState* state,
6666
.mtime = fd.mtime,
6767
};
6868
if (config::enable_file_cache && state != nullptr &&
69-
state->query_options().__isset.enable_file_cache_external_catalogs &&
70-
state->query_options().enable_file_cache_external_catalogs) {
69+
state->query_options().__isset.enable_file_cache_external_catalog &&
70+
state->query_options().enable_file_cache_external_catalog) {
7171
opts.cache_type = io::FileCachePolicy::FILE_BLOCK_CACHE;
7272
}
7373
if (state != nullptr && state->query_options().__isset.file_cache_base_path &&

be/src/io/io_common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ struct IOContext {
7979
// FIXME(plat1ko): Seems `is_disposable` can be inferred from the `reader_type`?
8080
bool is_disposable = false;
8181
bool is_index_data = false;
82-
// have not been used in Doris
8382
bool read_file_cache = true;
8483
// TODO(lightman): use following member variables to control file cache
8584
bool is_persistent = false;

be/src/olap/rowset/beta_rowset_reader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ Status BetaRowsetReader::get_segment_iterators(RowsetReaderContext* read_context
221221
if (_read_context->runtime_state != nullptr) {
222222
_read_options.io_ctx.query_id = &_read_context->runtime_state->query_id();
223223
_read_options.io_ctx.is_disposable =
224-
!_read_context->runtime_state->query_options().enable_file_cache_olap_tables;
224+
!_read_context->runtime_state->query_options().enable_file_cache_olap_table;
225225
}
226226

227227
if (_read_context->condition_cache_digest) {

be/src/runtime/query_context.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ QueryContext::QueryContext(TUniqueId query_id, ExecEnv* exec_env,
113113

114114
bool initialize_context_holder =
115115
config::enable_file_cache && config::enable_file_cache_query_limit &&
116+
!(query_options.query_type == TQueryType::EXTERNAL &&
117+
!query_options.enable_file_cache_external_catalog) &&
116118
query_options.__isset.file_cache_query_limit_percent &&
117119
query_options.file_cache_query_limit_percent < 100;
118120

be/src/vec/exec/scan/file_scanner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Status FileScanner::init(RuntimeState* state, const VExprContextSPtrs& conjuncts
169169
RETURN_IF_ERROR(_init_io_ctx());
170170
_io_ctx->file_cache_stats = _file_cache_statistics.get();
171171
_io_ctx->file_reader_stats = _file_reader_stats.get();
172-
_io_ctx->is_disposable = !_state->query_options().enable_file_cache_external_catalogs;
172+
_io_ctx->is_disposable = !_state->query_options().enable_file_cache_external_catalog;
173173

174174
if (_is_load) {
175175
_src_row_desc.reset(new RowDescriptor(_state->desc_tbl(),
@@ -1812,7 +1812,7 @@ void FileScanner::update_realtime_counters() {
18121812

18131813
void FileScanner::_collect_profile_before_close() {
18141814
Scanner::_collect_profile_before_close();
1815-
if (config::enable_file_cache && _state->query_options().enable_file_cache_external_catalogs &&
1815+
if (config::enable_file_cache && _state->query_options().enable_file_cache_external_catalog &&
18161816
_profile != nullptr) {
18171817
io::FileCacheProfileReporter cache_profile(_profile);
18181818
cache_profile.update(_file_cache_statistics.get());

fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalScanNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public abstract class ExternalScanNode extends ScanNode {
4444
protected boolean needCheckColumnPriv;
4545

4646
protected final FederationBackendPolicy backendPolicy = (ConnectContext.get() != null
47-
&& (ConnectContext.get().getSessionVariable().enableFileCacheExternalCatalogs
47+
&& (ConnectContext.get().getSessionVariable().enableFileCacheExternalCatalog
4848
|| ConnectContext.get().getSessionVariable().getUseConsistentHashForExternalScan()))
4949
? new FederationBackendPolicy(NodeSelectionStrategy.CONSISTENT_HASHING)
5050
: new FederationBackendPolicy();

fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9135,15 +9135,14 @@ public LogicalPlan visitWarmUpSelect(DorisParser.WarmUpSelectContext ctx) {
91359135

91369136
LogicalProject project = new LogicalProject(projectList, filter);
91379137

9138-
if (Config.isNotCloudMode() && (!ConnectContext.get().getSessionVariable().isEnableFileCacheOlapTables()
9139-
&& !ConnectContext.get().getSessionVariable().isEnableFileCacheExternalCatalogs())) {
9138+
if (Config.isNotCloudMode() && !ConnectContext.get().getSessionVariable().isEnableFileCacheExternalCatalog()) {
91409139
throw new AnalysisException("WARM UP SELECT requires session variable"
9141-
+ " enable_file_cache_olap_tables=true or enable_file_cache_external_catalogs=true");
9140+
+ " enable_file_cache_external_catalog=true");
91429141
}
91439142

9144-
if (Config.isCloudMode() && !ConnectContext.get().getSessionVariable().isEnableFileCacheOlapTables()) {
9143+
if (Config.isCloudMode() && !ConnectContext.get().getSessionVariable().isEnableFileCacheOlapTable()) {
91459144
throw new AnalysisException("WARM UP SELECT requires session variable"
9146-
+ " enable_file_cache_olap_tables=true in cloud mode");
9145+
+ " enable_file_cache_olap_table=true in cloud mode");
91479146
}
91489147

91499148
UnboundBlackholeSink<?> sink = new UnboundBlackholeSink<>(project,

fe/fe-core/src/main/java/org/apache/doris/planner/OlapTableSink.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public void init(TUniqueId loadId, long txnId, long dbId, long loadChannelTimeou
156156
tSink.setLoadChannelTimeoutS(loadChannelTimeoutS);
157157
tSink.setSendBatchParallelism(sendBatchParallelism);
158158
tSink.setWriteFileCache(ConnectContext.get() != null
159-
? !ConnectContext.get().getSessionVariable().isDisableFileCache()
159+
? ConnectContext.get().getSessionVariable().isEnableFileCacheOlapTable()
160160
: false);
161161
this.isStrictMode = isStrictMode;
162162
this.txnId = txnId;

fe/fe-core/src/main/java/org/apache/doris/qe/NereidsCoordinator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public NereidsCoordinator(Long jobId, TUniqueId queryId, DescriptorTable descTab
130130
descTable, timezone, loadZeroTolerance, enableProfile
131131
);
132132
// same reason in `setForInsert`
133-
this.coordinatorContext.queryOptions.setEnableFileCacheOlapTables(false);
133+
this.coordinatorContext.queryOptions.setEnableFileCacheOlapTable(false);
134134
this.needEnqueue = false;
135135

136136
Preconditions.checkState(!fragments.isEmpty()
@@ -490,7 +490,7 @@ private void setForInsert(long jobId) {
490490
JobProcessor jobProc = new LoadProcessor(this.coordinatorContext, jobId);
491491
this.coordinatorContext.setJobProcessor(jobProc);
492492
// Set this field to true to avoid data entering the normal cache LRU queue
493-
this.coordinatorContext.queryOptions.setEnableFileCacheOlapTables(false);
493+
this.coordinatorContext.queryOptions.setEnableFileCacheOlapTable(false);
494494
this.coordinatorContext.queryOptions.setNewVersionUnixTimestamp(true);
495495
}
496496

0 commit comments

Comments
 (0)