public final class CommitOperations.CommitContext extends Object implements Closeable
BulkOperationState
field, which, if
there is a metastore, will be requested from the store so that it
can track multiple creation operations within the same overall operation.
This will be null if there is no metastore, or the store chooses not
to provide one.
This can only be created through CommitOperations.initiateCommitOperation(Path)
.
Once the commit operation has completed, it must be closed.
It must not be reused.Modifier and Type | Method and Description |
---|---|
void |
abortMultipartCommit(String destKey,
String uploadId)
|
void |
abortSingleCommit(SinglePendingCommit commit)
|
void |
close() |
CommitOperations.MaybeIOE |
commit(SinglePendingCommit commit,
String origin)
Commit a single pending commit; exceptions are caught
and converted to an outcome.
|
void |
commitOrFail(SinglePendingCommit commit)
Commit the operation, throwing an exception on any failure.
|
void |
revertCommit(SinglePendingCommit commit)
|
String |
toString() |
public void commitOrFail(SinglePendingCommit commit) throws IOException
CommitOperations.commitOrFail(SinglePendingCommit, BulkOperationState)
.commit
- commit to executeIOException
- on a failurepublic CommitOperations.MaybeIOE commit(SinglePendingCommit commit, String origin)
CommitOperations.commit(SinglePendingCommit, String, BulkOperationState)
.commit
- entry to commitorigin
- origin path/string for outcome textpublic void abortSingleCommit(SinglePendingCommit commit) throws IOException
commit
- pending commit to abortFileNotFoundException
- if the abort ID is unknownIOException
- on any failurepublic void revertCommit(SinglePendingCommit commit) throws IOException
commit
- pending commitIOException
- failurepublic void abortMultipartCommit(String destKey, String uploadId) throws IOException
destKey
- destination keyuploadId
- upload to cancelFileNotFoundException
- if the abort ID is unknownIOException
- on any failurepublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2008–2021 Apache Software Foundation. All rights reserved.