HIVE-11469 : Update doc for InstanceCache to clearly define the contract on the 
SeedObject (Swarnim Kulkarni via Ashutosh Chauhan)


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

Branch: refs/heads/llap
Commit: dd2bdfc6702f8ecb88255c4258e4449aa9b75af5
Parents: 7796dd6
Author: Swarnim Kulkarni <kulkarni.swar...@gmail.com>
Authored: Fri Aug 7 09:53:00 2015 -0800
Committer: Ashutosh Chauhan <hashut...@apache.org>
Committed: Mon Aug 24 10:30:16 2015 -0700

----------------------------------------------------------------------
 .../hadoop/hive/serde2/avro/InstanceCache.java     | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/dd2bdfc6/serde/src/java/org/apache/hadoop/hive/serde2/avro/InstanceCache.java
----------------------------------------------------------------------
diff --git 
a/serde/src/java/org/apache/hadoop/hive/serde2/avro/InstanceCache.java 
b/serde/src/java/org/apache/hadoop/hive/serde2/avro/InstanceCache.java
index c7289cb..8f6a911 100644
--- a/serde/src/java/org/apache/hadoop/hive/serde2/avro/InstanceCache.java
+++ b/serde/src/java/org/apache/hadoop/hive/serde2/avro/InstanceCache.java
@@ -17,20 +17,21 @@
  */
 package org.apache.hadoop.hive.serde2.avro;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 /**
- * 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.
+ * 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.
  *
- * @param <SeedObject>  Object that determines the instance
- * @param <Instance>  Instance that will be created from SeedObject.
+ * @param <SeedObject> Object that determines the instance. The cache uses 
this object as a key for
+ *          its hash which is why it is imperative to have appropriate equals 
and hashcode
+ *          implementation for this object for the cache to work properly
+ * @param <Instance> Instance that will be created from SeedObject.
  */
 public abstract class InstanceCache<SeedObject, Instance> {
   private static final Log LOG = LogFactory.getLog(InstanceCache.class);

Reply via email to