Skip to content
GitLab
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
6ec8935b
Commit
6ec8935b
authored
Sep 10, 2018
by
Michael Davis
Browse files
[os-generic-queues] Renames ArchiveQueue to ArchiveQueueToTransfer
parent
f2675143
Changes
8
Hide whitespace changes
Inline
Side-by-side
objectstore/AlgorithmsTest.cpp
View file @
6ec8935b
...
...
@@ -116,7 +116,7 @@ TEST(ObjectStore, ArchiveQueueAlgorithms) {
rel
.
release
();
agent
.
initialize
();
agent
.
insertAndRegisterSelf
(
lc
);
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
>::
InsertedElement
::
list
requests
;
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
InsertedElement
::
list
requests
;
std
::
list
<
std
::
unique_ptr
<
cta
::
objectstore
::
ArchiveRequest
>>
archiveRequests
;
for
(
size_t
i
=
0
;
i
<
10
;
i
++
)
{
std
::
string
arAddr
=
agentRef
.
nextId
(
"ArchiveRequest"
);
...
...
@@ -135,7 +135,7 @@ TEST(ObjectStore, ArchiveQueueAlgorithms) {
aFile
.
fileSize
=
667
;
aFile
.
storageClass
=
"sc"
;
archiveRequests
.
emplace_back
(
new
cta
::
objectstore
::
ArchiveRequest
(
arAddr
,
be
));
requests
.
emplace_back
(
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
>::
InsertedElement
{
archiveRequests
.
back
().
get
(),
1
,
aFile
,
mp
,
requests
.
emplace_back
(
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
InsertedElement
{
archiveRequests
.
back
().
get
(),
1
,
aFile
,
mp
,
cta
::
nullopt
});
auto
&
ar
=*
requests
.
back
().
archiveRequest
;
auto
copyNb
=
requests
.
back
().
copyNb
;
...
...
@@ -150,10 +150,10 @@ TEST(ObjectStore, ArchiveQueueAlgorithms) {
ar
.
setEntryLog
(
cta
::
common
::
dataStructures
::
EntryLog
(
"user0"
,
"host0"
,
time
(
nullptr
)));
ar
.
insert
();
}
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
>
archiveAlgos
(
be
,
agentRef
);
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>
archiveAlgos
(
be
,
agentRef
);
archiveAlgos
.
referenceAndSwitchOwnership
(
"Tapepool"
,
QueueType
::
JobsToTransfer
,
requests
,
lc
);
// Now get the requests back
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>::
PopCriteria
popCriteria
;
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
PopCriteria
popCriteria
;
popCriteria
.
bytes
=
std
::
numeric_limits
<
decltype
(
popCriteria
.
bytes
)
>::
max
();
popCriteria
.
files
=
100
;
auto
poppedJobs
=
archiveAlgos
.
popNextBatch
(
"Tapepool"
,
QueueType
::
JobsToTransfer
,
popCriteria
,
lc
);
...
...
objectstore/ArchiveQueue.hpp
View file @
6ec8935b
...
...
@@ -138,6 +138,11 @@ public:
static
const
uint64_t
c_maxShardSize
=
25000
;
};
class
ArchiveQueueToTransfer
:
public
ArchiveQueue
{
public:
template
<
typename
...
Ts
>
ArchiveQueueToTransfer
(
Ts
&
...
args
)
:
ArchiveQueue
(
args
...)
{}
};
class
ArchiveQueueToReport
:
public
ArchiveQueue
{
public:
template
<
typename
...
Ts
>
ArchiveQueueToReport
(
Ts
&
...
args
)
:
ArchiveQueue
(
args
...)
{}
...
...
objectstore/ArchiveQueueAlgorithms.hpp
View file @
6ec8935b
...
...
@@ -437,7 +437,7 @@ getElementSummary(const PoppedElement& poppedElement) -> PoppedElementsSummary {
// ArchiveQueue full specialisations for ContainerTraits.
template
<
>
struct
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>::
PopCriteria
{
struct
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
PopCriteria
{
uint64_t
files
;
uint64_t
bytes
;
PopCriteria
(
uint64_t
f
=
0
,
uint64_t
b
=
0
)
:
files
(
f
),
bytes
(
b
)
{}
...
...
@@ -450,7 +450,7 @@ struct ContainerTraits<ArchiveQueue,ArchiveQueue>::PopCriteria {
};
template
<
>
struct
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>::
PoppedElementsSummary
{
struct
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
PoppedElementsSummary
{
uint64_t
files
;
uint64_t
bytes
;
PoppedElementsSummary
(
uint64_t
f
=
0
,
uint64_t
b
=
0
)
:
files
(
f
),
bytes
(
b
)
{}
...
...
objectstore/ArchiveQueueAlgorithms.cpp
→
objectstore/ArchiveQueue
ToTransfer
Algorithms.cpp
View file @
6ec8935b
...
...
@@ -24,13 +24,13 @@ namespace cta { namespace objectstore {
// ArchiveQueue full specialisations for ContainerTraits.
template
<
>
const
std
::
string
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>::
c_containerTypeName
=
"ArchiveQueue"
;
const
std
::
string
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
c_containerTypeName
=
"ArchiveQueue
ToTransfer
"
;
template
<
>
const
std
::
string
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>::
c_identifierType
=
"tapepool"
;
const
std
::
string
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
c_identifierType
=
"tapepool"
;
template
<
>
auto
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>::
auto
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
getContainerSummary
(
Container
&
cont
)
->
ContainerSummary
{
ContainerSummary
ret
;
ret
.
JobsSummary
::
operator
=
(
cont
.
getJobsSummary
());
...
...
@@ -38,7 +38,7 @@ getContainerSummary(Container& cont) -> ContainerSummary {
}
template
<
>
auto
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>::
auto
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
getPoppingElementsCandidates
(
Container
&
cont
,
PopCriteria
&
unfulfilledCriteria
,
ElementsToSkipSet
&
elemtsToSkip
,
log
::
LogContext
&
lc
)
->
PoppedElementsBatch
{
...
...
@@ -54,7 +54,7 @@ getPoppingElementsCandidates(Container &cont, PopCriteria &unfulfilledCriteria,
}
template
<
>
auto
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>::
auto
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
getElementSummary
(
const
PoppedElement
&
poppedElement
)
->
PoppedElementsSummary
{
PoppedElementsSummary
ret
;
ret
.
bytes
=
poppedElement
.
bytes
;
...
...
@@ -63,14 +63,14 @@ getElementSummary(const PoppedElement& poppedElement) -> PoppedElementsSummary {
}
template
<
>
void
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>::
PoppedElementsBatch
::
void
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
PoppedElementsBatch
::
addToLog
(
log
::
ScopedParamContainer
&
params
)
{
params
.
add
(
"bytes"
,
summary
.
bytes
)
.
add
(
"files"
,
summary
.
files
);
}
template
<
>
void
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>::
void
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>::
trimContainerIfNeeded
(
Container
&
cont
,
ScopedExclusiveLock
&
contLock
,
const
ContainerIdentifier
&
cId
,
log
::
LogContext
&
lc
)
{
...
...
objectstore/CMakeLists.txt
View file @
6ec8935b
...
...
@@ -60,9 +60,9 @@ add_library (ctaobjectstore SHARED
AgentWatchdog.cpp
ArchiveQueue.cpp
ArchiveQueueShard.cpp
ArchiveQueueAlgorithms.cpp
ArchiveQueueFailedAlgorithms.cpp
ArchiveQueueToTransferAlgorithms.cpp
ArchiveQueueToReportAlgorithms.cpp
ArchiveQueueFailedAlgorithms.cpp
RetrieveQueue.cpp
RetrieveQueueShard.cpp
RetrieveQueueAlgorithms.cpp
...
...
objectstore/GarbageCollector.cpp
View file @
6ec8935b
...
...
@@ -399,7 +399,7 @@ void GarbageCollector::OwnedObjectSorter::lockFetchAndUpdateArchiveJobs(Agent& a
requestsList
.
pop_front
();
}
utils
::
Timer
t
;
typedef
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
>
AqAlgos
;
typedef
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>
AqAlgos
;
AqAlgos
aqcl
(
objectStore
,
agentReference
);
decltype
(
aqcl
)
::
InsertedElement
::
list
jobsToAdd
;
for
(
auto
&
ar
:
currentJobBatch
)
{
...
...
objectstore/ObjectOps.hpp
View file @
6ec8935b
...
...
@@ -33,7 +33,10 @@ class AgentReference;
class
ScopedLock
;
class
ScopedExclusiveLock
;
template
<
typename
Q
,
typename
C
>
struct
ContainerTraits
;
// Defined queue types
struct
ArchiveQueue
;
struct
ArchiveQueueToTransfer
;
struct
ArchiveQueueToReport
;
struct
ArchiveQueueFailed
;
struct
RetrieveQueue
;
...
...
@@ -44,7 +47,7 @@ class ObjectOpsBase {
friend
class
ScopedExclusiveLock
;
friend
class
GenericObject
;
friend
class
Helpers
;
friend
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
>
;
friend
ContainerTraits
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>
;
friend
ContainerTraits
<
ArchiveQueue
,
ArchiveQueueToReport
>
;
friend
ContainerTraits
<
ArchiveQueue
,
ArchiveQueueFailed
>
;
friend
ContainerTraits
<
RetrieveQueue
,
RetrieveQueue
>
;
...
...
scheduler/OStoreDB/OStoreDB.cpp
View file @
6ec8935b
...
...
@@ -1742,7 +1742,7 @@ const SchedulerDatabase::ArchiveMount::MountInfo& OStoreDB::ArchiveMount::getMou
//------------------------------------------------------------------------------
std
::
list
<
std
::
unique_ptr
<
SchedulerDatabase
::
ArchiveJob
>
>
OStoreDB
::
ArchiveMount
::
getNextJobBatch
(
uint64_t
filesRequested
,
uint64_t
bytesRequested
,
log
::
LogContext
&
logContext
)
{
typedef
objectstore
::
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
>
AQAlgos
;
typedef
objectstore
::
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>
AQAlgos
;
AQAlgos
aqAlgos
(
m_oStoreDB
.
m_objectStore
,
*
m_oStoreDB
.
m_agentReference
);
AQAlgos
::
PopCriteria
popCriteria
(
filesRequested
,
bytesRequested
);
auto
jobs
=
aqAlgos
.
popNextBatch
(
mountInfo
.
tapePool
,
objectstore
::
QueueType
::
JobsToTransfer
,
popCriteria
,
logContext
);
...
...
@@ -2137,7 +2137,7 @@ void OStoreDB::ArchiveJob::failTransfer(const std::string& failureReason, log::L
auto
retryStatus
=
m_archiveRequest
.
getRetryStatus
(
tapeFile
.
copyNb
);
m_archiveRequest
.
commit
();
arl
.
release
();
typedef
objectstore
::
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
>
CaAqtr
;
typedef
objectstore
::
ContainerAlgorithms
<
ArchiveQueue
,
ArchiveQueue
ToTransfer
>
CaAqtr
;
CaAqtr
caAqtr
(
m_oStoreDB
.
m_objectStore
,
*
m_oStoreDB
.
m_agentReference
);
CaAqtr
::
InsertedElement
::
list
insertedElements
;
insertedElements
.
push_back
(
CaAqtr
::
InsertedElement
{
&
m_archiveRequest
,
tapeFile
.
copyNb
,
archiveFile
,
cta
::
nullopt
,
cta
::
nullopt
});
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment