@@ -136,7 +136,7 @@ public class WriteOperationHelper implements WriteOperations {
136136 * @param auditSpan span to activate
137137 * @param callbacks callbacks used by writeOperationHelper
138138 */
139- protected WriteOperationHelper (
139+ public WriteOperationHelper (
140140 final AuditSpanSource auditSpanSource ,
141141 final AuditSpan auditSpan ,
142142 final WriteOperationHelperCallbacks callbacks ) {
@@ -157,7 +157,10 @@ protected WriteOperationHelper(
157157 * @param retries number of retries
158158 * @param idempotent is the method idempotent
159159 */
160- void operationRetried (String text , Exception ex , int retries ,
160+ void operationRetried (
161+ String text ,
162+ Exception ex ,
163+ int retries ,
161164 boolean idempotent ) {
162165 LOG .info ("{}: Retried {}: {}" , text , retries , ex .toString ());
163166 LOG .debug ("Stack" , ex );
@@ -176,7 +179,8 @@ void operationRetried(String text, Exception ex, int retries,
176179 * @return the result of the call
177180 * @throws IOException any IOE raised, or translated exception
178181 */
179- public <T > T retry (String action ,
182+ public <T > T retry (
183+ String action ,
180184 String path ,
181185 boolean idempotent ,
182186 CallableRaisingIOE <T > operation )
@@ -285,6 +289,7 @@ private CompleteMultipartUploadResponse finalizeMultipartUpload(
285289 long length ,
286290 PutObjectOptions putOptions ,
287291 Retried retrying ) throws IOException {
292+
288293 if (partETags .isEmpty ()) {
289294 throw new PathIOException (destKey ,
290295 "No upload parts in multipart upload" );
@@ -303,43 +308,6 @@ private CompleteMultipartUploadResponse finalizeMultipartUpload(
303308 }
304309 }
305310
306- /**
307- * This completes a multipart upload to the destination key via
308- * {@code finalizeMultipartUpload()}.
309- * Retry policy: retrying, translated.
310- * Retries increment the {@code errorCount} counter.
311- * @param destKey destination
312- * @param uploadId multipart operation Id
313- * @param partETags list of partial uploads
314- * @param length length of the upload
315- * @param errorCount a counter incremented by 1 on every error; for
316- * use in statistics
317- * @param putOptions put object options
318- * @return the result of the operation.
319- * @throws IOException if problems arose which could not be retried, or
320- * the retry count was exceeded
321- */
322- @ Retries .RetryTranslated
323- public CompleteMultipartUploadResponse completeMPUwithRetries (
324- String destKey ,
325- String uploadId ,
326- List <CompletedPart > partETags ,
327- long length ,
328- AtomicInteger errorCount ,
329- PutObjectOptions putOptions )
330- throws IOException {
331- requireNonNull (uploadId );
332- requireNonNull (partETags );
333- LOG .debug ("Completing multipart upload {} with {} parts" ,
334- uploadId , partETags .size ());
335- return finalizeMultipartUpload (destKey ,
336- uploadId ,
337- partETags ,
338- length ,
339- putOptions ,
340- (text , e , r , i ) -> errorCount .incrementAndGet ());
341- }
342-
343311 /**
344312 * Abort a multipart upload operation.
345313 * @param destKey destination key of the upload
@@ -350,8 +318,11 @@ public CompleteMultipartUploadResponse completeMPUwithRetries(
350318 * @throws FileNotFoundException if the abort ID is unknown
351319 */
352320 @ Retries .RetryTranslated
353- public void abortMultipartUpload (String destKey , String uploadId ,
354- boolean shouldRetry , Retried retrying )
321+ public void abortMultipartUpload (
322+ String destKey ,
323+ String uploadId ,
324+ boolean shouldRetry ,
325+ Retried retrying )
355326 throws IOException {
356327 if (shouldRetry ) {
357328 // retrying option
@@ -537,8 +508,8 @@ public CompleteMultipartUploadResponse commitUpload(
537508 throws IOException {
538509 requireNonNull (uploadId );
539510 requireNonNull (partETags );
540- LOG .debug ("Completing multipart upload {} with {} parts" ,
541- uploadId , partETags .size ());
511+ LOG .debug ("Committing multipart upload {} to {} with {} parts" ,
512+ uploadId , destKey , partETags .size ());
542513 return finalizeMultipartUpload (destKey ,
543514 uploadId ,
544515 partETags ,
@@ -547,6 +518,44 @@ public CompleteMultipartUploadResponse commitUpload(
547518 Invoker .NO_OP );
548519 }
549520
521+ /**
522+ * This completes a multipart upload to the destination key via
523+ * {@code finalizeMultipartUpload()}.
524+ * Retry policy: retrying, translated.
525+ * Retries increment the {@code errorCount} counter.
526+ * @param destKey destination
527+ * @param uploadId multipart operation Id
528+ * @param partETags list of partial uploads
529+ * @param length length of the upload
530+ * @param errorCount a counter incremented by 1 on every error; for
531+ * use in statistics
532+ * @param putOptions put object options
533+ * @return the result of the operation.
534+ * @throws IOException if problems arose which could not be retried, or
535+ * the retry count was exceeded
536+ */
537+ @ Retries .RetryTranslated
538+ public CompleteMultipartUploadResponse completeMPUwithRetries (
539+ String destKey ,
540+ String uploadId ,
541+ List <CompletedPart > partETags ,
542+ long length ,
543+ AtomicInteger errorCount ,
544+ PutObjectOptions putOptions )
545+ throws IOException {
546+ requireNonNull (uploadId );
547+ requireNonNull (partETags );
548+ LOG .debug ("Completing multipart upload {} to {} with {} parts" ,
549+ uploadId , destKey , partETags .size ());
550+ return finalizeMultipartUpload (destKey ,
551+ uploadId ,
552+ partETags ,
553+ length ,
554+ putOptions ,
555+ (text , e , r , i ) -> errorCount .incrementAndGet ());
556+ }
557+
558+
550559 /**
551560 * Upload part of a multi-partition file.
552561 * @param durationTrackerFactory duration tracker factory for operation
0 commit comments