public static final class TwoPhaseCommitTool.TwoPhaseCommitWrapper extends java.lang.Object implements TwoPhaseCommit
TwoPhaseCommit, which delegates all calls to the
wrapped object, passing the specified commitData. This object is useful for
use with TwoPhaseCommitTool.execute(TwoPhaseCommit...) if one would
like to store commitData as part of the commit.| Constructor and Description |
|---|
TwoPhaseCommitWrapper(TwoPhaseCommit tpc,
java.util.Map<java.lang.String,java.lang.String> commitData) |
| Modifier and Type | Method and Description |
|---|---|
void |
commit()
The second phase of a 2-phase commit.
|
void |
commit(java.util.Map<java.lang.String,java.lang.String> commitData)
Like
TwoPhaseCommit.commit(), but takes an additional commit data to be included
w/ the commit. |
void |
prepareCommit()
The first stage of a 2-phase commit.
|
void |
prepareCommit(java.util.Map<java.lang.String,java.lang.String> commitData)
Like
TwoPhaseCommit.commit(), but takes an additional commit data to be included
w/ the commit. |
void |
rollback()
Discards any changes that have occurred since the last commit.
|
public TwoPhaseCommitWrapper(TwoPhaseCommit tpc, java.util.Map<java.lang.String,java.lang.String> commitData)
public void prepareCommit()
throws java.io.IOException
TwoPhaseCommitTwoPhaseCommit.rollback() is called to discard all changes
since last successful commit.prepareCommit in interface TwoPhaseCommitjava.io.IOExceptionpublic void prepareCommit(java.util.Map<java.lang.String,java.lang.String> commitData)
throws java.io.IOException
TwoPhaseCommitTwoPhaseCommit.commit(), but takes an additional commit data to be included
w/ the commit.
NOTE: some implementations may not support any custom data to be included w/ the commit and may discard it altogether. Consult the actual implementation documentation for verifying if this is supported.
prepareCommit in interface TwoPhaseCommitjava.io.IOExceptionTwoPhaseCommit.prepareCommit()public void commit()
throws java.io.IOException
TwoPhaseCommitTwoPhaseCommit.prepareCommit(), and
after it returns, the caller can assume that the changes were successfully
committed to the underlying storage.commit in interface TwoPhaseCommitjava.io.IOExceptionpublic void commit(java.util.Map<java.lang.String,java.lang.String> commitData)
throws java.io.IOException
TwoPhaseCommitTwoPhaseCommit.commit(), but takes an additional commit data to be included
w/ the commit.commit in interface TwoPhaseCommitjava.io.IOExceptionTwoPhaseCommit.commit(),
TwoPhaseCommit.prepareCommit(Map)public void rollback()
throws java.io.IOException
TwoPhaseCommitTwoPhaseCommit.commit() or
TwoPhaseCommit.prepareCommit(), this method is used to roll all other objects
back to their previous state.rollback in interface TwoPhaseCommitjava.io.IOExceptionCopyright © 2000-2022 Apache Software Foundation. All Rights Reserved.