@@ -305,9 +305,9 @@ protected PartitionedMobCompactionRequest select(List<FileStatus> candidates,
305305 // all the files are selected
306306 request .setCompactionType (CompactionType .ALL_FILES );
307307 }
308- LOG .info ("The compaction type is " + request . getCompactionType () + ", the request has "
309- + totalDelFiles + " del files, " + selectedFileCount + " selected files, and "
310- + irrelevantFileCount + " irrelevant files" );
308+ LOG .info ("The compaction type is {}, the request has {} del files, {} selected files, and {} " +
309+ "irrelevant files table '{}' and column '{}'" , request . getCompactionType (), totalDelFiles ,
310+ selectedFileCount , irrelevantFileCount , tableName , column . getNameAsString () );
311311 return request ;
312312 }
313313
@@ -347,10 +347,12 @@ protected List<Path> performCompaction(PartitionedMobCompactionRequest request)
347347 totalDelFileCount ++;
348348 }
349349 }
350- LOG .info ("After merging, there are " + totalDelFileCount + " del files" );
350+ LOG .info ("After merging, there are {} del files. table='{}' column='{}'" , totalDelFileCount ,
351+ tableName , column .getNameAsString ());
351352 // compact the mob files by partitions.
352353 paths = compactMobFiles (request );
353- LOG .info ("After compaction, there are " + paths .size () + " mob files" );
354+ LOG .info ("After compaction, there are {} mob files. table='{}' column='{}'" , paths .size (),
355+ tableName , column .getNameAsString ());
354356 } finally {
355357 for (CompactionDelPartition delPartition : request .getDelPartitions ()) {
356358 closeStoreFileReaders (delPartition .getStoreFiles ());
@@ -359,15 +361,17 @@ protected List<Path> performCompaction(PartitionedMobCompactionRequest request)
359361
360362 // archive the del files if all the mob files are selected.
361363 if (request .type == CompactionType .ALL_FILES && !request .getDelPartitions ().isEmpty ()) {
362- LOG .info (
363- "After a mob compaction with all files selected, archiving the del files " );
364+ LOG .info ("After a mob compaction with all files selected, archiving the del files for " +
365+ "table='{}' and column='{}'" , tableName , column . getNameAsString () );
364366 for (CompactionDelPartition delPartition : request .getDelPartitions ()) {
365367 LOG .info (Objects .toString (delPartition .listDelFiles ()));
366368 try {
367369 MobUtils .removeMobFiles (conf , fs , tableName , mobTableDir , column .getName (),
368370 delPartition .getStoreFiles ());
369371 } catch (IOException e ) {
370- LOG .error ("Failed to archive the del files " + delPartition .getStoreFiles (), e );
372+ LOG .error ("Failed to archive the del files {} for partition {} table='{}' and " +
373+ "column='{}'" , delPartition .getStoreFiles (), delPartition .getId (), tableName ,
374+ column .getNameAsString (), e );
371375 }
372376 }
373377 }
@@ -461,7 +465,8 @@ protected List<Path> compactMobFiles(final PartitionedMobCompactionRequest reque
461465 throws IOException {
462466 Collection <CompactionPartition > partitions = request .compactionPartitions ;
463467 if (partitions == null || partitions .isEmpty ()) {
464- LOG .info ("No partitions of mob files" );
468+ LOG .info ("No partitions of mob files in table='{}' and column='{}'" , tableName ,
469+ column .getNameAsString ());
465470 return Collections .emptyList ();
466471 }
467472 List <Path > paths = new ArrayList <>();
@@ -483,7 +488,8 @@ protected List<Path> compactMobFiles(final PartitionedMobCompactionRequest reque
483488 results .put (partition .getPartitionId (), pool .submit (new Callable <List <Path >>() {
484489 @ Override
485490 public List <Path > call () throws Exception {
486- LOG .info ("Compacting mob files for partition " + partition .getPartitionId ());
491+ LOG .info ("Compacting mob files for partition {} for table='{}' and column='{}'" ,
492+ partition .getPartitionId (), tableName , column .getNameAsString ());
487493 return compactMobFilePartition (request , partition , delFiles , c , table );
488494 }
489495 }));
@@ -495,13 +501,15 @@ public List<Path> call() throws Exception {
495501 paths .addAll (result .getValue ().get ());
496502 } catch (Exception e ) {
497503 // just log the error
498- LOG .error ("Failed to compact the partition " + result .getKey (), e );
504+ LOG .error ("Failed to compact the partition {} for table='{}' and column='{}'" ,
505+ result .getKey (), tableName , column .getNameAsString (), e );
499506 failedPartitions .add (result .getKey ());
500507 }
501508 }
502509 if (!failedPartitions .isEmpty ()) {
503510 // if any partition fails in the compaction, directly throw an exception.
504- throw new IOException ("Failed to compact the partitions " + failedPartitions );
511+ throw new IOException ("Failed to compact the partitions " + failedPartitions +
512+ " for table='" + tableName + "' column='" + column .getNameAsString () + "'" );
505513 }
506514 } finally {
507515 try {
@@ -567,8 +575,9 @@ private List<Path> compactMobFilePartition(PartitionedMobCompactionRequest reque
567575 // move to the next batch.
568576 offset += batch ;
569577 }
570- LOG .info ("Compaction is finished. The number of mob files is changed from " + files .size ()
571- + " to " + newFiles .size ());
578+ LOG .info ("Compaction is finished. The number of mob files is changed from {} to {} for " +
579+ "partition={} for table='{}' and column='{}'" , files .size (), newFiles .size (),
580+ partition .getPartitionId (), tableName , column .getNameAsString ());
572581 return newFiles ;
573582 }
574583
@@ -675,8 +684,12 @@ private void compactMobFilesInBatch(PartitionedMobCompactionRequest request,
675684 cleanupTmpMobFile = false ;
676685 cleanupCommittedMobFile = true ;
677686 // bulkload the ref file
687+ LOG .info ("start MOB ref bulkload for partition {} table='{}' column='{}'" ,
688+ partition .getPartitionId (), tableName , column .getNameAsString ());
678689 bulkloadRefFile (connection , table , bulkloadPathOfPartition , filePath .getName ());
679690 cleanupCommittedMobFile = false ;
691+ LOG .info ("end MOB ref bulkload for partition {} table='{}' column='{}'" ,
692+ partition .getPartitionId (), tableName , column .getNameAsString ());
680693 newFiles .add (new Path (mobFamilyDir , filePath .getName ()));
681694 }
682695
@@ -703,7 +716,11 @@ private void compactMobFilesInBatch(PartitionedMobCompactionRequest request,
703716 }
704717
705718 if (cleanupCommittedMobFile ) {
706- deletePath (new Path (mobFamilyDir , filePath .getName ()));
719+ LOG .error ("failed MOB ref bulkload for partition {} table='{}' column='{}'" ,
720+ partition .getPartitionId (), tableName , column .getNameAsString ());
721+ MobUtils .removeMobFiles (conf , fs , tableName , mobTableDir , column .getName (),
722+ Collections .singletonList (new HStoreFile (fs , new Path (mobFamilyDir , filePath .getName ()),
723+ conf , compactionCacheConfig , BloomType .NONE , true )));
707724 }
708725 }
709726 }
@@ -904,6 +921,7 @@ private Pair<Long, Long> getFileInfo(List<HStoreFile> storeFiles) throws IOExcep
904921 * @param path The path of the file to be deleted.
905922 */
906923 private void deletePath (Path path ) {
924+ LOG .debug ("Cleanup, delete path '{}'" , path );
907925 try {
908926 if (path != null ) {
909927 fs .delete (path , true );
0 commit comments