Skip to content
Snippets Groups Projects
Commit 2d7c9575 authored by Victor Kotlyar's avatar Victor Kotlyar
Browse files

Put back drive parameter logging in scheduler.cpp

It was deleted by commit 19f05c41 but as soon as
scheduler code shared with frontend we need it.
parent 19f05c41
No related branches found
No related tags found
No related merge requests found
......@@ -349,7 +349,8 @@ common::dataStructures::DesiredDriveState Scheduler::getDesiredDriveState(const
if (d.driveName == driveName) {
auto schedulerDbTime = t.secs();
log::ScopedParamContainer spc(lc);
spc.add("schedulerDbTime", schedulerDbTime);
spc.add("drive", driveName)
.add("schedulerDbTime", schedulerDbTime);
lc.log(log::INFO, "In Scheduler::getDesiredDriveState(): success.");
return d.desiredDriveState;
}
......@@ -360,15 +361,16 @@ common::dataStructures::DesiredDriveState Scheduler::getDesiredDriveState(const
//------------------------------------------------------------------------------
// setDesiredDriveState
//------------------------------------------------------------------------------
void Scheduler::setDesiredDriveState(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &unitName, const bool up, const bool force, log::LogContext & lc) {
void Scheduler::setDesiredDriveState(const common::dataStructures::SecurityIdentity &cliIdentity, const std::string &driveName, const bool up, const bool force, log::LogContext & lc) {
utils::Timer t;
common::dataStructures::DesiredDriveState desiredDriveState;
desiredDriveState.up = up;
desiredDriveState.forceDown = force;
m_db.setDesiredDriveState(unitName, desiredDriveState);
m_db.setDesiredDriveState(driveName, desiredDriveState);
auto schedulerDbTime = t.secs();
log::ScopedParamContainer spc(lc);
spc.add("up", up?"up":"down")
spc.add("drive", driveName)
.add("up", up?"up":"down")
.add("force", force?"yes":"no")
.add("schedulerDbTime", schedulerDbTime);
lc.log(log::INFO, "In Scheduler::setDesiredDriveState(): success.");
......@@ -383,7 +385,8 @@ void Scheduler::reportDriveStatus(const common::dataStructures::DriveInfo& drive
m_db.reportDriveStatus(driveInfo, type, status, time(NULL));
auto schedulerDbTime = t.secs();
log::ScopedParamContainer spc(lc);
spc.add("schedulerDbTime", schedulerDbTime);
spc.add("drive", driveInfo.driveName)
.add("schedulerDbTime", schedulerDbTime);
lc.log(log::INFO, "In Scheduler::reportDriveStatus(): success.");
}
......
......@@ -209,12 +209,12 @@ public:
* object store for the requested drive status. The status is reset to down by the drives
* on hardware failures.
* @param cliIdentity The identity of the user requesting the drive to put up of down.
* @param unitName The drive name
* @param driveName The drive name
* @param up indicates whether the drive should be put up or down.
* @param force indicates whether we want to force the drive to be up.
*/ //TODO: replace the 2 bools with a structure.
void setDesiredDriveState(const cta::common::dataStructures::SecurityIdentity &cliIdentity,
const std::string &unitName, const bool up, const bool force, log::LogContext & lc);
const std::string &driveName, const bool up, const bool force, log::LogContext & lc);
/**
* Reports the state of the drive to the object store. This information is then reported
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment