Skip to content
Merged
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 @@ -23,6 +23,7 @@ option java_generate_equals_and_hash = true;
enum RequestType {
PIPELINE = 1;
CONTAINER = 2;
BLOCK = 3;
}

message Method {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,11 @@ public BlockManagerImpl(final ConfigurationSource conf,
mxBean = MBeans.register("BlockManager", "BlockManagerImpl", this);

// SCM block deleting transaction log and deleting service.
deletedBlockLog = new DeletedBlockLogImpl(conf, scm.getContainerManager(),
scm.getScmMetadataStore());
deletedBlockLog = new DeletedBlockLogImplV2(conf, scm.getContainerManager(),
scm.getScmHAManager().getRatisServer(),
scm.getScmMetadataStore().getDeletedBlocksTXTable(),
scm.getScmHAManager().getDBTransactionBuffer(),
scm.getScmContext());
Duration svcInterval = conf.getObject(
ScmConfig.class).getBlockDeletionInterval();
long serviceTimeout =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ void incrementCount(List<Long> txIDs)
void commitTransactions(List<DeleteBlockTransactionResult> transactionResults,
UUID dnID);

/**
* Creates a block deletion transaction and adds that into the log.
*
* @param containerID - container ID.
* @param blocks - blocks that belong to the same container.
*
* @throws IOException
*/
void addTransaction(long containerID, List<Long> blocks)
throws IOException;

/**
* Creates block deletion transactions for a set of containers,
* add into the log and persist them atomically. An object key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,27 +260,6 @@ private boolean isTransactionFailed(DeleteBlockTransactionResult result) {
return false;
}

/**
* {@inheritDoc}
*
* @param containerID - container ID.
* @param blocks - blocks that belong to the same container.
* @throws IOException
*/
@Override
public void addTransaction(long containerID, List<Long> blocks)
throws IOException {
lock.lock();
try {
Long nextTXID = scmMetadataStore.getNextDeleteBlockTXID();
DeletedBlocksTransaction tx =
constructNewTransaction(nextTXID, containerID, blocks);
scmMetadataStore.getDeletedBlocksTXTable().put(nextTXID, tx);
} finally {
lock.unlock();
}
}

@Override
public int getNumOfValidTransactions() throws IOException {
lock.lock();
Expand Down
Loading