Commit a599d161 authored by Steven Murray's avatar Steven Murray
Browse files

Revert "Added the IScheduler class"

This reverts commit 2dc2976e.

Conflicts:

	scheduler/CMakeLists.txt
parent 177946ac
......@@ -11,7 +11,7 @@ set (CTA_SCHEDULER_SRC_FILES
ArchiveToDirRequest.cpp
ArchiveToFileRequest.cpp
ArchiveToTapeCopyRequest.cpp
IScheduler.cpp
TapeMount.cpp
LogicalLibrary.cpp
mockDB/MockSchedulerDatabase.cpp
mockDB/MockSchedulerDatabaseFactory.cpp
......@@ -28,8 +28,9 @@ set (CTA_SCHEDULER_SRC_FILES
Scheduler.cpp
SchedulerDatabase.cpp
SchedulerDatabaseFactory.cpp
TapeJobFailure.cpp
TapeMount.cpp
mockDB/SqliteColumnNameToIndex.cpp
mockDB/SQLiteStatementDeleter.cpp
MountType.cpp
UserRequest.cpp)
add_library (ctascheduler SHARED
......
......@@ -43,6 +43,14 @@
#include "scheduler/SchedulerDatabase.hpp"
#include "scheduler/TapeMount.hpp"
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
cta::DummyScheduler::DummyScheduler(NameServer &ns,
SchedulerDatabase &db,
RemoteNS &remoteNS): Scheduler(ns, db, remoteNS) {
}
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
......
......@@ -18,7 +18,7 @@
#pragma once
#include "scheduler/IScheduler.hpp"
#include "scheduler/Scheduler.hpp"
#include <memory>
......@@ -27,9 +27,21 @@ namespace cta {
/**
* Class implementimg a dummy tape resource scheduler.
*/
class DummyScheduler: public IScheduler {
class DummyScheduler: public Scheduler {
public:
/**
* Constructor.
*
* @param ns The name server containing the namespace of the archive.
* @param db The scheduler database.
* @param remoteNS The name space of the remote storage system.
*/
DummyScheduler(
NameServer &ns,
SchedulerDatabase &db,
RemoteNS &remoteNS);
/**
* Destructor.
*/
......
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/IScheduler.hpp"
//------------------------------------------------------------------------------
// destructor
//------------------------------------------------------------------------------
cta::IScheduler::~IScheduler() throw() {
}
This diff is collapsed.
......@@ -48,6 +48,20 @@
#include <sys/stat.h>
#include <unistd.h>
//------------------------------------------------------------------------------
// TransferFailureToStr
//------------------------------------------------------------------------------
const char *cta::Scheduler::TransferFailureToStr(
const TapeJobFailure enumValue) throw() {
switch(enumValue) {
case JOBFAILURE_NONE : return "NONE";
case JOBFAILURE_TAPEDRIVE : return "TAPE DRIVE";
case JOBFAILURE_TAPELIBRARY : return "TAPE LIBRARY";
case JOBFAILURE_REMOTESTORAGE: return "REMOTE STORAGE";
default : return "UNKNOWN";
}
}
//------------------------------------------------------------------------------
// constructor
//------------------------------------------------------------------------------
......
......@@ -18,16 +18,68 @@
#pragma once
#include "scheduler/IScheduler.hpp"
#include "scheduler/SchedulerDatabase.hpp"
#include "common/exception/Exception.hpp"
#include <list>
#include <map>
#include <memory>
#include <stdint.h>
#include <string>
namespace cta {
// Forward declarations for opaque references.
class AdminHost;
class AdminUser;
class ArchiveFileStatus;
class ArchiveRoute;
class ArchiveToDirRequest;
class ArchiveToFileRequest;
class ArchiveToTapeCopyRequest;
class ArchiveDirIterator;
class LogicalLibrary;
class NameServer;
class RemoteNS;
class RemotePathAndStatus;
class RetrieveFromTapeCopyRequest;
class RetrieveToDirRequest;
class RetrieveToFileRequest;
class SchedulerDatabase;
class SecurityIdentity;
class StorageClass;
class Tape;
class TapeMount;
class TapeSession;
class TapePool;
class UserIdentity;
/**
* Class implementimg a tape resource scheduler.
*/
class Scheduler: public IScheduler {
class Scheduler {
public:
/**
* An enumeration of the different types of tape job failures.
*/
enum TapeJobFailure {
JOBFAILURE_NONE,
JOBFAILURE_TAPEDRIVE,
JOBFAILURE_TAPELIBRARY,
JOBFAILURE_REMOTESTORAGE
};
/**
* Thread safe method that returns the string representation of the specified
* enumeration value.
*
* @param enumValue The integer value of the type.
* @return The string representation.
*/
static const char *TransferFailureToStr(const TapeJobFailure enumValue)
throw();
/**
* Constructor.
*
......
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scheduler/TapeJobFailure.hpp"
//------------------------------------------------------------------------------
// TransferFailureToStr
//------------------------------------------------------------------------------
const char *cta::TapeJobFailureToStr(const TapeJobFailure enumValue) throw() {
switch(enumValue) {
case JOBFAILURE_NONE : return "NONE";
case JOBFAILURE_TAPEDRIVE : return "TAPE DRIVE";
case JOBFAILURE_TAPELIBRARY : return "TAPE LIBRARY";
case JOBFAILURE_REMOTESTORAGE: return "REMOTE STORAGE";
default : return "UNKNOWN";
}
}
/*
* The CERN Tape Archive (CTA) project
* Copyright (C) 2015 CERN
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
namespace cta {
/**
* An enumeration of the different types of tape job failures.
*/
enum TapeJobFailure {
JOBFAILURE_NONE,
JOBFAILURE_TAPEDRIVE,
JOBFAILURE_TAPELIBRARY,
JOBFAILURE_REMOTESTORAGE
};
/**
* Thread safe method that returns the string representation of the specified
* enumeration value.
*
* @param enumValue The integer value of the type.
* @return The string representation.
*/
const char *TapeJobFailureToStr(const TapeJobFailure enumValue) throw();
} // namespace cta
......@@ -57,7 +57,7 @@ castor::tape::tapeserver::daemon::DataTransferSession::DataTransferSession(
castor::messages::TapeserverProxy & initialProcess,
castor::server::ProcessCap & capUtils,
const DataTransferConfig & castorConf,
cta::IScheduler & scheduler):
cta::Scheduler & scheduler):
m_log(log),
m_sysWrapper(sysWrapper),
m_driveConfig(driveConfig),
......
......@@ -34,8 +34,8 @@
#include "castor/tape/tapeserver/daemon/TapeSingleThreadInterface.hpp"
#include "castor/tape/tapeserver/system/Wrapper.hpp"
#include "scheduler/ArchiveMount.hpp"
#include "scheduler/IScheduler.hpp"
#include "scheduler/RetrieveMount.hpp"
#include "scheduler/Scheduler.hpp"
#include "scheduler/TapeMount.hpp"
namespace castor {
......@@ -67,7 +67,7 @@ namespace daemon {
castor::messages::TapeserverProxy & initialProcess,
castor::server::ProcessCap &capUtils,
const DataTransferConfig & castorConf,
cta::IScheduler &scheduler);
cta::Scheduler &scheduler);
/**
* Execute the session and return the type of action to be performed
......@@ -134,7 +134,7 @@ namespace daemon {
/**
* The scheduler, i.e. the local interface to the Objectstore DB
*/
cta::IScheduler &m_scheduler;
cta::Scheduler &m_scheduler;
/**
* Returns the string representation of the specified mount type
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment