public class OSSCommitter extends Object implements RecoverableFsDataOutputStream.Committer
Constructor and Description |
---|
OSSCommitter(OSSAccessor ossAccessor,
String objectName,
String uploadId,
List<com.aliyun.oss.model.PartETag> partETags,
long totalLength) |
Modifier and Type | Method and Description |
---|---|
void |
commit()
Commits the file, making it visible.
|
void |
commitAfterRecovery()
Commits the file, making it visible.
|
RecoverableWriter.CommitRecoverable |
getRecoverable()
Gets a recoverable object to recover the committer.
|
public OSSCommitter(OSSAccessor ossAccessor, String objectName, String uploadId, List<com.aliyun.oss.model.PartETag> partETags, long totalLength)
public void commit() throws IOException
RecoverableFsDataOutputStream.Committer
commit
in interface RecoverableFsDataOutputStream.Committer
IOException
- Thrown if committing fails.public void commitAfterRecovery() throws IOException
RecoverableFsDataOutputStream.Committer
This method tolerates situations where the file was already committed and will not raise an exception in that case. This is important for idempotent commit retries as they need to happen after recovery.
commitAfterRecovery
in interface RecoverableFsDataOutputStream.Committer
IOException
- Thrown if committing fails.public RecoverableWriter.CommitRecoverable getRecoverable()
RecoverableFsDataOutputStream.Committer
getRecoverable
in interface RecoverableFsDataOutputStream.Committer
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.