org.apache.hadoop.hive.serde2.avro
Class InstanceCache<SeedObject,Instance>

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.avro.InstanceCache<SeedObject,Instance>
Type Parameters:
SeedObject - Object that determines the instance
Instance - Instance that will be created from SeedObject.

public abstract class InstanceCache<SeedObject,Instance>
extends Object

Cache for objects whose creation only depends on some other set of objects and therefore can be used against other equivalent versions of those objects. Essentially memoizes instance creation.


Constructor Summary
InstanceCache()
           
 
Method Summary
protected abstract  Instance makeInstance(SeedObject hv)
           
 Instance retrieve(SeedObject hv)
          Retrieve (or create if it doesn't exist) the correct Instance for this SeedObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InstanceCache

public InstanceCache()
Method Detail

retrieve

public Instance retrieve(SeedObject hv)
                  throws AvroSerdeException
Retrieve (or create if it doesn't exist) the correct Instance for this SeedObject

Throws:
AvroSerdeException

makeInstance

protected abstract Instance makeInstance(SeedObject hv)
                                  throws AvroSerdeException
Throws:
AvroSerdeException


Copyright © 2011 The Apache Software Foundation