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

Xiaoyu Yao commented on HDFS-11926:
-----------------------------------

Thanks [~cheersyang] for working on this. The patch looks pretty good to me. 
Just few questions:

1. FilteredKeys.java
Line 42/111: should we just keep the DBIterator in FilteredKeys class and wrap 
only the methods needed for KeyFilter (like 
getDbIterator().peekPrev().getKey(); ). This way, we can remove the low level 
details like KeyFilter#set/getDbIterator. 

2. Race between iterator and modification. 
We should be fine using either iterator with/without snapshot. A level DB 
iterator pins the memory and data files that existed when the iterator was 
created. It fits better for use case like list APIs here. Creating an iterator 
with snapshot will be more expensive considering the increased the memory/disk 
footprint due to snapshot.





> Ozone: Implement a common helper to return a range of KVs in levelDB
> --------------------------------------------------------------------
>
>                 Key: HDFS-11926
>                 URL: https://issues.apache.org/jira/browse/HDFS-11926
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ozone
>            Reporter: Weiwei Yang
>            Assignee: Weiwei Yang
>            Priority: Blocker
>         Attachments: HDFS-11926-HDFS-7240.001.patch, 
> HDFS-11926-HDFS-7240.002.patch, HDFS-11926-HDFS-7240.003.patch
>
>
> There are quite some *LIST* operations need to get a range of keys or values 
> from levelDB, and filter entries with key prefix. 
> # HDFS-11782 listKeys
> # HDFS-11779 listBuckets
> # HDFS-11773 listVolumes
> # HDFS-11679 listContainers
> we need to implement a common utility for them.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to