[
https://issues.apache.org/jira/browse/HDFS-11504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15973101#comment-15973101
]
Anu Engineer commented on HDFS-11504:
-------------------------------------
[~xyao] Thanks for updating the patch. It looks very good, some minor comments
to take care of. I think we are very close to nailing these APIs.
* In AllocatedBlock.java:
{{private boolean createContainer;}} Could we rename this to shouldCreate ?
* Meta comment on {{BlockManagerImpl#allocateBlock}}
We are going to send all new keys to the currently open container. This will
make one of the open container get all the writes. Ideally, we should have a
list of open containers and send writes to these containers in parallel. That
way we get better throughput. I am worried that in this code path, we will
create bottlenecks for write/read or write heavy work load.
* // Allocate key for the block
{{String blockKey = UUID.randomUUID().toString();}}
Should we maintain a block ID per open container, then we can have
block1, block2 , block3 ...for each container, and might make easy to debug. I
do see UUID random is easier to code though.
* {{BlockManagerImpl#allocateBlock#Line 134}}
{{pipeline != null }} imagine we do get a null pipeline, do you
want to throw an exception. At a more higher level, I was trying to understand
why we would ever return a null from this function instead of exception if we
failed to allocate a block.
* As an extension to the above point if we ever return {{null}} we will get a
{NullPointerException}} in
{{StorageContainerLocationProtocolServerSideTranslatorPB#allocateScmBlock}}
* Another meta comment: Might be a good idea to have some log.debug messages in
the failure paths.
> Ozone: SCM: Add AllocateBlock/DeleteBlock/GetBlock APIs
> -------------------------------------------------------
>
> Key: HDFS-11504
> URL: https://issues.apache.org/jira/browse/HDFS-11504
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Affects Versions: HDFS-7240
> Reporter: Xiaoyu Yao
> Assignee: Xiaoyu Yao
> Attachments: HDFS-11504-HDFS-7240.001.patch,
> HDFS-11504-HDFS-7240.002.patch, HDFS-11504-HDFS-7240.003.patch,
> HDFS-11504-HDFS-7240.004.patch
>
>
> The signature of the APIs are listed below. This allows SCM to
> 1) allocateBlock for client and maintain the key->container mapping in level
> DB in addition to the existing container to pipeline mapping in level DB.
> 2) return the pipeline of a block based on the key.
> 3) remove the block based on the key of the block.
> {code}
> <Pipeline,key> allocateBlock(long size)
> <Pipeline> getBlock(key);
> void deleteBlock(key);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]