Class OSSLowLevelOutputStream

  • All Implemented Interfaces:
    alluxio.underfs.ContentHashable, java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable

    public class OSSLowLevelOutputStream
    extends alluxio.underfs.ObjectLowLevelOutputStream
    ObjectLowLevelOutputStream implement for OSS.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String mUploadId
      The upload id of this multipart upload.
      • Fields inherited from class alluxio.underfs.ObjectLowLevelOutputStream

        LOG, mBucketName, mClosed, mFile, mHash, mKey, mLocalOutputStream, mPartitionOffset, mPartitionSize, mRetryPolicy, mSingleCharWrite, mTmpDirs, UPLOAD_THRESHOLD
    • Constructor Summary

      Constructors 
      Constructor Description
      OSSLowLevelOutputStream​(java.lang.String bucketName, java.lang.String key, com.aliyun.oss.OSS oss, com.google.common.util.concurrent.ListeningExecutorService executor, alluxio.conf.AlluxioConfiguration ufsConf)
      Constructs a new stream for writing a file.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void abortMultiPartUploadInternal()  
      protected void completeMultiPartUploadInternal()  
      protected void createEmptyObject​(java.lang.String key)  
      protected com.aliyun.oss.OSS getClient()  
      java.util.Optional<java.lang.String> getContentHash()  
      protected void initMultiPartUploadInternal()  
      protected void putObject​(java.lang.String key, java.io.File file, java.lang.String md5)  
      protected void uploadPartInternal​(java.io.File file, int partNumber, boolean isLastPart, java.lang.String md5)  
      • Methods inherited from class alluxio.underfs.ObjectLowLevelOutputStream

        abortMultiPartUpload, close, flush, getPartNumber, uploadPart, uploadPart, waitForAllPartsUpload, write, write, write
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mUploadId

        protected volatile java.lang.String mUploadId
        The upload id of this multipart upload.
    • Constructor Detail

      • OSSLowLevelOutputStream

        public OSSLowLevelOutputStream​(java.lang.String bucketName,
                                       java.lang.String key,
                                       com.aliyun.oss.OSS oss,
                                       com.google.common.util.concurrent.ListeningExecutorService executor,
                                       alluxio.conf.AlluxioConfiguration ufsConf)
        Constructs a new stream for writing a file.
        Parameters:
        bucketName - the name of the bucket
        key - the key of the file
        oss - the OSS client to upload the file with
        executor - a thread pool executor
        ufsConf - the object store under file system configuration
    • Method Detail

      • abortMultiPartUploadInternal

        protected void abortMultiPartUploadInternal()
                                             throws java.io.IOException
        Specified by:
        abortMultiPartUploadInternal in class alluxio.underfs.ObjectLowLevelOutputStream
        Throws:
        java.io.IOException
      • uploadPartInternal

        protected void uploadPartInternal​(java.io.File file,
                                          int partNumber,
                                          boolean isLastPart,
                                          java.lang.String md5)
                                   throws java.io.IOException
        Specified by:
        uploadPartInternal in class alluxio.underfs.ObjectLowLevelOutputStream
        Throws:
        java.io.IOException
      • initMultiPartUploadInternal

        protected void initMultiPartUploadInternal()
                                            throws java.io.IOException
        Specified by:
        initMultiPartUploadInternal in class alluxio.underfs.ObjectLowLevelOutputStream
        Throws:
        java.io.IOException
      • completeMultiPartUploadInternal

        protected void completeMultiPartUploadInternal()
                                                throws java.io.IOException
        Specified by:
        completeMultiPartUploadInternal in class alluxio.underfs.ObjectLowLevelOutputStream
        Throws:
        java.io.IOException
      • createEmptyObject

        protected void createEmptyObject​(java.lang.String key)
                                  throws java.io.IOException
        Specified by:
        createEmptyObject in class alluxio.underfs.ObjectLowLevelOutputStream
        Throws:
        java.io.IOException
      • putObject

        protected void putObject​(java.lang.String key,
                                 java.io.File file,
                                 java.lang.String md5)
                          throws java.io.IOException
        Specified by:
        putObject in class alluxio.underfs.ObjectLowLevelOutputStream
        Throws:
        java.io.IOException
      • getContentHash

        public java.util.Optional<java.lang.String> getContentHash()
      • getClient

        protected com.aliyun.oss.OSS getClient()