[ 
https://issues.apache.org/jira/browse/HDDS-1984?focusedWorklogId=324800&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-324800
 ]

ASF GitHub Bot logged work on HDDS-1984:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 08/Oct/19 01:44
            Start Date: 08/Oct/19 01:44
    Worklog Time Spent: 10m 
      Work Description: arp7 commented on pull request #1555: HDDS-1984. Fix 
listBucket API.
URL: https://github.com/apache/hadoop/pull/1555#discussion_r332306087
 
 

 ##########
 File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/db/cache/TableCacheImpl.java
 ##########
 @@ -47,15 +48,22 @@
 public class TableCacheImpl<CACHEKEY extends CacheKey,
     CACHEVALUE extends CacheValue> implements TableCache<CACHEKEY, CACHEVALUE> 
{
 
-  private final ConcurrentHashMap<CACHEKEY, CACHEVALUE> cache;
+  private final Map<CACHEKEY, CACHEVALUE> cache;
   private final NavigableSet<EpochEntry<CACHEKEY>> epochEntries;
   private ExecutorService executorService;
   private CacheCleanupPolicy cleanupPolicy;
 
 
 
   public TableCacheImpl(CacheCleanupPolicy cleanupPolicy) {
-    cache = new ConcurrentHashMap<>();
+
+    // As for full table cache only we need elements to be inserted in sorted
+    // manner, so that list will be easy. For other we can go with Hash map.
+    if (cleanupPolicy == CacheCleanupPolicy.NEVER) {
 
 Review comment:
   We do need a solution for this, it's not very good to keep adding special 
checks for Cache policy NEVER. The code will become fragile.
   
   I think when we first added cache policies you proposed making it an 
interface. Let's do that now.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 324800)
    Time Spent: 2h 10m  (was: 2h)

> Fix listBucket API
> ------------------
>
>                 Key: HDDS-1984
>                 URL: https://issues.apache.org/jira/browse/HDDS-1984
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Bharat Viswanadham
>            Assignee: Bharat Viswanadham
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h 10m
>  Remaining Estimate: 0h
>
> This Jira is to fix listBucket API in HA code path.
> In HA, we have an in-memory cache, where we put the result to in-memory cache 
> and return the response, later it will be picked by double buffer thread and 
> it will flush to disk. So, now when do listBuckets, it should use both 
> in-memory cache and rocksdb bucket table to list buckets in a volume.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to