Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
JAliEn
JAliEn
Commits
2c417933
Commit
2c417933
authored
Aug 01, 2018
by
Miguel Martinez Pedreira
Browse files
Small changes for directory creation for Cassandra dumper
parent
c8639aa6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/alien/catalogue/LFN_CSD.java
View file @
2c417933
...
...
@@ -91,6 +91,11 @@ public class LFN_CSD implements Comparable<LFN_CSD>, CatalogEntity {
*/
public
static
final
ExpirationCache
<
String
,
UUID
>
dirCache
=
new
ExpirationCache
<>(
80000
);
// TODO: should change size?
/**
* Local cache to hold recently inserted folders
*/
public
static
final
ExpirationCache
<
String
,
Integer
>
rifs
=
new
ExpirationCache
<>(
5000
);
// TODO: should change size?
/**
* Owner
*/
...
...
@@ -874,7 +879,7 @@ public class LFN_CSD implements Comparable<LFN_CSD>, CatalogEntity {
return
true
;
while
(
folderBookingMap
.
putIfAbsent
(
folder
,
Integer
.
valueOf
(
1
))
!=
null
)
{
Thread
.
sleep
(
1000
);
Thread
.
sleep
(
1000
*
bookingTries
);
bookingTries
++;
if
(
bookingTries
==
3
)
{
System
.
err
.
println
(
"Can't get booking lock: "
+
folder
);
...
...
@@ -882,6 +887,9 @@ public class LFN_CSD implements Comparable<LFN_CSD>, CatalogEntity {
}
}
if
(
rifs
.
get
(
folder
)
!=
null
)
return
true
;
try
{
// return if in the cache
if
(
dirCache
.
get
(
folder
)
!=
null
)
{
...
...
@@ -925,6 +933,7 @@ public class LFN_CSD implements Comparable<LFN_CSD>, CatalogEntity {
throw
(
e
);
}
finally
{
folderBookingMap
.
remove
(
folder
);
rifs
.
put
(
folder
,
Integer
.
valueOf
(
1
),
30
*
1000
);
// 30 seconds
}
}
...
...
src/alien/test/cassandra/CatalogueToCassandraThreads.java
View file @
2c417933
...
...
@@ -630,6 +630,8 @@ public class CatalogueToCassandraThreads {
failed_folders
.
flush
();
continue
;
}
created
=
true
;
break
;
}
catch
(
Exception
e
)
{
final
String
msg
=
"Exception inserting directory: "
+
l
.
getCanonicalName
()
+
" Time: "
+
new
Date
()
+
" Exception: "
+
e
;
System
.
err
.
println
(
msg
);
...
...
@@ -640,7 +642,8 @@ public class CatalogueToCassandraThreads {
}
if
(!
created
)
{
out
.
println
(
"Cannot create dir in AddPath after 3 tries: "
+
l
.
getCanonicalName
());
System
.
err
.
println
(
"Cannot create dir in Recurse after 3 tries: "
+
l
.
getCanonicalName
());
out
.
println
(
"Cannot create dir in Recurse after 3 tries: "
+
l
.
getCanonicalName
());
return
;
}
...
...
Write
Preview
Markdown
is supported
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