Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Support use local file to accelerate the broker load #11196

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix review
  • Loading branch information
mchades committed Oct 9, 2022
commit 6009bd64af6e7210ec1df0ade61bbec38911735d
4 changes: 2 additions & 2 deletions be/src/exec/vectorized/file_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "storage/olap_define.h"
#include "storage/storage_engine.h"
#include "util/compression/stream_compression.h"
#include "util/uid_util.h"

namespace starrocks::vectorized {

Expand Down Expand Up @@ -284,8 +285,7 @@ std::string FileScanner::create_tmp_file_path() {

auto stores = StorageEngine::instance()->get_stores();
std::stringstream ss;
gettimeofday(&tv, nullptr); // for ensuring file path random
ss << stores[cur_sec % stores.size()]->path() << TMP_PREFIX << "/" << buf << "." << tv.tv_usec << ".tmp";
ss << stores[cur_sec % stores.size()]->path() << TMP_PREFIX << "/" << buf << "." << generate_uuid_string() << ".tmp";
return ss.str();
}

Expand Down
2 changes: 1 addition & 1 deletion be/src/fs/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class RandomAccessFile : public io::SeekableInputStreamWrapper {
// Wrap `RandomAccessFile`
class TempRandomAccessFile : public RandomAccessFile {
public:
TempRandomAccessFile(std::string filename, std::shared_ptr<RandomAccessFile> file)
TempRandomAccessFile(const std::string& filename, std::shared_ptr<RandomAccessFile> file)
: RandomAccessFile(file->stream(), filename), _filename(filename), _file(std::move(file)) {}
~TempRandomAccessFile() { FileSystem::Default()->delete_file(_filename); }

Expand Down