Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
5acc3454
Commit
5acc3454
authored
Jul 04, 2016
by
Steven Murray
Browse files
Split cta::catalogue into cta::catalogue and cta::rdbms
parent
51c159dc
Changes
60
Show whitespace changes
Inline
Side-by-side
catalogue
/OcciRset.cpp
→
rdbms
/OcciRset.cpp
View file @
5acc3454
...
...
@@ -16,9 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"
catalogue/
NullDbValue.hpp"
#include
"
catalogue/
OcciRset.hpp"
#include
"
catalogue/
OcciStmt.hpp"
#include
"NullDbValue.hpp"
#include
"OcciRset.hpp"
#include
"OcciStmt.hpp"
#include
"common/exception/Exception.hpp"
#include
"common/utils/utils.hpp"
...
...
@@ -27,7 +27,7 @@
#include
<stdexcept>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
//------------------------------------------------------------------------------
// constructor
...
...
@@ -185,5 +185,5 @@ optional<uint64_t> OcciRset::columnOptionalUint64(const std::string &colName) co
}
}
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/OcciRset.hpp
→
rdbms
/OcciRset.hpp
View file @
5acc3454
...
...
@@ -18,15 +18,15 @@
#pragma once
#include
"
catalogue/
ColumnNameToIdx.hpp"
#include
"
catalogue/
DbRset.hpp"
#include
"ColumnNameToIdx.hpp"
#include
"DbRset.hpp"
#include
<memory>
#include
<mutex>
#include
<occi.h>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
/**
* Forward declaration to avoid a circular dependency between OcciRset and
...
...
@@ -149,5 +149,5 @@ private:
};
// class OcciRset
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/OcciStmt.cpp
→
rdbms
/OcciStmt.cpp
View file @
5acc3454
...
...
@@ -16,9 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"
catalogue/
OcciConn.hpp"
#include
"
catalogue/
OcciRset.hpp"
#include
"
catalogue/
OcciStmt.hpp"
#include
"OcciConn.hpp"
#include
"OcciRset.hpp"
#include
"OcciStmt.hpp"
#include
"common/exception/Exception.hpp"
#include
<cstring>
...
...
@@ -28,7 +28,7 @@
#include
<stdexcept>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
//------------------------------------------------------------------------------
// constructor
...
...
@@ -164,5 +164,5 @@ oracle::occi::Statement *OcciStmt::operator->() const {
return
get
();
}
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/OcciStmt.hpp
→
rdbms
/OcciStmt.hpp
View file @
5acc3454
...
...
@@ -18,8 +18,8 @@
#pragma once
#include
"
catalogue/
DbStmt.hpp"
#include
"
catalogue/
ParamNameToIdx.hpp"
#include
"DbStmt.hpp"
#include
"ParamNameToIdx.hpp"
#include
<memory>
#include
<mutex>
...
...
@@ -27,7 +27,7 @@
#include
<stdint.h>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
/**
* Forward declaration to avoid a circular dependency between OcciStmt and
...
...
@@ -158,5 +158,5 @@ private:
};
// class OcciStmt
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/ParamNameToIdx.cpp
→
rdbms
/ParamNameToIdx.cpp
View file @
5acc3454
...
...
@@ -16,13 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"
catalogue/
ParamNameToIdx.hpp"
#include
"ParamNameToIdx.hpp"
#include
"common/exception/Exception.hpp"
#include
<sstream>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
//------------------------------------------------------------------------------
// constructor
...
...
@@ -90,5 +90,5 @@ unsigned int ParamNameToIdx::getIdx(const std::string ¶mName) const {
return
itor
->
second
;
}
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/ParamNameToIdx.hpp
→
rdbms
/ParamNameToIdx.hpp
View file @
5acc3454
...
...
@@ -20,7 +20,7 @@
#include
<string>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
/**
* Map from SQL parameter name to parameter index.
...
...
@@ -64,5 +64,5 @@ private:
};
// class ParamNameToIdx
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/ParamNameToIdxTest.cpp
→
rdbms
/ParamNameToIdxTest.cpp
View file @
5acc3454
...
...
@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"
catalogue/
ParamNameToIdx.hpp"
#include
"ParamNameToIdx.hpp"
#include
"common/exception/Exception.hpp"
#include
<gtest/gtest.h>
...
...
@@ -24,7 +24,7 @@
namespace
unitTests
{
class
cta_
catalogue
_ParamNameToIdxTest
:
public
::
testing
::
Test
{
class
cta_
rdbms
_ParamNameToIdxTest
:
public
::
testing
::
Test
{
protected:
virtual
void
SetUp
()
{
...
...
@@ -34,8 +34,8 @@ protected:
}
};
TEST_F
(
cta_
catalogue
_ParamNameToIdxTest
,
getIdx_existing_params
)
{
using
namespace
cta
::
catalogue
;
TEST_F
(
cta_
rdbms
_ParamNameToIdxTest
,
getIdx_existing_params
)
{
using
namespace
cta
::
rdbms
;
const
char
*
const
sql
=
"INSERT INTO ADMIN_USER("
...
...
@@ -80,9 +80,9 @@ TEST_F(cta_catalogue_ParamNameToIdxTest, getIdx_existing_params) {
ASSERT_EQ
(
10
,
paramNameToIdx
.
getIdx
(
":LAST_UPDATE_TIME"
));
}
TEST_F
(
cta_
catalogue
_ParamNameToIdxTest
,
getIdx_non_existing_param
)
{
TEST_F
(
cta_
rdbms
_ParamNameToIdxTest
,
getIdx_non_existing_param
)
{
using
namespace
cta
;
using
namespace
cta
::
catalogue
;
using
namespace
cta
::
rdbms
;
const
char
*
const
sql
=
"String containing no bind parameters"
;
...
...
catalogue
/Sqlite.cpp
→
rdbms
/Sqlite.cpp
View file @
5acc3454
...
...
@@ -16,17 +16,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"
catalogue/
DbStmt.hpp"
#include
"DbStmt.hpp"
#include
"catalogue/RdbmsCatalogueSchema.hpp"
#include
"
catalogue/
Sqlite.hpp"
#include
"
catalogue/
SqliteConn.hpp"
#include
"Sqlite.hpp"
#include
"SqliteConn.hpp"
#include
"common/exception/Exception.hpp"
#include
<memory>
#include
<sstream>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
//------------------------------------------------------------------------------
// rcToStr
...
...
@@ -95,5 +95,5 @@ std::string Sqlite::rcToStr(const int rc) {
}
}
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/Sqlite.hpp
→
rdbms
/Sqlite.hpp
View file @
5acc3454
...
...
@@ -22,7 +22,7 @@
#include
<string>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
/**
* A helper class for working with SQLite.
...
...
@@ -40,5 +40,5 @@ public:
};
// class SqlLiteStmt
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/SqliteConn.cpp
→
rdbms
/SqliteConn.cpp
View file @
5acc3454
...
...
@@ -17,15 +17,15 @@
*/
#include
"catalogue/RdbmsCatalogueSchema.hpp"
#include
"
catalogue/
SqliteConn.hpp"
#include
"
catalogue/
SqliteStmt.hpp"
#include
"SqliteConn.hpp"
#include
"SqliteStmt.hpp"
#include
"common/exception/Exception.hpp"
#include
<stdexcept>
#include
<string>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
//------------------------------------------------------------------------------
// constructor
...
...
@@ -148,5 +148,5 @@ void SqliteConn::printSchema(std::ostream &os) {
}
}
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/SqliteConn.hpp
→
rdbms
/SqliteConn.hpp
View file @
5acc3454
...
...
@@ -18,13 +18,13 @@
#pragma once
#include
"
catalogue/
DbConn.hpp"
#include
"DbConn.hpp"
#include
<mutex>
#include
<sqlite3.h>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
/**
* Forward declaration to avoid a circular dependency between SqliteConn and
...
...
@@ -104,5 +104,5 @@ private:
};
// class SqliteConn
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/SqliteRset.cpp
→
rdbms
/SqliteRset.cpp
View file @
5acc3454
...
...
@@ -16,10 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"
catalogue/
NullDbValue.hpp"
#include
"
catalogue/
Sqlite.hpp"
#include
"
catalogue/
SqliteRset.hpp"
#include
"
catalogue/
SqliteStmt.hpp"
#include
"NullDbValue.hpp"
#include
"Sqlite.hpp"
#include
"SqliteRset.hpp"
#include
"SqliteStmt.hpp"
#include
"common/exception/Exception.hpp"
#include
<cstring>
...
...
@@ -28,7 +28,7 @@
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
/**
* A map from column name to column index and type.
...
...
@@ -241,5 +241,5 @@ optional<uint64_t> SqliteRset::columnOptionalUint64(const std::string &colName)
}
}
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/SqliteRset.hpp
→
rdbms
/SqliteRset.hpp
View file @
5acc3454
...
...
@@ -18,15 +18,15 @@
#pragma once
#include
"
catalogue/
ColumnNameToIdxAndType.hpp"
#include
"
catalogue/
DbRset.hpp"
#include
"ColumnNameToIdxAndType.hpp"
#include
"DbRset.hpp"
#include
<memory>
#include
<stdint.h>
#include
<sqlite3.h>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
/**
* Forward declaration.
...
...
@@ -118,5 +118,5 @@ private:
};
// class SqlLiteRset
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/SqliteStmt.cpp
→
rdbms
/SqliteStmt.cpp
View file @
5acc3454
...
...
@@ -16,10 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"
catalogue/
Sqlite.hpp"
#include
"
catalogue/
SqliteConn.hpp"
#include
"
catalogue/
SqliteRset.hpp"
#include
"
catalogue/
SqliteStmt.hpp"
#include
"Sqlite.hpp"
#include
"SqliteConn.hpp"
#include
"SqliteRset.hpp"
#include
"SqliteStmt.hpp"
#include
"common/exception/Exception.hpp"
#include
<cstring>
...
...
@@ -27,7 +27,7 @@
#include
<string>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
//------------------------------------------------------------------------------
// constructor
...
...
@@ -144,5 +144,5 @@ uint64_t SqliteStmt::getNbAffectedRows() const {
return
m_nbAffectedRows
;
}
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/SqliteStmt.hpp
→
rdbms
/SqliteStmt.hpp
View file @
5acc3454
...
...
@@ -18,8 +18,8 @@
#pragma once
#include
"
catalogue/
DbStmt.hpp"
#include
"
catalogue/
ParamNameToIdx.hpp"
#include
"DbStmt.hpp"
#include
"ParamNameToIdx.hpp"
#include
<map>
#include
<memory>
...
...
@@ -28,7 +28,7 @@
#include
<sqlite3.h>
namespace
cta
{
namespace
catalogue
{
namespace
rdbms
{
class
SqliteConn
;
class
SqliteRset
;
...
...
@@ -146,5 +146,5 @@ private:
};
// class SqlLiteStmt
}
// namespace
catalogue
}
// namespace
rdbms
}
// namespace cta
catalogue
/SqliteStmtTest.cpp
→
rdbms
/SqliteStmtTest.cpp
View file @
5acc3454
...
...
@@ -16,16 +16,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include
"
catalogue/
SqliteConn.hpp"
#include
"
catalogue/
SqliteRset.hpp"
#include
"
catalogue/
SqliteStmt.hpp"
#include
"SqliteConn.hpp"
#include
"SqliteRset.hpp"
#include
"SqliteStmt.hpp"
#include
<gtest/gtest.h>
#include
<memory>
namespace
unitTests
{
class
cta_
catalogue
_SqliteStmtTest
:
public
::
testing
::
Test
{
class
cta_
rdbms
_SqliteStmtTest
:
public
::
testing
::
Test
{
protected:
virtual
void
SetUp
()
{
...
...
@@ -35,8 +35,8 @@ protected:
}
};
TEST_F
(
cta_
catalogue
_SqliteStmtTest
,
create_table
)
{
using
namespace
cta
::
catalogue
;
TEST_F
(
cta_
rdbms
_SqliteStmtTest
,
create_table
)
{
using
namespace
cta
::
rdbms
;
// Create a connection a memory resident database
SqliteConn
conn
(
":memory:"
);
...
...
@@ -86,8 +86,8 @@ TEST_F(cta_catalogue_SqliteStmtTest, create_table) {
}
}
TEST_F
(
cta_
catalogue
_SqliteStmtTest
,
select_from_empty_table
)
{
using
namespace
cta
::
catalogue
;
TEST_F
(
cta_
rdbms
_SqliteStmtTest
,
select_from_empty_table
)
{
using
namespace
cta
::
rdbms
;
// Create a connection a memory resident database
SqliteConn
conn
(
":memory:"
);
...
...
@@ -117,8 +117,8 @@ TEST_F(cta_catalogue_SqliteStmtTest, select_from_empty_table) {
}
}
TEST_F
(
cta_
catalogue
_SqliteStmtTest
,
insert_without_bind
)
{
using
namespace
cta
::
catalogue
;
TEST_F
(
cta_
rdbms
_SqliteStmtTest
,
insert_without_bind
)
{
using
namespace
cta
::
rdbms
;
// Create a connection a memory resident database
SqliteConn
conn
(
":memory:"
);
...
...
@@ -173,8 +173,8 @@ TEST_F(cta_catalogue_SqliteStmtTest, insert_without_bind) {
}
}
TEST_F
(
cta_
catalogue
_SqliteStmtTest
,
insert_with_bind
)
{
using
namespace
cta
::
catalogue
;
TEST_F
(
cta_
rdbms
_SqliteStmtTest
,
insert_with_bind
)
{
using
namespace
cta
::
rdbms
;
// Create a connection a memory resident database
SqliteConn
conn
(
":memory:"
);
...
...
@@ -233,8 +233,8 @@ TEST_F(cta_catalogue_SqliteStmtTest, insert_with_bind) {
}
}
TEST_F
(
cta_
catalogue
_SqliteStmtTest
,
isolated_transaction
)
{
using
namespace
cta
::
catalogue
;
TEST_F
(
cta_
rdbms
_SqliteStmtTest
,
isolated_transaction
)
{
using
namespace
cta
::
rdbms
;
const
std
::
string
dbFilename
=
"file::memory:?cache=shared"
;
...
...
scheduler/SchedulerTest.cpp
View file @
5acc3454
...
...
@@ -17,7 +17,7 @@
*/
#include
"catalogue/CatalogueFactory.hpp"
#include
"
catalogue
/DbConn.hpp"
#include
"
rdbms
/DbConn.hpp"
#include
"catalogue/RdbmsCatalogue.hpp"
#include
"common/admin/AdminUser.hpp"
#include
"common/admin/AdminHost.hpp"
...
...
@@ -81,7 +81,7 @@ public:
const
SchedulerTestParam
&
param
=
GetParam
();
m_db
=
param
.
dbFactory
.
create
();
catalogue
::
DbLogin
catalogueLogin
(
catalogue
::
DbLogin
::
DBTYPE_IN_MEMORY
,
""
,
""
,
""
);
rdbms
::
DbLogin
catalogueLogin
(
rdbms
::
DbLogin
::
DBTYPE_IN_MEMORY
,
""
,
""
,
""
);
m_catalogue
.
reset
(
catalogue
::
CatalogueFactory
::
create
(
catalogueLogin
));
m_scheduler
.
reset
(
new
cta
::
Scheduler
(
*
m_catalogue
,
*
m_db
,
5
,
2
*
1000
*
1000
));
...
...
tapeserver/castor/tape/tapeserver/daemon/MigrationReportPackerTest.cpp
View file @
5acc3454
...
...
@@ -39,9 +39,10 @@ namespace unitTests {
protected:
void
SetUp
()
{
using
namespace
cta
;
using
namespace
cta
::
catalogue
;
DbLogin
catalogueLogin
(
DbLogin
::
DBTYPE_IN_MEMORY
,
""
,
""
,
""
);
rdbms
::
DbLogin
catalogueLogin
(
rdbms
::
DbLogin
::
DBTYPE_IN_MEMORY
,
""
,
""
,
""
);
m_catalogue
.
reset
(
CatalogueFactory
::
create
(
catalogueLogin
));
}
...
...
tapeserver/castor/tape/tapeserver/daemon/ProcessForker.cpp
View file @
5acc3454
...
...
@@ -48,8 +48,8 @@
#include
"castor/utils/SmartArrayPtr.hpp"
#include
"castor/utils/utils.hpp"
#include
"catalogue/CatalogueFactory.hpp"
#include
"
catalogue
/Sqlite.hpp"
#include
"
catalogue
/SqliteConn.hpp"
#include
"
rdbms
/Sqlite.hpp"
#include
"
rdbms
/SqliteConn.hpp"
#include
"objectstore/BackendVFS.hpp"
#include
"objectstore/BackendFactory.hpp"
#include
"objectstore/BackendPopulator.hpp"
...
...
@@ -569,7 +569,7 @@ castor::tape::tapeserver::daemon::Session::EndOfSessionAction
}
catch
(
std
::
bad_cast
&
){}
cta
::
objectstore
::
BackendPopulator
backendPopulator
(
*
backend
);
cta
::
OStoreDBWithAgent
osdb
(
*
backend
,
backendPopulator
.
getAgent
());
const
cta
::
catalogue
::
DbLogin
catalogueLogin
=
cta
::
catalogue
::
DbLogin
::
parseFile
(
"/etc/cta/cta_catalogue_db.conf"
);
const
cta
::
rdbms
::
DbLogin
catalogueLogin
=
cta
::
rdbms
::
DbLogin
::
parseFile
(
"/etc/cta/cta_catalogue_db.conf"
);
std
::
unique_ptr
<
cta
::
catalogue
::
Catalogue
>
catalogue
(
cta
::
catalogue
::
CatalogueFactory
::
create
(
catalogueLogin
));
cta
::
Scheduler
scheduler
(
*
catalogue
,
osdb
,
5
,
2
*
1000
*
1000
);
//TODO: we have hardcoded the mount policy parameters here temporarily we will remove them once we know where to put them
...
...
xroot_plugins/XrdCtaFilesystem.cpp
View file @
5acc3454
...
...
@@ -267,7 +267,7 @@ XrdCtaFilesystem::XrdCtaFilesystem():
throw
cta
::
exception
::
Exception
(
std
::
string
(
"Failed to instantiate object representing CTA logging system: "
)
+
ex
.
getMessage
().
str
());
}
const
catalogue
::
DbLogin
catalogueLogin
=
catalogue
::
DbLogin
::
parseFile
(
"/etc/cta/cta_catalogue_db.conf"
);
const
rdbms
::
DbLogin
catalogueLogin
=
rdbms
::
DbLogin
::
parseFile
(
"/etc/cta/cta_catalogue_db.conf"
);
m_catalogue
.
reset
(
catalogue
::
CatalogueFactory
::
create
(
catalogueLogin
));
m_scheduler
.
reset
(
new
cta
::
Scheduler
(
*
m_catalogue
,
m_scheddb
,
5
,
2
*
1000
*
1000
));
...
...
Prev
1
2
3
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment