org.apache.hadoop.hive.ql.exec.persistence
Class HashMapWrapper

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.persistence.AbstractMapJoinTableContainer
      extended by org.apache.hadoop.hive.ql.exec.persistence.HashMapWrapper
All Implemented Interfaces:
Serializable, MapJoinTableContainer

public class HashMapWrapper
extends AbstractMapJoinTableContainer
implements Serializable

Simple wrapper for persistent Hashmap implementing only the put/get/remove/clear interface. The main memory hash table acts as a cache and all put/get will operate on it first. If the size of the main memory hash table exceeds a certain threshold, new elements will go into the persistent hash table.

See Also:
Serialized Form

Constructor Summary
HashMapWrapper()
           
HashMapWrapper(int threshold)
           
HashMapWrapper(int threshold, float loadFactor)
          Constructor.
HashMapWrapper(Map<String,String> metaData)
           
 
Method Summary
 void clear()
           
 Set<Map.Entry<MapJoinKey,MapJoinRowContainer>> entrySet()
           
 MapJoinRowContainer get(MapJoinKey key)
           
 MapJoinKey getAnyKey()
           
 void put(MapJoinKey key, MapJoinRowContainer value)
           
 int size()
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.persistence.AbstractMapJoinTableContainer
getMetaData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HashMapWrapper

public HashMapWrapper(int threshold,
                      float loadFactor)
Constructor.

Parameters:
threshold - User specified threshold to store new values into persistent storage.

HashMapWrapper

public HashMapWrapper(Map<String,String> metaData)

HashMapWrapper

public HashMapWrapper(int threshold)

HashMapWrapper

public HashMapWrapper()
Method Detail

get

public MapJoinRowContainer get(MapJoinKey key)
Specified by:
get in interface MapJoinTableContainer

put

public void put(MapJoinKey key,
                MapJoinRowContainer value)
Specified by:
put in interface MapJoinTableContainer

size

public int size()
Specified by:
size in interface MapJoinTableContainer

entrySet

public Set<Map.Entry<MapJoinKey,MapJoinRowContainer>> entrySet()
Specified by:
entrySet in interface MapJoinTableContainer

clear

public void clear()
Specified by:
clear in interface MapJoinTableContainer

getAnyKey

public MapJoinKey getAnyKey()
Specified by:
getAnyKey in interface MapJoinTableContainer


Copyright © 2014 The Apache Software Foundation. All rights reserved.