Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
bfa498dc
Commit
bfa498dc
authored
7 years ago
by
juanf
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-5407 : New Write / Atomic move test on dss startup
SVN: 38583
parent
e17062f7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/DssPropertyParametersUtil.java
+15
-29
15 additions, 29 deletions
...s/dss/generic/shared/utils/DssPropertyParametersUtil.java
with
15 additions
and
29 deletions
datastore_server/source/java/ch/systemsx/cisd/openbis/dss/generic/shared/utils/DssPropertyParametersUtil.java
+
15
−
29
View file @
bfa498dc
...
...
@@ -101,11 +101,9 @@ public class DssPropertyParametersUtil
private
static
final
Template
NON_EXISTING_DIR_TEMPLATE
=
new
Template
(
"Could not create ${dir-description} at path: ${path}. "
+
EXPLANATION
);
private
static
final
Template
NON_SAME_VOLUME_TEMPLATE
=
new
Template
(
"Directories '${pathA}', '${pathB}', '${pathC}' are not on the same file system. "
);
private
static
final
Template
NON_SAME_VOLUME_TEMPLATE
=
new
Template
(
"Directories '${pathA}', '${pathB}' are not on the same file system. "
);
private
static
final
Template
NON_WRITABLE_TEMPLATE
=
new
Template
(
"Directory '${pathA}' is not writable. "
);
private
static
final
Template
NON_WRITABLE_TEMPLATE
=
new
Template
(
"Directory '${pathA}' is not writable. "
);
private
static
final
Template
NON_VOLUME_TEMPLATE
=
new
Template
(
"Volume information for '${volA}' is not retrivable. "
);
...
...
@@ -341,24 +339,22 @@ public class DssPropertyParametersUtil
FileStore
recoveryStateStore
=
getVolumeInfo
(
dssTmp
,
"recovery-state"
);
FileStore
logRegistrationsState
=
getVolumeInfo
(
dssTmp
,
"log-registrations"
);
if
(
dssTmpStore
.
equals
(
recoveryStateStore
)
&&
recoveryStateStore
.
equals
(
logRegistrationsState
))
// Check they are on the same Volume
if
(
!
dssTmpStore
.
equals
(
recoveryStateStore
)
)
{
if
(!
isWritable
(
fileOperations
,
dssTmp
))
{
throw
createException
(
NON_WRITABLE_TEMPLATE
,
dssTmp
);
}
else
if
(!
isMoveFromTo
(
fileOperations
,
dssTmp
,
recoveryState
))
{
throw
createException
(
NON_MOVE_TEMPLATE
,
dssTmp
,
recoveryState
);
}
else
if
(!
isMoveFromTo
(
fileOperations
,
dssTmp
,
logRegistrations
))
{
throw
createException
(
NON_MOVE_TEMPLATE
,
dssTmp
,
logRegistrations
);
}
}
else
throw
createException
(
NON_SAME_VOLUME_TEMPLATE
,
dssTmp
,
recoveryState
);
}
else
if
(!
dssTmpStore
.
equals
(
logRegistrationsState
))
{
throw
createException
(
NON_SAME_VOLUME_TEMPLATE
,
dssTmp
,
logRegistrations
);
}
else
if
(!
isWritable
(
fileOperations
,
dssTmp
))
{
throw
createException
(
NON_WRITABLE_TEMPLATE
,
dssTmp
);
}
else
if
(!
isMoveFromTo
(
fileOperations
,
dssTmp
,
recoveryState
))
{
throw
createException
(
NON_MOVE_TEMPLATE
,
dssTmp
,
recoveryState
);
}
else
if
(!
isMoveFromTo
(
fileOperations
,
dssTmp
,
logRegistrations
))
{
throw
createException
(
NON_
SAME_VOLUM
E_TEMPLATE
,
dssTmp
,
recoveryState
,
logRegistrations
);
throw
createException
(
NON_
MOV
E_TEMPLATE
,
dssTmp
,
logRegistrations
);
}
}
private
static
void
assertDirExists
(
IFileOperations
fileOperations
,
File
dir
,
...
...
@@ -393,16 +389,6 @@ public class DssPropertyParametersUtil
return
e
;
}
private
static
ConfigurationFailureException
createException
(
Template
template
,
Path
pathA
,
Path
pathB
,
Path
pathC
)
{
template
.
bind
(
"pathA"
,
pathA
.
toString
());
template
.
bind
(
"pathB"
,
pathB
.
toString
());
template
.
bind
(
"pathB"
,
pathC
.
toString
());
ConfigurationFailureException
e
=
new
ConfigurationFailureException
(
template
.
createText
());
return
e
;
}
private
static
ConfigurationFailureException
createException
(
Template
template
,
File
dir
,
String
dirName
,
String
pathKey
)
{
...
...
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