提交 426d4c3c 编写于 作者: B barrierye

remove redundant code, and make executor exit when set a illegal queue size

上级 9c1a964a
...@@ -143,8 +143,7 @@ void PrepareReaders(std::vector<std::shared_ptr<DataFeed> >& readers, ...@@ -143,8 +143,7 @@ void PrepareReaders(std::vector<std::shared_ptr<DataFeed> >& readers,
readers.resize(thread_num); readers.resize(thread_num);
for (size_t i = 0; i < readers.size(); ++i) { for (size_t i = 0; i < readers.size(); ++i) {
readers[i] = DataFeedFactory::CreateDataFeed(data_feed_desc.name()); readers[i] = DataFeedFactory::CreateDataFeed(data_feed_desc.name());
readers[i]->Init(data_feed_desc); // set batch size here readers[i]->Init(data_feed_desc); // set batch_size and queue_size here
//readers[i]->SetQueueSize(32); // default is 32
} }
readers[0]->SetFileList(filelist); readers[0]->SetFileList(filelist);
} }
......
...@@ -60,7 +60,7 @@ bool DataFeed::SetFileList(const std::vector<std::string>& files) { ...@@ -60,7 +60,7 @@ bool DataFeed::SetFileList(const std::vector<std::string>& files) {
CheckInit(); CheckInit();
if (files.size() == 0) { if (files.size() == 0) {
LOG(ERROR) << "error: you have set an empty filelist"; LOG(ERROR) << "error: you have set an empty filelist";
return false; exit(-1);
} }
filelist_.assign(files.begin(), files.end()); filelist_.assign(files.begin(), files.end());
file_idx_ = 0; file_idx_ = 0;
...@@ -100,7 +100,7 @@ template<typename T> ...@@ -100,7 +100,7 @@ template<typename T>
void PrivateQueueDataFeed<T>::SetQueueSize(int queue_size) { void PrivateQueueDataFeed<T>::SetQueueSize(int queue_size) {
if (queue_size <= 0) { if (queue_size <= 0) {
LOG(ERROR) << "error: illegal queue size: " << queue_size; LOG(ERROR) << "error: illegal queue size: " << queue_size;
return; exit(-1);
} }
queue_size_ = queue_size; queue_size_ = queue_size;
queue_.ReCap(queue_size_); queue_.ReCap(queue_size_);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册