public abstract class BaseMultipartUploadTask<Request extends MultipartUploadRequest,Result extends CompleteMultipartUploadResult>
extends java.lang.Object
implements java.util.concurrent.Callable<Result>
限定符和类型 | 字段和说明 |
---|---|
protected int |
CPU_SIZE |
protected int |
KEEP_ALIVE_TIME |
protected InternalRequestOperation |
mApiOperation |
protected int |
MAX_CORE_POOL_SIZE |
protected int |
MAX_IMUM_POOL_SIZE |
protected int |
MAX_QUEUE_SIZE |
protected boolean |
mCheckCRC64 |
protected OSSCompletedCallback<Request,Result> |
mCompletedCallback |
protected ExecutionContext |
mContext |
protected long |
mFileLength |
protected boolean |
mIsCancel |
protected long |
mLastPartSize |
protected java.lang.Object |
mLock |
protected int[] |
mPartAttr |
protected java.util.List<PartETag> |
mPartETags |
protected int |
mPartExceptionCount |
protected java.util.concurrent.ThreadPoolExecutor |
mPoolExecutor |
protected OSSProgressCallback<Request> |
mProgressCallback |
protected Request |
mRequest |
protected int |
mRunPartTaskCount |
protected long |
mUploadedLength |
protected java.lang.Exception |
mUploadException |
protected java.io.File |
mUploadFile |
protected java.lang.String |
mUploadFilePath |
protected java.lang.String |
mUploadId |
protected Uri |
mUploadUri |
protected int |
PART_SIZE_ALIGN_NUM |
构造器和说明 |
---|
BaseMultipartUploadTask(InternalRequestOperation operation,
Request request,
OSSCompletedCallback<Request,Result> completedCallback,
ExecutionContext context) |
限定符和类型 | 方法和说明 |
---|---|
protected abstract void |
abortThisUpload()
abort upload
|
Result |
call() |
protected long |
ceilPartSize(long partSize) |
protected void |
checkCancel()
check is or not cancel
|
protected void |
checkException() |
protected void |
checkInitData() |
protected void |
checkPartSize(int[] partAttr)
check part size
|
protected boolean |
checkWaitCondition(int partNum) |
protected CompleteMultipartUploadResult |
completeMultipartUploadResult()
complete multipart upload
|
protected abstract Result |
doMultipartUpload()
do multipart upload task
|
protected abstract void |
initMultipartUploadId()
init multipart upload id
|
protected void |
notifyMultipartThread()
notify wait thread
|
protected void |
onProgressCallback(Request request,
long currentSize,
long totalSize)
progress callback
|
protected void |
preUploadPart(int readIndex,
int byteCount,
int partNumber) |
protected abstract void |
processException(java.lang.Exception e) |
protected void |
releasePool() |
protected void |
uploadPart(int readIndex,
int byteCount,
int partNumber) |
protected void |
uploadPartFinish(PartETag partETag) |
protected final int CPU_SIZE
protected final int MAX_CORE_POOL_SIZE
protected final int MAX_IMUM_POOL_SIZE
protected final int KEEP_ALIVE_TIME
protected final int MAX_QUEUE_SIZE
protected final int PART_SIZE_ALIGN_NUM
protected java.util.concurrent.ThreadPoolExecutor mPoolExecutor
protected java.util.List<PartETag> mPartETags
protected java.lang.Object mLock
protected InternalRequestOperation mApiOperation
protected ExecutionContext mContext
protected java.lang.Exception mUploadException
protected boolean mIsCancel
protected java.io.File mUploadFile
protected java.lang.String mUploadId
protected long mFileLength
protected int mPartExceptionCount
protected int mRunPartTaskCount
protected long mUploadedLength
protected boolean mCheckCRC64
protected Request extends MultipartUploadRequest mRequest
protected OSSCompletedCallback<Request extends MultipartUploadRequest,Result extends CompleteMultipartUploadResult> mCompletedCallback
protected OSSProgressCallback<Request extends MultipartUploadRequest> mProgressCallback
protected int[] mPartAttr
protected java.lang.String mUploadFilePath
protected long mLastPartSize
protected Uri mUploadUri
public BaseMultipartUploadTask(InternalRequestOperation operation, Request request, OSSCompletedCallback<Request,Result> completedCallback, ExecutionContext context)
protected abstract void abortThisUpload()
protected abstract void initMultipartUploadId() throws java.io.IOException, ClientException, ServiceException
java.io.IOException
ClientException
ServiceException
protected abstract Result doMultipartUpload() throws java.io.IOException, ServiceException, ClientException, java.lang.InterruptedException
java.io.IOException
ServiceException
ClientException
java.lang.InterruptedException
protected void checkCancel() throws ClientException
ClientException
protected void preUploadPart(int readIndex, int byteCount, int partNumber) throws java.lang.Exception
java.lang.Exception
protected void uploadPartFinish(PartETag partETag) throws java.lang.Exception
java.lang.Exception
public Result call() throws java.lang.Exception
call
在接口中 java.util.concurrent.Callable<Result extends CompleteMultipartUploadResult>
java.lang.Exception
protected void checkInitData() throws ClientException
ClientException
protected void uploadPart(int readIndex, int byteCount, int partNumber)
protected abstract void processException(java.lang.Exception e)
protected CompleteMultipartUploadResult completeMultipartUploadResult() throws ClientException, ServiceException
ClientException
ServiceException
protected void releasePool()
protected void checkException() throws java.io.IOException, ServiceException, ClientException
java.io.IOException
ServiceException
ClientException
protected boolean checkWaitCondition(int partNum)
protected void notifyMultipartThread()
protected void checkPartSize(int[] partAttr)
partAttr
- protected long ceilPartSize(long partSize)
protected void onProgressCallback(Request request, long currentSize, long totalSize)
request
- currentSize
- totalSize
-