54
54
import org .apache .hadoop .hbase .backup .BackupType ;
55
55
import org .apache .hadoop .hbase .backup .util .BackupUtils ;
56
56
import org .apache .hadoop .hbase .client .Admin ;
57
+ import org .apache .hadoop .hbase .client .BufferedMutator ;
57
58
import org .apache .hadoop .hbase .client .ColumnFamilyDescriptor ;
58
59
import org .apache .hadoop .hbase .client .ColumnFamilyDescriptorBuilder ;
59
60
import org .apache .hadoop .hbase .client .Connection ;
@@ -412,9 +413,9 @@ public void writePathsPostBulkLoad(TableName tabName, byte[] region,
412
413
LOG .debug ("write bulk load descriptor to backup " + tabName + " with " + finalPaths .size ()
413
414
+ " entries" );
414
415
}
415
- try (Table table = connection .getTable (bulkLoadTableName )) {
416
+ try (BufferedMutator bufferedMutator = connection .getBufferedMutator (bulkLoadTableName )) {
416
417
List <Put > puts = BackupSystemTable .createPutForCommittedBulkload (tabName , region , finalPaths );
417
- table . put (puts );
418
+ bufferedMutator . mutate (puts );
418
419
LOG .debug ("written " + puts .size () + " rows for bulk load of " + tabName );
419
420
}
420
421
}
@@ -446,14 +447,14 @@ public void writeFilesForBulkLoadPreCommit(TableName tabName, byte[] region, fin
446
447
* @param rows the rows to be deleted
447
448
*/
448
449
public void deleteBulkLoadedRows (List <byte []> rows ) throws IOException {
449
- try (Table table = connection .getTable (bulkLoadTableName )) {
450
+ try (BufferedMutator bufferedMutator = connection .getBufferedMutator (bulkLoadTableName )) {
450
451
List <Delete > lstDels = new ArrayList <>();
451
452
for (byte [] row : rows ) {
452
453
Delete del = new Delete (row );
453
454
lstDels .add (del );
454
455
LOG .debug ("orig deleting the row: " + Bytes .toString (row ));
455
456
}
456
- table . delete (lstDels );
457
+ bufferedMutator . mutate (lstDels );
457
458
LOG .debug ("deleted " + rows .size () + " original bulkload rows" );
458
459
}
459
460
}
@@ -535,7 +536,7 @@ public void deleteBulkLoadedRows(List<byte[]> rows) throws IOException {
535
536
*/
536
537
public void writeBulkLoadedFiles (List <TableName > sTableList , Map <byte [], List <Path >>[] maps ,
537
538
String backupId ) throws IOException {
538
- try (Table table = connection .getTable (bulkLoadTableName )) {
539
+ try (BufferedMutator bufferedMutator = connection .getBufferedMutator (bulkLoadTableName )) {
539
540
long ts = EnvironmentEdgeManager .currentTime ();
540
541
int cnt = 0 ;
541
542
List <Put > puts = new ArrayList <>();
@@ -558,7 +559,7 @@ public void writeBulkLoadedFiles(List<TableName> sTableList, Map<byte[], List<Pa
558
559
}
559
560
}
560
561
if (!puts .isEmpty ()) {
561
- table . put (puts );
562
+ bufferedMutator . mutate (puts );
562
563
}
563
564
}
564
565
}
@@ -917,8 +918,8 @@ public void writeRegionServerLogTimestamp(Set<TableName> tables, Map<String, Lon
917
918
Put put = createPutForWriteRegionServerLogTimestamp (table , smapData , backupRoot );
918
919
puts .add (put );
919
920
}
920
- try (Table table = connection .getTable (tableName )) {
921
- table . put (puts );
921
+ try (BufferedMutator bufferedMutator = connection .getBufferedMutator (tableName )) {
922
+ bufferedMutator . mutate (puts );
922
923
}
923
924
}
924
925
0 commit comments