Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion be/src/vec/spill/spill_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include <algorithm>

#include "common/cast_set.h"
#include "common/exception.h"
#include "io/file_factory.h"
#include "io/fs/file_reader.h"
Expand All @@ -27,6 +28,7 @@
#include "util/slice.h"
#include "vec/core/block.h"
namespace doris {
#include "common/compile_check_begin.h"
namespace io {
class FileSystem;
} // namespace io
Expand Down Expand Up @@ -113,7 +115,7 @@ Status SpillReader::read(Block* block, bool* eos) {
if (bytes_read > 0) {
{
SCOPED_TIMER(deserialize_timer_);
if (!pb_block_.ParseFromArray(result.data, result.size)) {
if (!pb_block_.ParseFromArray(result.data, cast_set<int>(result.size))) {
return Status::InternalError("Failed to read spilled block");
}
RETURN_IF_ERROR(block->deserialize(pb_block_));
Expand Down
4 changes: 3 additions & 1 deletion be/src/vec/spill/spill_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "util/runtime_profile.h"

namespace doris::vectorized {
#include "common/compile_check_begin.h"
class Block;
class SpillReader {
public:
Expand Down Expand Up @@ -78,4 +79,5 @@ class SpillReader {

using SpillReaderUPtr = std::unique_ptr<SpillReader>;

} // namespace doris::vectorized
} // namespace doris::vectorized
#include "common/compile_check_end.h"
1 change: 1 addition & 0 deletions be/src/vec/spill/spill_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "vec/spill/spill_writer.h"

namespace doris::vectorized {
#include "common/compile_check_begin.h"
SpillStream::SpillStream(RuntimeState* state, int64_t stream_id, SpillDataDir* data_dir,
std::string spill_dir, size_t batch_rows, size_t batch_bytes,
RuntimeProfile* profile)
Expand Down
4 changes: 3 additions & 1 deletion be/src/vec/spill/spill_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "vec/spill/spill_writer.h"

namespace doris {
#include "common/compile_check_begin.h"
class RuntimeProfile;
class ThreadPool;

Expand Down Expand Up @@ -109,4 +110,5 @@ class SpillStream {
};
using SpillStreamSPtr = std::shared_ptr<SpillStream>;
} // namespace vectorized
} // namespace doris
} // namespace doris
#include "common/compile_check_end.h"
10 changes: 5 additions & 5 deletions be/src/vec/spill/spill_stream_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "vec/spill/spill_stream.h"

namespace doris::vectorized {
#include "common/compile_check_begin.h"

SpillStreamManager::SpillStreamManager(
std::unordered_map<std::string, std::unique_ptr<vectorized::SpillDataDir>>&&
Expand Down Expand Up @@ -350,8 +351,8 @@ Status SpillDataDir::update_capacity() {
&_available_bytes));
spill_disk_capacity->set_value(_disk_capacity_bytes);
spill_disk_avail_capacity->set_value(_available_bytes);
auto disk_use_max_bytes = (int64_t)(_disk_capacity_bytes *
config::storage_flood_stage_usage_percent / (double)100);
auto disk_use_max_bytes =
(int64_t)(_disk_capacity_bytes * config::storage_flood_stage_usage_percent / 100);
bool is_percent = true;
_spill_data_limit_bytes = ParseUtil::parse_mem_spec(config::spill_storage_limit, -1,
_disk_capacity_bytes, &is_percent);
Expand All @@ -363,9 +364,8 @@ Status SpillDataDir::update_capacity() {
return Status::InvalidArgument(err_msg);
}
if (is_percent) {
_spill_data_limit_bytes =
(int64_t)(_spill_data_limit_bytes * config::storage_flood_stage_usage_percent /
(double)100);
_spill_data_limit_bytes = (int64_t)(_spill_data_limit_bytes *
config::storage_flood_stage_usage_percent / 100);
}
if (_spill_data_limit_bytes > disk_use_max_bytes) {
_spill_data_limit_bytes = disk_use_max_bytes;
Expand Down
6 changes: 4 additions & 2 deletions be/src/vec/spill/spill_stream_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "util/threadpool.h"
#include "vec/spill/spill_stream.h"
namespace doris {
#include "common/compile_check_begin.h"
class RuntimeProfile;

namespace vectorized {
Expand Down Expand Up @@ -77,7 +78,7 @@ class SpillDataDir {
double _get_disk_usage(int64_t incoming_data_size) const {
return _disk_capacity_bytes == 0
? 0
: (_disk_capacity_bytes - _available_bytes + incoming_data_size) /
: (double)(_disk_capacity_bytes - _available_bytes + incoming_data_size) /
(double)_disk_capacity_bytes;
}

Expand Down Expand Up @@ -146,4 +147,5 @@ class SpillStreamManager {
std::atomic_uint64_t id_ = 0;
};
} // namespace vectorized
} // namespace doris
} // namespace doris
#include "common/compile_check_end.h"
1 change: 1 addition & 0 deletions be/src/vec/spill/spill_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "vec/spill/spill_stream_manager.h"

namespace doris::vectorized {
#include "common/compile_check_begin.h"
Status SpillWriter::open() {
if (file_writer_) {
return Status::OK();
Expand Down
3 changes: 3 additions & 0 deletions be/src/vec/spill/spill_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "util/runtime_profile.h"
#include "vec/core/block.h"
namespace doris {
#include "common/compile_check_begin.h"
class RuntimeState;

namespace vectorized {
Expand Down Expand Up @@ -86,3 +87,5 @@ class SpillWriter {
using SpillWriterUPtr = std::unique_ptr<SpillWriter>;
} // namespace vectorized
} // namespace doris

#include "common/compile_check_end.h"