Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
1daidai1 committed Dec 11, 2024
1 parent bf52d55 commit 9ba39df
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 37 deletions.
17 changes: 0 additions & 17 deletions src/CraneCtld/AccountManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,11 +898,7 @@ bool AccountManager::CheckUserPermissionToPartition(
return false;
}

<<<<<<< HEAD
std::expected<void, std::string> AccountManager::CheckIfUserOfAccountIsEnabled(
=======
CraneErrCodeExpected<void> AccountManager::CheckIfUserOfAccountIsEnabled(
>>>>>>> 2d88fb3 (use codeErr type)
const std::string& user, const std::string& account) {
util::read_lock_guard user_guard(m_rw_user_mutex_);
util::read_lock_guard account_guard(m_rw_account_mutex_);
Expand All @@ -911,23 +907,14 @@ CraneErrCodeExpected<void> AccountManager::CheckIfUserOfAccountIsEnabled(
do {
const Account* account_ptr = GetExistedAccountInfoNoLock_(account_name);
if (account_ptr->blocked) {
<<<<<<< HEAD
return std::unexpected(
fmt::format("Ancestor account '{}' is blocked", account_ptr->name));
=======
return std::unexpected(crane::grpc::ErrCode::ERR_BLOCKED_ACCOUNT);
>>>>>>> 2d88fb3 (use codeErr type)
}
account_name = account_ptr->parent_account;
} while (!account_name.empty());

const User* user_ptr = GetExistedUserInfoNoLock_(user);
if (user_ptr->account_to_attrs_map.at(account).blocked) {
<<<<<<< HEAD
return std::unexpected(fmt::format("User '{}' is blocked", user_ptr->name));
=======
return std::unexpected(crane::grpc::ErrCode::ERR_BLOCKED_USER);
>>>>>>> 2d88fb3 (use codeErr type)
}
return {};
}
Expand Down Expand Up @@ -1001,11 +988,7 @@ AccountManager::CraneExpected<void> AccountManager::CheckAndApplyQosLimitOnTask(
}

return {};
<<<<<<< HEAD
}}
=======
}
>>>>>>> 2d88fb3 (use codeErr type)

std::expected<void, std::string> AccountManager::CheckUidIsAdmin(
uint32_t uid) {
Expand Down
4 changes: 0 additions & 4 deletions src/CraneCtld/AccountManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,7 @@ class AccountManager {
const std::string& account,
const std::string& partition);

<<<<<<< HEAD
std::expected<void, std::string> CheckIfUserOfAccountIsEnabled(
=======
CraneErrCodeExpected<void> CheckIfUserOfAccountIsEnabled(
>>>>>>> 2d88fb3 (use codeErr type)
const std::string& user, const std::string& account);

CraneExpected<void> CheckAndApplyQosLimitOnTask(const std::string& user,
Expand Down
12 changes: 0 additions & 12 deletions src/CraneCtld/CtldGrpcServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ grpc::Status CraneCtldServiceImpl::SubmitBatchTasks(
grpc::ServerContext *context,
const crane::grpc::SubmitBatchTasksRequest *request,
crane::grpc::SubmitBatchTasksReply *response) {
<<<<<<< HEAD
std::vector<std::expected<std::future<task_id_t>, std::string>> results;
=======
std::vector<CraneErrCodeExpected<std::future<task_id_t>>> results;
>>>>>>> 2d88fb3 (use codeErr type)

uint32_t task_count = request->count();
const auto &task_to_ctld = request->task();
Expand Down Expand Up @@ -817,11 +813,7 @@ grpc::Status CraneCtldServiceImpl::CforedStream(
result = std::expected<task_id_t, std::string>{
submit_result.value().get()};
} else {
<<<<<<< HEAD
result = std::unexpected(submit_result.error());
=======
result = result::fail(CraneErrCodeStr(submit_result.error()));
>>>>>>> 2d88fb3 (use codeErr type)
}
ok = stream_writer->WriteTaskIdReply(payload.pid(), result);

Expand Down Expand Up @@ -990,11 +982,7 @@ CtldServer::SubmitTaskToScheduler(std::unique_ptr<TaskInCtld> task) {
return {std::move(future)};
}

<<<<<<< HEAD
return std::unexpected(result.error());}
=======
return std::unexpected(result.error());
}
>>>>>>> 2d88fb3 (use codeErr type)

} // namespace Ctld
4 changes: 0 additions & 4 deletions src/CraneCtld/CtldGrpcServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,7 @@ class CtldServer {

inline void Wait() { m_server_->Wait(); }

<<<<<<< HEAD
std::expected<std::future<task_id_t>, std::string> SubmitTaskToScheduler(
=======
CraneErrCodeExpected <std::future<task_id_t>> SubmitTaskToScheduler(
>>>>>>> 2d88fb3 (use codeErr type)
std::unique_ptr<TaskInCtld> task);

private:
Expand Down

0 comments on commit 9ba39df

Please sign in to comment.