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

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

                Author: ASF GitHub Bot
            Created on: 07/Oct/19 23:31
            Start Date: 07/Oct/19 23:31
    Worklog Time Spent: 10m 
      Work Description: bharatviswa504 commented on pull request #1555: 
HDDS-1984. Fix listBucket API.
URL: https://github.com/apache/hadoop/pull/1555#discussion_r332281050
 
 

 ##########
 File path: 
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/utils/db/cache/CacheKey.java
 ##########
 @@ -53,4 +53,18 @@ public boolean equals(Object o) {
   public int hashCode() {
     return Objects.hash(key);
   }
+
+  @Override
+  public int compareTo(Object o) {
+    if(Objects.equals(key, ((CacheKey<?>)o).key)) {
+      return 0;
+    } else {
+      if (key instanceof String) {
+        return ((String) key).compareTo((String) ((CacheKey<?>)o).key);
+      } else {
+        // If not type string, convert to string and compare.
+        return key.toString().compareTo((((CacheKey<?>) o).key).toString());
 
 Review comment:
   When CacheKey<KEY> KEY type is not string. For BucketTable type is string, 
for tokentable type is OzoneTokenIdentifier. As this is common class used by 
all tables in OM, added the if, else condition.
 
----------------------------------------------------------------
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:
us...@infra.apache.org


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

    Worklog Id:     (was: 324696)
    Time Spent: 1h 20m  (was: 1h 10m)

> 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: 1h 20m
>  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: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to