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

Field Summary
protected static org.apache.commons.logging.Log LOG
           
 
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)
           
 void put(MapJoinKey key, MapJoinRowContainer value)
           
 int size()
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.persistence.AbstractMapJoinTableContainer
getMetaData, putMetaData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
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


Copyright © 2012 The Apache Software Foundation