Skip to content

Commit

Permalink
Merge branch 'branch-3.0' into pick_42224_to_apache_branch-3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokang authored Oct 25, 2024
2 parents 58a22bd + 965bd37 commit 98f77bc
Show file tree
Hide file tree
Showing 98 changed files with 5,519 additions and 1,078 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/auto-cherry-pick.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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.
#
name: Auto Cherry-Pick to Branch

on:
pull_request:
types:
- closed
branches:
- master

jobs:
auto_cherry_pick:
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'dev/3.0.x') && github.event.pull_request.merged == true }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
pip install PyGithub
- name: Auto cherry-pick
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_NAME: ${{ github.repository }}
CONFLICT_LABEL: cherry-pick-conflict-in-3.0
run: |
python tools/auto-pick-script.py ${{ github.event.pull_request.number }} branch-3.0
6 changes: 4 additions & 2 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,8 +1098,8 @@ DEFINE_mInt32(schema_cache_sweep_time_sec, "100");
// max number of segment cache, default -1 for backward compatibility fd_number*2/5
DEFINE_Int32(segment_cache_capacity, "-1");
DEFINE_Int32(segment_cache_fd_percentage, "20");
DEFINE_mInt32(estimated_mem_per_column_reader, "1024");
DEFINE_Int32(segment_cache_memory_percentage, "2");
DEFINE_mInt32(estimated_mem_per_column_reader, "512");
DEFINE_Int32(segment_cache_memory_percentage, "5");

// enable feature binlog, default false
DEFINE_Bool(enable_feature_binlog, "false");
Expand Down Expand Up @@ -1374,6 +1374,8 @@ DEFINE_mInt32(lz4_compression_block_size, "262144");

DEFINE_mBool(enable_pipeline_task_leakage_detect, "false");

DEFINE_Int32(query_cache_size, "512");

// clang-format off
#ifdef BE_TEST
// test s3
Expand Down
3 changes: 3 additions & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,9 @@ DECLARE_mInt32(lz4_compression_block_size);

DECLARE_mBool(enable_pipeline_task_leakage_detect);

// MB
DECLARE_Int32(query_cache_size);

#ifdef BE_TEST
// test s3
DECLARE_String(test_s3_resource);
Expand Down
7 changes: 7 additions & 0 deletions be/src/pipeline/dependency.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "pipeline/exec/join/process_hash_table_probe.h"
#include "vec/common/sort/partition_sorter.h"
#include "vec/common/sort/sorter.h"
#include "vec/core/block.h"
#include "vec/core/types.h"
#include "vec/spill/spill_stream.h"

Expand Down Expand Up @@ -541,6 +542,12 @@ struct UnionSharedState : public BasicSharedState {
const int _child_count;
};

struct CacheSharedState : public BasicSharedState {
ENABLE_FACTORY_CREATOR(CacheSharedState)
public:
DataQueue data_queue;
};

class MultiCastDataStreamer;

struct MultiCastSharedState : public BasicSharedState {
Expand Down
73 changes: 73 additions & 0 deletions be/src/pipeline/exec/cache_sink_operator.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// 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 "cache_sink_operator.h"

#include <utility>

#include "common/compiler_util.h" // IWYU pragma: keep
#include "common/status.h"
#include "pipeline/exec/data_queue.h"
#include "pipeline/exec/operator.h"
#include "runtime/runtime_state.h"
#include "util/runtime_profile.h"

namespace doris::pipeline {

Status CacheSinkLocalState::init(RuntimeState* state, LocalSinkStateInfo& info) {
RETURN_IF_ERROR(Base::init(state, info));
SCOPED_TIMER(exec_time_counter());
SCOPED_TIMER(_init_timer);
_shared_state->data_queue.set_sink_dependency(_dependency, 0);
return Status::OK();
}

Status CacheSinkLocalState::open(RuntimeState* state) {
SCOPED_TIMER(exec_time_counter());
SCOPED_TIMER(_open_timer);
RETURN_IF_ERROR(Base::open(state));
// auto& p = _parent->cast<Parent>();

_shared_state->data_queue.set_max_blocks_in_sub_queue(state->data_queue_max_blocks());
return Status::OK();
}

CacheSinkOperatorX::CacheSinkOperatorX(int sink_id, int child_id)
: Base(sink_id, child_id, child_id) {
_name = "CACHE_SINK_OPERATOR";
}

Status CacheSinkOperatorX::open(RuntimeState* state) {
return Status::OK();
}

Status CacheSinkOperatorX::sink(RuntimeState* state, vectorized::Block* in_block, bool eos) {
auto& local_state = get_local_state(state);
SCOPED_TIMER(local_state.exec_time_counter());
COUNTER_UPDATE(local_state.rows_input_counter(), (int64_t)in_block->rows());

if (in_block->rows() > 0) {
local_state._shared_state->data_queue.push_block(
vectorized::Block::create_unique(std::move(*in_block)), 0);
}
if (UNLIKELY(eos)) {
local_state._shared_state->data_queue.set_finish(0);
}
return Status::OK();
}

} // namespace doris::pipeline
73 changes: 73 additions & 0 deletions be/src/pipeline/exec/cache_sink_operator.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// 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.

#pragma once

#include <stdint.h>

#include <memory>

#include "common/status.h"
#include "operator.h"
#include "vec/core/block.h"

namespace doris {
class RuntimeState;

namespace pipeline {
class DataQueue;

class CacheSinkOperatorX;
class CacheSinkLocalState final : public PipelineXSinkLocalState<CacheSharedState> {
public:
ENABLE_FACTORY_CREATOR(CacheSinkLocalState);
CacheSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state) : Base(parent, state) {}
Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
Status open(RuntimeState* state) override;
friend class CacheSinkOperatorX;
using Base = PipelineXSinkLocalState<CacheSharedState>;
using Parent = CacheSinkOperatorX;
};

class CacheSinkOperatorX final : public DataSinkOperatorX<CacheSinkLocalState> {
public:
using Base = DataSinkOperatorX<CacheSinkLocalState>;

friend class CacheSinkLocalState;
CacheSinkOperatorX(int sink_id, int child_id);
~CacheSinkOperatorX() override = default;
Status init(const TDataSink& tsink) override {
return Status::InternalError("{} should not init with TDataSink",
DataSinkOperatorX<CacheSinkLocalState>::_name);
}

Status open(RuntimeState* state) override;

Status sink(RuntimeState* state, vectorized::Block* in_block, bool eos) override;

std::shared_ptr<BasicSharedState> create_shared_state() const override {
std::shared_ptr<BasicSharedState> ss = std::make_shared<CacheSharedState>();
ss->id = operator_id();
for (auto& dest : dests_id()) {
ss->related_op_ids.insert(dest);
}
return ss;
}
};

} // namespace pipeline
} // namespace doris
Loading

0 comments on commit 98f77bc

Please sign in to comment.