accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubbsii <...@git.apache.org>
Subject [GitHub] accumulo pull request #209: ACCUMULO-4578 release namespace lock when compac...
Date Mon, 30 Jan 2017 17:10:15 GMT
Github user ctubbsii commented on a diff in the pull request:

    https://github.com/apache/accumulo/pull/209#discussion_r98489892
  
    --- Diff: fate/src/main/java/org/apache/accumulo/fate/AdminUtil.java ---
    @@ -110,25 +110,36 @@ public String getTop() {
       public static class FateStatus {
     
         private final List<TransactionStatus> transactions;
    -    private final Map<Long,List<String>> danglingHeldLocks;
    -    private final Map<Long,List<String>> danglingWaitingLocks;
    +    private final Map<String,List<String>> danglingHeldLocks;
    +    private final Map<String,List<String>> danglingWaitingLocks;
    +
    +    private static Map<String,List<String>> convert(Map<Long,List<String>>
danglocks) {
    +      if (danglocks.isEmpty()) {
    +        return Collections.emptyMap();
    +      }
    +
    +      Map<String,List<String>> ret = new HashMap<>();
    +      for (Entry<Long,List<String>> entry : danglocks.entrySet()) {
    +        ret.put(String.format("%016x", entry.getKey()), Collections.unmodifiableList(entry.getValue()));
    --- End diff --
    
    That's fine. This is more clear in the previous code when the formatting was in the log
message. As a private utility method, it's far less clear how the formatting is used, or why
it matters. It's not clear, for example, that this is just pre-formatting the object for future
logging. The method is making assumptions about the caller's behavior.  It's probably fine,
but it'd help if there were a comment explaining it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message