HBASE-17243 Reuse CompactionPartitionId and avoid creating MobFileName in PartitionedMobCompactor to avoid unnecessary new objects (addendum)
Signed-off-by: Matteo Bertozzi <matteo.bertozzi@cloudera.com>
This commit is contained in:
parent
efcd15bf67
commit
03423fec6b
|
@ -176,10 +176,11 @@ public class PartitionedMobCompactor extends MobCompactor {
|
|||
id.setDate(MobFileName.getDateFromName(fileName));
|
||||
CompactionPartition compactionPartition = filesToCompact.get(id);
|
||||
if (compactionPartition == null) {
|
||||
compactionPartition = new CompactionPartition(
|
||||
new CompactionPartitionId(id.getStartKey(), id.getDate()));
|
||||
CompactionPartitionId newId = new CompactionPartitionId(id.getStartKey(), id.getDate());
|
||||
compactionPartition = new CompactionPartition(newId);
|
||||
|
||||
compactionPartition.addFile(file);
|
||||
filesToCompact.put(id, compactionPartition);
|
||||
filesToCompact.put(newId, compactionPartition);
|
||||
} else {
|
||||
compactionPartition.addFile(file);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue