Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
15030ce4
Commit
15030ce4
authored
8 years ago
by
Steven Murray
Browse files
Options
Downloads
Patches
Plain Diff
OracleCatalogue.cpp is only compiled if OCCI is to be used
parent
7b2988f1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
catalogue/CMakeLists.txt
+17
-8
17 additions, 8 deletions
catalogue/CMakeLists.txt
catalogue/CatalogueFactory_OCCI_SUPPORT_OFF.cpp
+55
-0
55 additions, 0 deletions
catalogue/CatalogueFactory_OCCI_SUPPORT_OFF.cpp
with
72 additions
and
8 deletions
catalogue/CMakeLists.txt
+
17
−
8
View file @
15030ce4
...
...
@@ -20,15 +20,15 @@ set (OCCI_SUPPORT ON)
# Switch OCCI support off if using gcc 5.1 or higher
if
(
CMAKE_COMPILER_IS_GNUCC
)
if
(
GCC_VERSION VERSION_GREATER 5.0
)
message
(
STATUS
"Detected gcc >= 5.1 - Switching off OCCI support"
)
set
(
OCCI_SUPPORT OFF
)
endif
(
GCC_VERSION VERSION_GREATER 5.0
)
if
(
GCC_VERSION VERSION_GREATER 5.0
)
message
(
STATUS
"Detected gcc >= 5.1 - Switching off OCCI support"
)
set
(
OCCI_SUPPORT OFF
)
endif
(
GCC_VERSION VERSION_GREATER 5.0
)
endif
(
CMAKE_COMPILER_IS_GNUCC
)
if
(
OCCI_SUPPORT
)
find_package
(
oracle-instantclient REQUIRED
)
include_directories
(
${
ORACLE-INSTANTCLIENT_INCLUDE_DIRS
}
)
find_package
(
oracle-instantclient REQUIRED
)
include_directories
(
${
ORACLE-INSTANTCLIENT_INCLUDE_DIRS
}
)
endif
(
OCCI_SUPPORT
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-Wshadow"
)
...
...
@@ -37,17 +37,26 @@ set (CATALOGUE_LIB_SRC_FILES
ArchiveFileRow.cpp
ArchiveFileItor.cpp
Catalogue.cpp
CatalogueFactory.cpp
CmdLineTool.cpp
InMemoryCatalogue.cpp
SqliteCatalogueSchema.cpp
OracleCatalogue.cpp
TapeFileWritten.cpp
RdbmsCatalogue.cpp
SchemaCreatingSqliteCatalogue.cpp
SqliteCatalogue.cpp
TapeForWriting.cpp
)
if
(
OCCI_SUPPORT
)
set
(
CATALOGUE_LIB_SRC_FILES
${
CATALOGUE_LIB_SRC_FILES
}
CatalogueFactory.cpp
OracleCatalogue.cpp
)
else
(
OCCI_SUPPORT
)
set
(
CATALOGUE_LIB_SRC_FILES
${
CATALOGUE_LIB_SRC_FILES
}
CatalogueFactory_OCCI_SUPPORT_OFF.cpp
)
endif
(
OCCI_SUPPORT
)
add_library
(
ctacatalogue SHARED
${
CATALOGUE_LIB_SRC_FILES
}
)
...
...
This diff is collapsed.
Click to expand it.
catalogue/CatalogueFactory_OCCI_SUPPORT_OFF.cpp
0 → 100644
+
55
−
0
View file @
15030ce4
/*
* 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
"catalogue/CatalogueFactory.hpp"
#include
"catalogue/InMemoryCatalogue.hpp"
#include
"catalogue/SqliteCatalogue.hpp"
#include
"common/exception/Exception.hpp"
#include
"common/make_unique.hpp"
namespace
cta
{
namespace
catalogue
{
//------------------------------------------------------------------------------
// create
//------------------------------------------------------------------------------
std
::
unique_ptr
<
Catalogue
>
CatalogueFactory
::
create
(
const
rdbms
::
Login
&
login
,
const
uint64_t
nbConns
)
{
try
{
switch
(
login
.
dbType
)
{
case
rdbms
::
Login
::
DBTYPE_IN_MEMORY
:
return
cta
::
make_unique
<
InMemoryCatalogue
>
(
nbConns
);
case
rdbms
::
Login
::
DBTYPE_ORACLE
:
throw
exception
::
Exception
(
"OCCI support disabled at compile time"
);
case
rdbms
::
Login
::
DBTYPE_SQLITE
:
return
cta
::
make_unique
<
SqliteCatalogue
>
(
login
.
database
,
nbConns
);
case
rdbms
::
Login
::
DBTYPE_NONE
:
throw
exception
::
Exception
(
"Cannot create a catalogue without a database type"
);
default:
{
exception
::
Exception
ex
;
ex
.
getMessage
()
<<
"Unknown database type: value="
<<
login
.
dbType
;
throw
ex
;
}
}
}
catch
(
exception
::
Exception
&
ex
)
{
throw
exception
::
Exception
(
std
::
string
(
__FUNCTION__
)
+
" failed: "
+
ex
.
getMessage
().
str
());
}
}
}
// namespace catalogue
}
// namespace cta
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment