[ 
https://issues.apache.org/jira/browse/HDFS-12283?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16119663#comment-16119663
 ] 

Weiwei Yang edited comment on HDFS-12283 at 8/9/17 10:09 AM:
-------------------------------------------------------------

Some more thoughts. Each key value pair in the log is 

{code}
// A record in the log
{ long txid : BlockDeletionTransaction tx}

// where the value is (protobuf message)
BlockDeletionTransaction {
  long txid;
  String containerName;
  List<String> blockIDs;
}
{code}

Following API needs to be implemented

{code}
// Returns a certain size list of transactions
// criteria: each 0<= processedCount  < 5
// We may need to maintain a position while scanning the log
// to avoid repetitively scanning a certain range of records
List<BlockDeletionTransaction> getBlockDeletionTransactions(int count);

// Increment processedCount for given list of transactions by 1
// if count > 5, reset to -1
void incrementProcessedCount(List<String> txIDs);

// Delete transactions from the log based on their IDs
void commitTransactions(List<String> txIDs);
{code}

Please let me know if this makes sense.
Thanks


was (Author: cheersyang):
Some more thoughts. Each key value pair in the log is 

{code}

// A record in the log
{ long txid : BlockDeletionTransaction tx}

// where the value is (protobuf message)
BlockDeletionTransaction {
  long txid;
  String containerName;
  List<String> blockIDs;
}
{code}

Following API needs to be implemented

{code}
// Returns a certain size list of transactions
// criteria: each 0<= processedCount  < 5
// We may need to maintain a position while scanning the log
// to avoid repetitively scanning a certain range of records
List<BlockDeletionTransaction> getBlockDeletionTransactions(int count);

// Increment processedCount for given list of transactions by 1
// if count > 5, reset to -1
void incrementProcessedCount(List<String> txIDs);

// Delete transactions from the log based on their IDs
void commitTransactions(List<String> txIDs);
{code}

Please let me know if this makes sense.
Thanks

> Ozone: DeleteKey-5: Implement SCM DeletedBlockLog
> -------------------------------------------------
>
>                 Key: HDFS-12283
>                 URL: https://issues.apache.org/jira/browse/HDFS-12283
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ozone, scm
>            Reporter: Weiwei Yang
>            Assignee: Weiwei Yang
>
> The DeletedBlockLog is a persisted log in SCM to keep tracking container 
> blocks which are under deletion. It maintains info about under-deletion 
> container blocks that notified by KSM, and the state how it is processed. We 
> can use RocksDB to implement the 1st version of the log, the schema looks like
> ||TxID||ContainerName||Block List||ProcessedCount||
> |0|c1|b1,b2,b3|0|
> |1|c2|b1|3|
> |2|c2|b2, b3|-1|
> Some explanations
> # TxID is an incremental long value transaction ID for ONE container and 
> multiple blocks
> # Container name is the name of the container
> # Block list is a list of block IDs
> # ProcessedCount is the number of times SCM has sent this record to datanode, 
> it represents the "state" of the transaction, it is in range of \[-1, 5\], -1 
> means the transaction eventually failed after some retries, 5 is the max 
> number times of retries.
> We need to define {{DeletedBlockLog}} as an interface and implement this with 
> RocksDB {{MetadataStore}} as the first version.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to