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
3ad95013
Commit
3ad95013
authored
13 years ago
by
cramakri
Browse files
Options
Downloads
Patches
Plain Diff
LMS-2255 Fixed bug and added test.
SVN: 21336
parent
a84d56a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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/etlserver/registrator/api/v1/impl/RollbackStack.java
+12
-5
12 additions, 5 deletions
...cisd/etlserver/registrator/api/v1/impl/RollbackStack.java
with
12 additions
and
5 deletions
datastore_server/source/java/ch/systemsx/cisd/etlserver/registrator/api/v1/impl/RollbackStack.java
+
12
−
5
View file @
3ad95013
...
@@ -25,6 +25,7 @@ import org.apache.commons.lang.builder.ToStringStyle;
...
@@ -25,6 +25,7 @@ import org.apache.commons.lang.builder.ToStringStyle;
import
org.apache.log4j.Logger
;
import
org.apache.log4j.Logger
;
import
ch.systemsx.cisd.common.collections.ExtendedBlockingQueueFactory
;
import
ch.systemsx.cisd.common.collections.ExtendedBlockingQueueFactory
;
import
ch.systemsx.cisd.common.collections.PersistentExtendedBlockingQueueDecorator
;
/**
/**
* A package internal class to manage the rollback stack.
* A package internal class to manage the rollback stack.
...
@@ -42,9 +43,9 @@ class RollbackStack
...
@@ -42,9 +43,9 @@ class RollbackStack
private
final
File
queue2File
;
private
final
File
queue2File
;
// These are not final because they get swapped around.
// These are not final because they get swapped around.
private
Queue
<
StackElement
>
liveLifo
;
private
PersistentExtendedBlockingQueueDecorator
<
StackElement
>
liveLifo
;
private
Queue
<
StackElement
>
tempLifo
;
private
PersistentExtendedBlockingQueueDecorator
<
StackElement
>
tempLifo
;
/**
/**
* Constructor for a rollback stack that uses queue1File and queue2File for the persistent
* Constructor for a rollback stack that uses queue1File and queue2File for the persistent
...
@@ -58,9 +59,9 @@ class RollbackStack
...
@@ -58,9 +59,9 @@ class RollbackStack
this
.
queue1File
=
queue1File
;
this
.
queue1File
=
queue1File
;
this
.
queue2File
=
queue2File
;
this
.
queue2File
=
queue2File
;
Queue
<
StackElement
>
queue1
=
PersistentExtendedBlockingQueueDecorator
<
StackElement
>
queue1
=
ExtendedBlockingQueueFactory
.
createPersistRecordBased
(
queue1File
,
16
,
false
);
ExtendedBlockingQueueFactory
.
createPersistRecordBased
(
queue1File
,
16
,
false
);
Queue
<
StackElement
>
queue2
=
PersistentExtendedBlockingQueueDecorator
<
StackElement
>
queue2
=
ExtendedBlockingQueueFactory
.
createPersistRecordBased
(
queue2File
,
16
,
false
);
ExtendedBlockingQueueFactory
.
createPersistRecordBased
(
queue2File
,
16
,
false
);
// If both queues are empty, it doesn't matter which is which
// If both queues are empty, it doesn't matter which is which
...
@@ -197,8 +198,14 @@ class RollbackStack
...
@@ -197,8 +198,14 @@ class RollbackStack
*/
*/
public
void
discard
()
public
void
discard
()
{
{
// Close the persistent queues
liveLifo
.
close
();
tempLifo
.
close
();
liveLifo
=
null
;
liveLifo
=
null
;
tempLifo
=
null
;
tempLifo
=
null
;
// Delete the files
queue1File
.
delete
();
queue1File
.
delete
();
queue2File
.
delete
();
queue2File
.
delete
();
}
}
...
@@ -256,7 +263,7 @@ class RollbackStack
...
@@ -256,7 +263,7 @@ class RollbackStack
*/
*/
private
void
swapStacks
()
private
void
swapStacks
()
{
{
Queue
<
StackElement
>
swap
=
liveLifo
;
PersistentExtendedBlockingQueueDecorator
<
StackElement
>
swap
=
liveLifo
;
liveLifo
=
tempLifo
;
liveLifo
=
tempLifo
;
tempLifo
=
swap
;
tempLifo
=
swap
;
}
}
...
...
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