Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.stream.Collectors;

import org.apache.hadoop.hdds.conf.ConfigurationSource;
import org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos;
import org.apache.hadoop.hdds.scm.ScmConfigKeys;
import org.apache.hadoop.hdds.scm.container.common.helpers.StorageContainerException;
import org.apache.hadoop.hdds.scm.pipeline.PipelineID;
Expand All @@ -41,9 +40,7 @@
import org.apache.hadoop.hdds.utils.MetadataKeyFilters;
import org.apache.hadoop.hdds.utils.MetadataKeyFilters.KeyPrefixFilter;
import org.apache.hadoop.hdds.utils.db.Table;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.ozone.container.common.helpers.BlockData;
import org.apache.hadoop.ozone.container.common.helpers.ChunkInfoList;
import org.apache.hadoop.ozone.container.common.impl.ContainerData;
import org.apache.hadoop.ozone.container.common.impl.TopNOrderedContainerDeletionChoosingPolicy;
import org.apache.hadoop.ozone.container.common.interfaces.Container;
Expand Down Expand Up @@ -293,29 +290,15 @@ public BackgroundTaskResult call() throws Exception {
}
}

// Once files are deleted... replace deleting entries with deleted
// entries
// Once blocks are deleted... remove the blockID from blockDataTable.
try(BatchOperation batch = meta.getStore().getBatchHandler()
.initBatchOperation()) {
Table< String, ChunkInfoList > deletedBlocksTable =
meta.getStore().getDeletedBlocksTable();
for (String entry : succeedBlocks) {
List< ContainerProtos.ChunkInfo > chunkList =
blockDataTable.get(entry).getChunks();
String blockId = entry.substring(
OzoneConsts.DELETING_KEY_PREFIX.length());

deletedBlocksTable.putWithBatch(
batch, blockId,
new ChunkInfoList(chunkList));
blockDataTable.deleteWithBatch(batch, entry);
}

int deleteBlockCount = succeedBlocks.size();
containerData.updateAndCommitDBCounters(meta, batch,
deleteBlockCount);


// update count of pending deletion blocks and block count in
// in-memory container status.
containerData.decrPendingDeletionBlocks(deleteBlockCount);
Expand Down
Loading