FAQ
Repository: hive
Updated Branches:
   refs/heads/master 936bc30a7 -> cd464e9fd


HIVE-13834 : Use LinkedHashMap instead of HashMap for LockRequestBuilder to maintain predictable iteration order (Wei Zheng, reviewed by Eugene Koifman)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/cd464e9f
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/cd464e9f
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/cd464e9f

Branch: refs/heads/master
Commit: cd464e9fdd5d7b2a18b91bdc253cd1ffe8a5cdd4
Parents: 936bc30
Author: Wei Zheng <weiz@apache.org>
Authored: Wed Jun 1 10:32:13 2016 -0700
Committer: Wei Zheng <weiz@apache.org>
Committed: Wed Jun 1 10:32:13 2016 -0700

----------------------------------------------------------------------
  .../apache/hadoop/hive/metastore/LockRequestBuilder.java | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/cd464e9f/metastore/src/java/org/apache/hadoop/hive/metastore/LockRequestBuilder.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/LockRequestBuilder.java b/metastore/src/java/org/apache/hadoop/hive/metastore/LockRequestBuilder.java
index 6317a96..00a1907 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/LockRequestBuilder.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/LockRequestBuilder.java
@@ -23,7 +23,7 @@ import org.apache.hadoop.hive.metastore.api.LockType;

  import java.net.InetAddress;
  import java.net.UnknownHostException;
-import java.util.HashMap;
+import java.util.LinkedHashMap;
  import java.util.Map;

  /**
@@ -102,13 +102,13 @@ public class LockRequestBuilder {
    // level of locking. To do this we put all locks components in trie based
    // on dbname, tablename, partition name and handle the promotion as new
    // requests come in. This structure depends on the fact that null is a
- // valid key in a HashMap. So a database lock will map to (dbname, null,
+ // valid key in a LinkedHashMap. So a database lock will map to (dbname, null,
    // null).
    private static class LockTrie {
      Map<String, TableTrie> trie;

      LockTrie() {
- trie = new HashMap<String, TableTrie>();
+ trie = new LinkedHashMap<String, TableTrie>();
      }

      public void add(LockComponent comp) {
@@ -156,10 +156,10 @@ public class LockRequestBuilder {
        }
      }

- private static class TableTrie extends HashMap<String, PartTrie> {
+ private static class TableTrie extends LinkedHashMap<String, PartTrie> {
      }

- private static class PartTrie extends HashMap<String, LockComponent> {
+ private static class PartTrie extends LinkedHashMap<String, LockComponent> {
      }

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJun 1, '16 at 5:36p
activeJun 1, '16 at 5:36p
posts1
users1
websitehive.apache.org

1 user in discussion

Weiz: 1 post

People

Translate

site design / logo © 2021 Grokbase