mirror of https://github.com/milvus-io/milvus.git
fix: Remove duplicated Macro definition (#39076)
Issue: #39102 Signed-off-by: Cai Yudong <yudong.cai@zilliz.com>pull/39000/head
parent
8abf6c9149
commit
d6206ad2de
|
@ -22,10 +22,10 @@
|
|||
|
||||
namespace milvus {
|
||||
|
||||
#define THROW_FILE_WRITE_ERROR \
|
||||
#define THROW_FILE_WRITE_ERROR(path) \
|
||||
PanicInfo(ErrorCode::FileWriteFailed, \
|
||||
fmt::format("write data to file {} failed, error code {}", \
|
||||
file_.Path(), \
|
||||
path, \
|
||||
strerror(errno)));
|
||||
|
||||
class File {
|
||||
|
@ -145,7 +145,7 @@ class BufferedWriter {
|
|||
flush();
|
||||
ssize_t written_data_size = file_.FWrite(data, size);
|
||||
if (written_data_size != size) {
|
||||
THROW_FILE_WRITE_ERROR
|
||||
THROW_FILE_WRITE_ERROR(file_.Path())
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ class BufferedWriter {
|
|||
if (buffer_pos_ > 0) {
|
||||
ssize_t written_data_size = file_.FWrite(buffer_, buffer_pos_);
|
||||
if (written_data_size != buffer_pos_) {
|
||||
THROW_FILE_WRITE_ERROR
|
||||
THROW_FILE_WRITE_ERROR(file_.Path())
|
||||
}
|
||||
buffer_pos_ = 0;
|
||||
}
|
||||
|
|
|
@ -33,12 +33,6 @@
|
|||
|
||||
namespace milvus {
|
||||
|
||||
#define THROW_FILE_WRITE_ERROR \
|
||||
PanicInfo(ErrorCode::FileWriteFailed, \
|
||||
fmt::format("write data to file {} failed, error code {}", \
|
||||
file.Path(), \
|
||||
strerror(errno)));
|
||||
|
||||
/*
|
||||
* If string field's value all empty, need a string padding to avoid
|
||||
* mmap failing because size_ is zero which causing invalid argument
|
||||
|
@ -78,7 +72,7 @@ WriteFieldPadding(File& file, DataType data_type, uint64_t& total_written) {
|
|||
std::vector<char> padding(padding_size, 0);
|
||||
ssize_t written = file.Write(padding.data(), padding_size);
|
||||
if (written < padding_size) {
|
||||
THROW_FILE_WRITE_ERROR
|
||||
THROW_FILE_WRITE_ERROR(file.Path())
|
||||
}
|
||||
total_written += written;
|
||||
}
|
||||
|
@ -163,7 +157,7 @@ WriteFieldData(File& file,
|
|||
// write as: data|data|data|data|data|data......
|
||||
size_t written = file.FWrite(data->Data(), data->DataSize());
|
||||
if (written < data->DataSize()) {
|
||||
THROW_FILE_WRITE_ERROR
|
||||
THROW_FILE_WRITE_ERROR(file.Path())
|
||||
}
|
||||
for (auto i = 0; i < data->get_num_rows(); i++) {
|
||||
indices.emplace_back(total_written);
|
||||
|
|
Loading…
Reference in New Issue